gooderp18绿色标准版
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

42290 lines
1.6MB

  1. +++++++++++
  2. Python News
  3. +++++++++++
  4. What's New in Python 3.12.3 final?
  5. ==================================
  6. *Release date: 2024-04-09*
  7. Security
  8. --------
  9. - gh-issue-115398: Allow controlling Expat >=2.6.0 reparse deferral
  10. (CVE-2023-52425) by adding five new methods:
  11. * :meth:`xml.etree.ElementTree.XMLParser.flush`
  12. * :meth:`xml.etree.ElementTree.XMLPullParser.flush`
  13. * :meth:`xml.parsers.expat.xmlparser.GetReparseDeferralEnabled`
  14. * :meth:`xml.parsers.expat.xmlparser.SetReparseDeferralEnabled`
  15. * :meth:`xml.sax.expatreader.ExpatParser.flush`
  16. - gh-issue-115399: Update bundled libexpat to 2.6.0
  17. - gh-issue-115243: Fix possible crashes in :meth:`collections.deque.index`
  18. when the deque is concurrently modified.
  19. - gh-issue-114572: :meth:`ssl.SSLContext.cert_store_stats` and
  20. :meth:`ssl.SSLContext.get_ca_certs` now correctly lock access to the
  21. certificate store, when the :class:`ssl.SSLContext` is shared across
  22. multiple threads.
  23. Core and Builtins
  24. -----------------
  25. - gh-issue-109120: Added handle of incorrect star expressions, e.g ``f(3,
  26. *)``. Patch by Grigoryev Semyon
  27. - gh-issue-99108: Updated the :mod:`hashlib` built-in `HACL\* project`_ C
  28. code from upstream that we use for many implementations when they are not
  29. present via OpenSSL in a given build. This also avoids the rare potential
  30. for a C symbol name one definition rule linking issue.
  31. .. _HACL\* project: https://github.com/hacl-star/hacl-star
  32. - gh-issue-116735: For ``INSTRUMENTED_CALL_FUNCTION_EX``, set ``arg0`` to
  33. ``sys.monitoring.MISSING`` instead of ``None`` for
  34. :monitoring-event:`CALL` event.
  35. - gh-issue-113964: Starting new threads and process creation through
  36. :func:`os.fork` are now only prevented once all non-daemon threads exit.
  37. - gh-issue-116604: Respect the status of the garbage collector when indirect
  38. calls are made via :c:func:`PyErr_CheckSignals` and the evaluation
  39. breaker. Patch by Pablo Galindo
  40. - gh-issue-116626: Ensure ``INSTRUMENTED_CALL_FUNCTION_EX`` always emits
  41. :monitoring-event:`CALL`
  42. - gh-issue-116296: Fix possible refleak in :meth:`!object.__reduce__`
  43. internal error handling.
  44. - gh-issue-116034: Fix location of the error on a failed assertion.
  45. - gh-issue-115823: Properly calculate error ranges in the parser when
  46. raising :exc:`SyntaxError` exceptions caused by invalid byte sequences.
  47. Patch by Pablo Galindo
  48. - gh-issue-112087: For an empty reverse iterator for list will be reduced to
  49. :func:`reversed`. Patch by Donghee Na.
  50. - gh-issue-115154: Fix a bug that was causing the
  51. :func:`tokenize.untokenize` function to handle unicode named literals
  52. incorrectly. Patch by Pablo Galindo
  53. - gh-issue-114828: Fix compilation crashes in uncommon code examples using
  54. :func:`super` inside a comprehension in a class body.
  55. - gh-issue-115011: Setters for members with an unsigned integer type now
  56. support the same range of valid values for objects that has a
  57. :meth:`~object.__index__` method as for :class:`int`.
  58. - gh-issue-112215: Change the C recursion limits to more closely reflect the
  59. underlying platform limits.
  60. - gh-issue-96497: Fix incorrect resolution of mangled class variables used
  61. in assignment expressions in comprehensions.
  62. Library
  63. -------
  64. - gh-issue-117467: Preserve mailbox ownership when rewriting in
  65. :func:`mailbox.mbox.flush`. Patch by Tony Mountifield.
  66. - gh-issue-117310: Fixed an unlikely early & extra ``Py_DECREF`` triggered
  67. crash in :mod:`ssl` when creating a new ``_ssl._SSLContext`` if CPython
  68. was built implausibly such that the default cipher list is empty **or**
  69. the SSL library it was linked against reports a failure from its C
  70. ``SSL_CTX_set_cipher_list()`` API.
  71. - gh-issue-117178: Fix regression in lazy loading of self-referential
  72. modules, introduced in gh-114781.
  73. - gh-issue-117084: Fix :mod:`zipfile` extraction for directory entries with
  74. the name containing backslashes on Windows.
  75. - gh-issue-117110: Fix a bug that prevents subclasses of :class:`typing.Any`
  76. to be instantiated with arguments. Patch by Chris Fu.
  77. - gh-issue-90872: On Windows, :meth:`subprocess.Popen.wait` no longer calls
  78. ``WaitForSingleObject()`` with a negative timeout: pass ``0`` ms if the
  79. timeout is negative. Patch by Victor Stinner.
  80. - gh-issue-116957: configparser: Don't leave ConfigParser values in an
  81. invalid state (stored as a list instead of a str) after an earlier read
  82. raised DuplicateSectionError or DuplicateOptionError.
  83. - gh-issue-90095: Ignore empty lines and comments in ``.pdbrc``
  84. - gh-issue-116764: Restore support of ``None`` and other false values in
  85. :mod:`urllib.parse` functions :func:`~urllib.parse.parse_qs` and
  86. :func:`~urllib.parse.parse_qsl`. Also, they now raise a TypeError for
  87. non-zero integers and non-empty sequences.
  88. - gh-issue-116811: In ``PathFinder.invalidate_caches``, delegate to
  89. ``MetadataPathFinder.invalidate_caches``.
  90. - gh-issue-116600: Fix :func:`repr` for global :class:`~enum.Flag` members.
  91. - gh-issue-116484: Change automatically generated
  92. :class:`tkinter.Checkbutton` widget names to avoid collisions with
  93. automatically generated :class:`tkinter.ttk.Checkbutton` widget names
  94. within the same parent widget.
  95. - gh-issue-116401: Fix blocking :func:`os.fwalk` and :func:`shutil.rmtree`
  96. on opening named pipe.
  97. - gh-issue-116143: Fix a race in pydoc ``_start_server``, eliminating a
  98. window in which ``_start_server`` can return a thread that is "serving"
  99. but without a ``docserver`` set.
  100. - gh-issue-116325: :mod:`typing`: raise :exc:`SyntaxError` instead of
  101. :exc:`AttributeError` on forward references as empty strings.
  102. - gh-issue-90535: Fix support of *interval* values > 1 in
  103. :class:`logging.TimedRotatingFileHandler` for ``when='MIDNIGHT'`` and
  104. ``when='Wx'``.
  105. - gh-issue-115978: Disable preadv(), readv(), pwritev(), and writev() on
  106. WASI.
  107. Under wasmtime for WASI 0.2, these functions don't pass test_posix
  108. (https://github.com/bytecodealliance/wasmtime/issues/7830).
  109. - gh-issue-88352: Fix the computation of the next rollover time in the
  110. :class:`logging.TimedRotatingFileHandler` handler.
  111. :meth:`!computeRollover` now always returns a timestamp larger than the
  112. specified time and works correctly during the DST change.
  113. :meth:`!doRollover` no longer overwrite the already rolled over file,
  114. saving from data loss when run at midnight or during repeated time at the
  115. DST change.
  116. - gh-issue-87115: Set ``__main__.__spec__`` to ``None`` when running a
  117. script with :mod:`pdb`
  118. - gh-issue-76511: Fix UnicodeEncodeError in :meth:`email.Message.as_string`
  119. that results when a message that claims to be in the ascii character set
  120. actually has non-ascii characters. Non-ascii characters are now replaced
  121. with the U+FFFD replacement character, like in the ``replace`` error
  122. handler.
  123. - gh-issue-116040: [Enum] fix by-value calls when second value is falsey;
  124. e.g. Cardinal(1, 0)
  125. - gh-issue-75988: Fixed :func:`unittest.mock.create_autospec` to pass the
  126. call through to the wrapped object to return the real result.
  127. - gh-issue-115881: Fix issue where :func:`ast.parse` would incorrectly flag
  128. conditional context managers (such as ``with (x() if y else z()): ...``)
  129. as invalid syntax if ``feature_version=(3, 8)`` was passed. This reverts
  130. changes to the grammar made as part of gh-94949.
  131. - gh-issue-115886: Fix silent truncation of the name with an embedded null
  132. character in :class:`multiprocessing.shared_memory.SharedMemory`.
  133. - gh-issue-115809: Improve algorithm for computing which rolled-over log
  134. files to delete in :class:`logging.TimedRotatingFileHandler`. It is now
  135. reliable for handlers without ``namer`` and with arbitrary deterministic
  136. ``namer`` that leaves the datetime part in the file name unmodified.
  137. - gh-issue-74668: :mod:`urllib.parse` functions
  138. :func:`~urllib.parse.parse_qs` and :func:`~urllib.parse.parse_qsl` now
  139. support bytes arguments containing raw and percent-encoded non-ASCII data.
  140. - gh-issue-67044: :func:`csv.writer` now always quotes or escapes ``'\r'``
  141. and ``'\n'``, regardless of *lineterminator* value.
  142. - gh-issue-115712: :func:`csv.writer()` now quotes empty fields if delimiter
  143. is a space and skipinitialspace is true and raises exception if quoting is
  144. not possible.
  145. - gh-issue-112364: Fixed :func:`ast.unparse` to handle format_spec with
  146. ``"``, ``'`` or ``\\``. Patched by Frank Hoffmann.
  147. - gh-issue-111358: Fix a bug in
  148. :meth:`asyncio.BaseEventLoop.shutdown_default_executor` to ensure the
  149. timeout passed to the coroutine behaves as expected.
  150. - gh-issue-115618: Fix improper decreasing the reference count for ``None``
  151. argument in :class:`property` methods :meth:`~property.getter`,
  152. :meth:`~property.setter` and :meth:`~property.deleter`.
  153. - gh-issue-115570: A :exc:`DeprecationWarning` is no longer omitted on
  154. access to the ``__doc__`` attributes of the deprecated ``typing.io`` and
  155. ``typing.re`` pseudo-modules.
  156. - gh-issue-112006: Fix :func:`inspect.unwrap` for types with the
  157. ``__wrapper__`` data descriptor.
  158. - gh-issue-101293: Support callables with the ``__call__()`` method and
  159. types with ``__new__()`` and ``__init__()`` methods set to class methods,
  160. static methods, bound methods, partial functions, and other types of
  161. methods and descriptors in :meth:`inspect.Signature.from_callable`.
  162. - gh-issue-115392: Fix a bug in :mod:`doctest` where incorrect line numbers
  163. would be reported for decorated functions.
  164. - gh-issue-114563: Fix several :func:`format()` bugs when using the C
  165. implementation of :class:`~decimal.Decimal`: * memory leak in some rare
  166. cases when using the ``z`` format option (coerce negative 0) * incorrect
  167. output when applying the ``z`` format option to type ``F`` (fixed-point
  168. with capital ``NAN`` / ``INF``) * incorrect output when applying the ``#``
  169. format option (alternate form)
  170. - gh-issue-115197: ``urllib.request`` no longer resolves the hostname before
  171. checking it against the system's proxy bypass list on macOS and Windows.
  172. - gh-issue-115165: Most exceptions are now ignored when attempting to set
  173. the ``__orig_class__`` attribute on objects returned when calling
  174. :mod:`typing` generic aliases (including generic aliases created using
  175. :data:`typing.Annotated`). Previously only :exc:`AttributeError` was
  176. ignored. Patch by Dave Shawley.
  177. - gh-issue-115133: Fix tests for
  178. :class:`~xml.etree.ElementTree.XMLPullParser` with Expat 2.6.0.
  179. - gh-issue-115059: :meth:`io.BufferedRandom.read1` now flushes the
  180. underlying write buffer.
  181. - gh-issue-79382: Trailing ``**`` no longer allows to match files and
  182. non-existing paths in recursive :func:`~glob.glob`.
  183. - gh-issue-114071: Support tuple subclasses using auto() for enum member
  184. value.
  185. - gh-issue-114763: Protect modules loaded with
  186. :class:`importlib.util.LazyLoader` from race conditions when multiple
  187. threads try to access attributes before the loading is complete.
  188. - gh-issue-97959: Fix rendering class methods, bound methods, method and
  189. function aliases in :mod:`pydoc`. Class methods no longer have "method of
  190. builtins.type instance" note. Corresponding notes are now added for class
  191. and unbound methods. Method and function aliases now have references to
  192. the module or the class where the origin was defined if it differs from
  193. the current. Bound methods are now listed in the static methods section.
  194. Methods of builtin classes are now supported as well as methods of Python
  195. classes.
  196. - gh-issue-112281: Allow creating :ref:`union of types<types-union>` for
  197. :class:`typing.Annotated` with unhashable metadata.
  198. - gh-issue-111775: Fix
  199. :meth:`importlib.resources.simple.ResourceHandle.open` for text mode,
  200. added missed ``stream`` argument.
  201. - gh-issue-90095: Make .pdbrc and -c work with any valid pdb commands.
  202. - gh-issue-107155: Fix incorrect output of ``help(x)`` where ``x`` is a
  203. :keyword:`lambda` function, which has an ``__annotations__`` dictionary
  204. attribute with a ``"return"`` key.
  205. - gh-issue-105866: Fixed ``_get_slots`` bug which caused error when defining
  206. dataclasses with slots and a weakref_slot.
  207. - gh-issue-60346: Fix ArgumentParser inconsistent with parse_known_args.
  208. - gh-issue-100985: Update HTTPSConnection to consistently wrap IPv6
  209. Addresses when using a proxy.
  210. - gh-issue-100884: email: fix misfolding of comma in address-lists over
  211. multiple lines in combination with unicode encoding.
  212. - gh-issue-95782: Fix :func:`io.BufferedReader.tell`,
  213. :func:`io.BufferedReader.seek`, :func:`_pyio.BufferedReader.tell`,
  214. :func:`io.BufferedRandom.tell`, :func:`io.BufferedRandom.seek` and
  215. :func:`_pyio.BufferedRandom.tell` being able to return negative offsets.
  216. - gh-issue-96310: Fix a traceback in :mod:`argparse` when all options in a
  217. mutually exclusive group are suppressed.
  218. - gh-issue-93205: Fixed a bug in
  219. :class:`logging.handlers.TimedRotatingFileHandler` where multiple rotating
  220. handler instances pointing to files with the same name but different
  221. extensions would conflict and not delete the correct files.
  222. - bpo-44865: Add missing call to localization function in :mod:`argparse`.
  223. - bpo-43952: Fix :meth:`multiprocessing.connection.Listener.accept()` to
  224. accept empty bytes as authkey. Not accepting empty bytes as key causes it
  225. to hang indefinitely.
  226. - bpo-42125: linecache: get module name from ``__spec__`` if available. This
  227. allows getting source code for the ``__main__`` module when a custom
  228. loader is used.
  229. - gh-issue-66543: Make :func:`mimetypes.guess_type` properly parsing of URLs
  230. with only a host name, URLs containing fragment or query, and filenames
  231. with only a UNC sharepoint on Windows. Based on patch by Dong-hee Na.
  232. - bpo-33775: Add 'default' and 'version' help text for localization in
  233. argparse.
  234. Documentation
  235. -------------
  236. - gh-issue-115399: Document CVE-2023-52425 of Expat <2.6.0 under "XML
  237. vulnerabilities".
  238. - gh-issue-115233: Fix an example for :class:`~logging.LoggerAdapter` in the
  239. Logging Cookbook.
  240. Tests
  241. -----
  242. - gh-issue-83434: Disable JUnit XML output (``--junit-xml=FILE`` command
  243. line option) in regrtest when hunting for reference leaks (``-R`` option).
  244. Patch by Victor Stinner.
  245. - gh-issue-117187: Fix XML tests for vanilla Expat <2.6.0.
  246. - gh-issue-116333: Tests of TLS related things (error codes, etc) were
  247. updated to be more lenient about specific error message strings and
  248. behaviors as seen in the BoringSSL and AWS-LC forks of OpenSSL.
  249. - gh-issue-115979: Update test_importlib so that it passes under WASI SDK
  250. 21.
  251. - gh-issue-112536: Add --tsan to test.regrtest for running TSAN tests in
  252. reasonable execution times. Patch by Donghee Na.
  253. - gh-issue-116307: Added import helper ``isolated_modules`` as
  254. ``CleanImport`` does not remove modules imported during the context. Use
  255. it in importlib.resources tests to avoid leaving ``mod`` around to impede
  256. importlib.metadata tests.
  257. - gh-issue-115720: Leak tests (``-R``, ``--huntrleaks``) now show a summary
  258. of the number of leaks found in each iteration.
  259. - gh-issue-115122: Add ``--bisect`` option to regrtest test runner: run
  260. failed tests with ``test.bisect_cmd`` to identify failing tests. Patch by
  261. Victor Stinner.
  262. - gh-issue-115596: Fix ``ProgramPriorityTests`` in ``test_os`` permanently
  263. changing the process priority.
  264. Build
  265. -----
  266. - gh-issue-116313: Get WASI builds to work under wasmtime 18 w/ WASI
  267. 0.2/preview2 primitives.
  268. - gh-issue-116117: Backport ``libb2``'s PR #42 to fix compiling CPython on
  269. 32-bit Windows with ``clang-cl``.
  270. - gh-issue-115167: Avoid vendoring ``vcruntime140_threads.dll`` when
  271. building with Visual Studio 2022 version 17.8.
  272. - gh-issue-112536: Add support for thread sanitizer (TSAN)
  273. Windows
  274. -------
  275. - gh-issue-117267: Ensure ``DirEntry.stat().st_ctime`` behaves consistently
  276. with :func:`os.stat` during the deprecation period of ``st_ctime`` by
  277. containing the same value as ``st_birthtime``. After the deprecation
  278. period, ``st_ctime`` will be the metadata change time (or unavailable
  279. through ``DirEntry``), and only ``st_birthtime`` will contain the creation
  280. time.
  281. - gh-issue-116773: Fix instances of ``<_overlapped.Overlapped object at
  282. 0xXXX> still has pending operation at deallocation, the process may
  283. crash``.
  284. - gh-issue-91227: Fix the asyncio ProactorEventLoop implementation so that
  285. sending a datagram to an address that is not listening does not prevent
  286. receiving any more datagrams.
  287. - gh-issue-115554: The installer now has more strict rules about updating
  288. the :ref:`launcher`. In general, most users only have a single launcher
  289. installed and will see no difference. When multiple launchers have been
  290. installed, the option to install the launcher is disabled until all but
  291. one have been removed. Downgrading the launcher (which was never allowed)
  292. is now more obviously blocked.
  293. - gh-issue-115543: :ref:`launcher` can now detect Python 3.13 when installed
  294. from the Microsoft Store, and will install Python 3.12 by default when
  295. :envvar:`PYLAUNCHER_ALLOW_INSTALL` is set.
  296. - gh-issue-115049: Fixes ``py.exe`` launcher failing when run as users
  297. without user profiles.
  298. - gh-issue-115009: Update Windows installer to use SQLite 3.45.1.
  299. IDLE
  300. ----
  301. - gh-issue-88516: On macOS show a proxy icon in the title bar of editor
  302. windows to match platform behaviour.
  303. Tools/Demos
  304. -----------
  305. - gh-issue-113516: Don't set ``LDSHARED`` when building for WASI.
  306. C API
  307. -----
  308. - gh-issue-117021: Fix integer overflow in :c:func:`PyLong_AsPid` on
  309. non-Windows 64-bit platforms.
  310. - gh-issue-116869: Make the C API compatible with
  311. ``-Werror=declaration-after-statement`` compiler flag again. Patch by
  312. Victor Stinner.
  313. What's New in Python 3.12.2 final?
  314. ==================================
  315. *Release date: 2024-02-06*
  316. Security
  317. --------
  318. - gh-issue-113659: Skip ``.pth`` files with names starting with a dot or
  319. hidden file attribute.
  320. Core and Builtins
  321. -----------------
  322. - gh-issue-114887: Changed socket type validation in
  323. :meth:`~asyncio.loop.create_datagram_endpoint` to accept all non-stream
  324. sockets. This fixes a regression in compatibility with raw sockets.
  325. - gh-issue-114388: Fix a :exc:`RuntimeWarning` emitted when assign an
  326. integer-like value that is not an instance of :class:`int` to an attribute
  327. that corresponds to a C struct member of :ref:`type <PyMemberDef-types>`
  328. T_UINT and T_ULONG. Fix a double :exc:`RuntimeWarning` emitted when assign
  329. a negative integer value to an attribute that corresponds to a C struct
  330. member of type T_UINT.
  331. - gh-issue-113703: Fix a regression in the :mod:`codeop` module that was
  332. causing it to incorrectly identify incomplete f-strings. Patch by Pablo
  333. Galindo
  334. - gh-issue-89811: Check for a valid ``tp_version_tag`` before performing
  335. bytecode specializations that rely on this value being usable.
  336. - gh-issue-113602: Fix an error that was causing the parser to try to
  337. overwrite existing errors and crashing in the process. Patch by Pablo
  338. Galindo
  339. - gh-issue-113297: Fix segfault in the compiler on with statement with 19
  340. context managers.
  341. - gh-issue-106905: Use per AST-parser state rather than global state to
  342. track recursion depth within the AST parser to prevent potential race
  343. condition due to simultaneous parsing.
  344. The issue primarily showed up in 3.11 by multithreaded users of
  345. :func:`ast.parse`. In 3.12 a change to when garbage collection can be
  346. triggered prevented the race condition from occurring.
  347. - gh-issue-112943: Correctly compute end column offsets for multiline tokens
  348. in the :mod:`tokenize` module. Patch by Pablo Galindo
  349. - gh-issue-112716: Fix SystemError in the ``import`` statement and in
  350. ``__reduce__()`` methods of builtin types when ``__builtins__`` is not a
  351. dict.
  352. - gh-issue-94606: Fix UnicodeEncodeError when
  353. :func:`email.message.get_payload` reads a message with a Unicode surrogate
  354. character and the message content is not well-formed for surrogateescape
  355. encoding. Patch by Sidney Markowitz.
  356. Library
  357. -------
  358. - gh-issue-114965: Update bundled pip to 24.0
  359. - gh-issue-114959: :mod:`tarfile` no longer ignores errors when trying to
  360. extract a directory on top of a file.
  361. - gh-issue-109475: Fix support of explicit option value "--" in
  362. :mod:`argparse` (e.g. ``--option=--``).
  363. - gh-issue-110190: Fix ctypes structs with array on Windows ARM64 platform
  364. by setting ``MAX_STRUCT_SIZE`` to 32 in stgdict. Patch by Diego Russo
  365. - gh-issue-113280: Fix a leak of open socket in rare cases when error
  366. occurred in :class:`ssl.SSLSocket` creation.
  367. - gh-issue-77749: :meth:`email.policy.EmailPolicy.fold` now always encodes
  368. non-ASCII characters in headers if :attr:`~email.policy.EmailPolicy.utf8`
  369. is false.
  370. - gh-issue-114492: Make the result of :func:`termios.tcgetattr` reproducible
  371. on Alpine Linux. Previously it could leave a random garbage in some
  372. fields.
  373. - gh-issue-113267: Revert changes in :gh:`106584` which made calls of
  374. ``TestResult`` methods ``startTest()`` and ``stopTest()`` unbalanced.
  375. - gh-issue-75128: Ignore an :exc:`OSError` in
  376. :meth:`asyncio.BaseEventLoop.create_server` when IPv6 is available but the
  377. interface cannot actually support it.
  378. - gh-issue-114257: Dismiss the :exc:`FileNotFound` error in
  379. :func:`ctypes.util.find_library` and just return ``None`` on Linux.
  380. - gh-issue-114328: The :func:`tty.setcbreak` and new
  381. :func:`tty.cfmakecbreak` no longer clears the terminal input ICRLF flag.
  382. This fixes a regression introduced in 3.12 that no longer matched how OSes
  383. define cbreak mode in their ``stty(1)`` manual pages.
  384. - gh-issue-101438: Avoid reference cycle in ElementTree.iterparse. The
  385. iterator returned by ``ElementTree.iterparse`` may hold on to a file
  386. descriptor. The reference cycle prevented prompt clean-up of the file
  387. descriptor if the returned iterator was not exhausted.
  388. - gh-issue-104522: :exc:`OSError` raised when run a subprocess now only has
  389. *filename* attribute set to *cwd* if the error was caused by a failed
  390. attempt to change the current directory.
  391. - gh-issue-114149: Enum: correctly handle tuple subclasses in custom
  392. ``__new__``.
  393. - gh-issue-109534: Fix a reference leak in
  394. :class:`asyncio.selector_events.BaseSelectorEventLoop` when SSL handshakes
  395. fail. Patch contributed by Jamie Phan.
  396. - gh-issue-114077: Fix possible :exc:`OverflowError` in
  397. :meth:`socket.socket.sendfile` when pass *count* larger than 2 GiB on
  398. 32-bit platform.
  399. - gh-issue-114014: Fixed a bug in :class:`fractions.Fraction` where an
  400. invalid string using ``d`` in the decimals part creates a different error
  401. compared to other invalid letters/characters. Patch by Jeremiah Gabriel
  402. Pascual.
  403. - gh-issue-113951: Fix the behavior of ``tag_unbind()`` methods of
  404. :class:`tkinter.Text` and :class:`tkinter.Canvas` classes with three
  405. arguments. Previously, ``widget.tag_unbind(tag, sequence, funcid)``
  406. destroyed the current binding for *sequence*, leaving *sequence* unbound,
  407. and deleted the *funcid* command. Now it removes only *funcid* from the
  408. binding for *sequence*, keeping other commands, and deletes the *funcid*
  409. command. It leaves *sequence* unbound only if *funcid* was the last bound
  410. command.
  411. - gh-issue-113877: Fix :mod:`tkinter` method ``winfo_pathname()`` on 64-bit
  412. Windows.
  413. - gh-issue-113661: unittest runner: Don't exit 5 if tests were skipped. The
  414. intention of exiting 5 was to detect issues where the test suite wasn't
  415. discovered at all. If we skipped tests, it was correctly discovered.
  416. - gh-issue-113781: Silence unraisable AttributeError when warnings are
  417. emitted during Python finalization.
  418. - gh-issue-112932: Restore the ability for :mod:`zipfile` to ``extractall``
  419. from zip files with a "/" directory entry in them as is commonly added to
  420. zips by some wiki or bug tracker data exporters.
  421. - gh-issue-113594: Fix :exc:`UnicodeEncodeError` in :mod:`email` when
  422. re-fold lines that contain unknown-8bit encoded part followed by
  423. non-unknown-8bit encoded part.
  424. - gh-issue-113538: In :meth:`asyncio.StreamReaderProtocol.connection_made`,
  425. there is callback that logs an error if the task wrapping the "connected
  426. callback" fails. This callback would itself fail if the task was
  427. cancelled. Prevent this by checking whether the task was cancelled first.
  428. If so, close the transport but don't log an error.
  429. - gh-issue-85567: Fix resource warnings for unclosed files in :mod:`pickle`
  430. and :mod:`pickletools` command line interfaces.
  431. - gh-issue-101225: Increase the backlog for
  432. :class:`multiprocessing.connection.Listener` objects created by
  433. :mod:`multiprocessing.manager` and :mod:`multiprocessing.resource_sharer`
  434. to significantly reduce the risk of getting a connection refused error
  435. when creating a :class:`multiprocessing.connection.Connection` to them.
  436. - gh-issue-113543: Make sure that ``webbrowser.MacOSXOSAScript`` sends
  437. ``webbrowser.open`` audit event.
  438. - gh-issue-113028: When a second reference to a string appears in the input
  439. to :mod:`pickle`, and the Python implementation is in use, we are
  440. guaranteed that a single copy gets pickled and a single object is shared
  441. when reloaded. Previously, in protocol 0, when a string contained certain
  442. characters (e.g. newline) it resulted in duplicate objects.
  443. - gh-issue-113421: Fix multiprocessing logger for ``%(filename)s``.
  444. - gh-issue-111784: Fix segfaults in the ``_elementtree`` module. Fix first
  445. segfault during deallocation of ``_elementtree.XMLParser`` instances by
  446. keeping strong reference to ``pyexpat`` module in module state for capsule
  447. lifetime. Fix second segfault which happens in the same deallocation
  448. process by keeping strong reference to ``_elementtree`` module in
  449. ``XMLParser`` structure for ``_elementtree`` module lifetime.
  450. - gh-issue-113407: Fix import of :mod:`unittest.mock` when CPython is built
  451. without docstrings.
  452. - gh-issue-113320: Fix regression in Python 3.12 where
  453. :class:`~typing.Protocol` classes that were not marked as
  454. :func:`runtime-checkable <typing.runtime_checkable>` would be
  455. unnecessarily introspected, potentially causing exceptions to be raised if
  456. the protocol had problematic members. Patch by Alex Waygood.
  457. - gh-issue-113358: Fix rendering tracebacks for exceptions with a broken
  458. ``__getattr__``.
  459. - gh-issue-113214: Fix an ``AttributeError`` during asyncio SSL protocol
  460. aborts in SSL-over-SSL scenarios.
  461. - gh-issue-113246: Update bundled pip to 23.3.2.
  462. - gh-issue-113199: Make ``http.client.HTTPResponse.read1`` and
  463. ``http.client.HTTPResponse.readline`` close IO after reading all data when
  464. content length is known. Patch by Illia Volochii.
  465. - gh-issue-113188: Fix :func:`shutil.copymode` and :func:`shutil.copystat`
  466. on Windows. Previously they worked differenly if *dst* is a symbolic link:
  467. they modified the permission bits of *dst* itself rather than the file it
  468. points to if *follow_symlinks* is true or *src* is not a symbolic link,
  469. and did not modify the permission bits if *follow_symlinks* is false and
  470. *src* is a symbolic link.
  471. - gh-issue-61648: Detect line numbers of properties in doctests.
  472. - gh-issue-112559: :func:`signal.signal` and :func:`signal.getsignal` no
  473. longer call ``repr`` on callable handlers. :func:`asyncio.run` and
  474. :meth:`asyncio.Runner.run` no longer call ``repr`` on the task results.
  475. Patch by Yilei Yang.
  476. - gh-issue-110190: Fix ctypes structs with array on PPC64LE platform by
  477. setting ``MAX_STRUCT_SIZE`` to 64 in stgdict. Patch by Diego Russo.
  478. - gh-issue-79429: Ignore FileNotFoundError when remove a temporary directory
  479. in the multiprocessing finalizer.
  480. - gh-issue-81194: Fix a crash in :func:`socket.if_indextoname` with specific
  481. value (UINT_MAX). Fix an integer overflow in :func:`socket.if_indextoname`
  482. on 64-bit non-Windows platforms.
  483. - gh-issue-112343: Improve handling of pdb convenience variables to avoid
  484. replacing string contents.
  485. - gh-issue-111615: Fix a regression caused by a fix to gh-93162 whereby you
  486. couldn't configure a :class:`QueueHandler` without specifying handlers.
  487. - gh-issue-111049: Fix crash during garbage collection of the
  488. :class:`io.BytesIO` buffer object.
  489. - gh-issue-110345: Show the Tcl/Tk patchlevel (rather than version) in
  490. :meth:`tkinter._test`.
  491. - gh-issue-109858: Protect :mod:`zipfile` from "quoted-overlap" zipbomb. It
  492. now raises BadZipFile when try to read an entry that overlaps with other
  493. entry or central directory.
  494. - gh-issue-114440: On Windows, closing the connection writer when cleaning
  495. up a broken :class:`multiprocessing.Queue` queue is now done for all
  496. queues, rather than only in :mod:`concurrent.futures` manager thread. This
  497. can prevent a deadlock when a ``multiprocessing`` worker process
  498. terminates without cleaning up. This completes the backport of patches by
  499. Victor Stinner and Serhiy Storchaka.
  500. - gh-issue-38807: Fix race condition in :mod:`trace`. Instead of checking if
  501. a directory exists and creating it, directly call :func:`os.makedirs` with
  502. the kwarg ``exist_ok=True``.
  503. - gh-issue-75705: Set unixfrom envelope in :class:`mailbox.mbox` and
  504. :class:`mailbox.MMDF`.
  505. - gh-issue-106233: Fix stacklevel in ``InvalidTZPathWarning`` during
  506. :mod:`zoneinfo` module import.
  507. - gh-issue-105102: Allow :class:`ctypes.Union` to be nested in
  508. :class:`ctypes.Structure` when the system endianness is the opposite of
  509. the classes.
  510. - gh-issue-104282: Fix null pointer dereference in
  511. :func:`lzma._decode_filter_properties` due to improper handling of BCJ
  512. filters with properties of zero length. Patch by Radislav Chugunov.
  513. - gh-issue-102512: When :func:`os.fork` is called from a foreign thread (aka
  514. ``_DummyThread``), the type of the thread in a child process is changed to
  515. ``_MainThread``. Also changed its name and daemonic status, it can be now
  516. joined.
  517. - bpo-35928: :class:`io.TextIOWrapper` now correctly handles the decoding
  518. buffer after ``read()`` and ``write()``.
  519. - bpo-26791: :func:`shutil.move` now moves a symlink into a directory when
  520. that directory is the target of the symlink. This provides the same
  521. behavior as the mv shell command. The previous behavior raised an
  522. exception. Patch by Jeffrey Kintscher.
  523. - bpo-36959: Fix some error messages for invalid ISO format string
  524. combinations in ``strptime()`` that referred to directives not contained
  525. in the format string. Patch by Gordon P. Hemsley.
  526. - bpo-18060: Fixed a class inheritance issue that can cause segfaults when
  527. deriving two or more levels of subclasses from a base class of Structure
  528. or Union.
  529. Documentation
  530. -------------
  531. - gh-issue-110746: Improved markup for valid options/values for methods
  532. ttk.treeview.column and ttk.treeview.heading, and for Layouts.
  533. - gh-issue-95649: Document that the :mod:`asyncio` module contains code
  534. taken from `v0.16.0 of the uvloop project
  535. <https://github.com/MagicStack/uvloop/tree/v0.16.0>`_, as well as the
  536. required MIT licensing information.
  537. Tests
  538. -----
  539. - gh-issue-109980: Fix ``test_tarfile_vs_tar`` in ``test_shutil`` for macOS,
  540. where system tar can include more information in the archive than
  541. :mod:`shutil.make_archive`.
  542. - gh-issue-105089: Fix
  543. ``test.test_zipfile.test_core.TestWithDirectory.test_create_directory_with_write``
  544. test in AIX by doing a bitwise AND of 0xFFFF on mode , so that it will be
  545. in sync with ``zinfo.external_attr``
  546. - bpo-40648: Test modes that file can get with chmod() on Windows.
  547. Build
  548. -----
  549. - gh-issue-112305: Fixed the ``check-clean-src`` step performed on out of
  550. tree builds to detect errant ``$(srcdir)/Python/frozen_modules/*.h`` files
  551. and recommend appropriate source tree cleanup steps to get a working build
  552. again.
  553. - gh-issue-112867: Fix the build for the case that
  554. WITH_PYMALLOC_RADIX_TREE=0 set.
  555. - bpo-11102: The :func:`os.major`, :func:`os.makedev`, and :func:`os.minor`
  556. functions are now available on HP-UX v3.
  557. - bpo-36351: Do not set ipv6type when cross-compiling.
  558. Windows
  559. -------
  560. - gh-issue-109991: Update Windows build to use OpenSSL 3.0.13.
  561. - gh-issue-111239: Update Windows builds to use zlib v1.3.1.
  562. - gh-issue-100107: The ``py.exe`` launcher will no longer attempt to run the
  563. Microsoft Store redirector when launching a script containing a
  564. ``/usr/bin/env`` shebang
  565. - gh-issue-114096: Process privileges that are activated for creating
  566. directory junctions are now restored afterwards, avoiding behaviour
  567. changes in other parts of the program.
  568. - gh-issue-111877: :func:`os.stat` calls were returning incorrect time
  569. values for files that could not be accessed directly.
  570. - gh-issue-113009: :mod:`multiprocessing`: On Windows, fix a race condition
  571. in ``Process.terminate()``: no longer set the ``returncode`` attribute to
  572. always call ``WaitForSingleObject()`` in ``Process.wait()``. Previously,
  573. sometimes the process was still running after ``TerminateProcess()`` even
  574. if ``GetExitCodeProcess()`` is not ``STILL_ACTIVE``. Patch by Victor
  575. Stinner.
  576. - gh-issue-87868: Correctly sort and remove duplicate environment variables
  577. in :py:func:`!_winapi.CreateProcess`.
  578. - bpo-37308: Fix mojibake in :class:`mmap.mmap` when using a non-ASCII
  579. *tagname* argument on Windows.
  580. macOS
  581. -----
  582. - gh-issue-115009: Update macOS installer to use SQLite 3.45.1.
  583. - gh-issue-109991: Update macOS installer to use OpenSSL 3.0.13.
  584. - gh-issue-110459: Running ``configure ... --with-openssl-rpath=X/Y/Z`` no
  585. longer fails to detect OpenSSL on macOS.
  586. - gh-issue-74573: Document that :mod:`dbm.ndbm` can silently corrupt DBM
  587. files on updates when exceeding undocumented platform limits, and can
  588. crash (segmentation fault) when reading such a corrupted file. (FB8919203)
  589. - gh-issue-65701: The :program:`freeze` tool doesn't work with framework
  590. builds of Python. Document this and bail out early when running the tool
  591. with such a build.
  592. - gh-issue-108269: Set ``CFBundleAllowMixedLocalizations`` to true in the
  593. Info.plist for the framework, embedded Python.app and IDLE.app with
  594. framework installs on macOS. This allows applications to pick up the
  595. user's preferred locale when that's different from english.
  596. - gh-issue-102362: Make sure the result of :func:`sysconfig.get_plaform`
  597. includes at least a major and minor versions, even if
  598. ``MACOSX_DEPLOYMENT_TARGET`` is set to only a major version during build
  599. to match the format expected by pip.
  600. - gh-issue-110017: Disable a signal handling stress test on macOS due to a
  601. bug in macOS (FB13453490).
  602. - gh-issue-110820: Make sure the preprocessor definitions for
  603. ``ALIGNOF_MAX_ALIGN_T``, ``SIZEOF_LONG_DOUBLE`` and
  604. ``HAVE_GCC_ASM_FOR_X64`` are correct for Universal 2 builds on macOS.
  605. IDLE
  606. ----
  607. - gh-issue-96905: In idlelib code, stop redefining built-ins 'dict' and
  608. 'object'.
  609. - gh-issue-72284: Improve the lists of features, editor key bindings, and
  610. shell key bingings in the IDLE doc.
  611. - gh-issue-113903: Fix rare failure of test.test_idle, in test_configdialog.
  612. - gh-issue-113729: Fix the "Help -> IDLE Doc" menu bug in 3.11.7 and 3.12.1.
  613. - gh-issue-113269: Fix test_editor hang on macOS Catalina.
  614. - gh-issue-112898: Fix processing unsaved files when quitting IDLE on macOS.
  615. - gh-issue-103820: Revise IDLE bindings so that events from mouse button 4/5
  616. on non-X11 windowing systems (i.e. Win32 and Aqua) are not mistaken for
  617. scrolling.
  618. - bpo-13586: Enter the selected text when opening the "Replace" dialog.
  619. Tools/Demos
  620. -----------
  621. - gh-issue-109991: Update GitHub CI workflows to use OpenSSL 3.0.13 and
  622. multissltests to use 1.1.1w, 3.0.13, 3.1.5, and 3.2.1.
  623. - gh-issue-115015: Fix a bug in Argument Clinic that generated incorrect
  624. code for methods with no parameters that use the :ref:`METH_METHOD |
  625. METH_FASTCALL | METH_KEYWORDS <METH_METHOD-METH_FASTCALL-METH_KEYWORDS>`
  626. calling convention. Only the positional parameter count was checked; any
  627. keyword argument passed would be silently accepted.
  628. What's New in Python 3.12.1 final?
  629. ==================================
  630. *Release date: 2023-12-07*
  631. Core and Builtins
  632. -----------------
  633. - gh-issue-112125: Fix None.__ne__(None) returning NotImplemented instead of
  634. False
  635. - gh-issue-112625: Fixes a bug where a bytearray object could be cleared
  636. while iterating over an argument in the ``bytearray.join()`` method that
  637. could result in reading memory after it was freed.
  638. - gh-issue-105967: Workaround a bug in Apple's macOS platform zlib library
  639. where :func:`zlib.crc32` and :func:`binascii.crc32` could produce
  640. incorrect results on multi-gigabyte inputs. Including when using
  641. :mod:`zipfile` on zips containing large data.
  642. - gh-issue-112356: Stopped erroneously deleting a ``LOAD_NULL`` bytecode
  643. instruction when optimized twice.
  644. - gh-issue-111058: Change coro.cr_frame/gen.gi_frame to return ``None``
  645. after the coroutine/generator has been closed. This fixes a bug where
  646. :func:`~inspect.getcoroutinestate` and :func:`~inspect.getgeneratorstate`
  647. return the wrong state for a closed coroutine/generator.
  648. - gh-issue-112388: Fix an error that was causing the parser to try to
  649. overwrite tokenizer errors. Patch by pablo Galindo
  650. - gh-issue-112387: Fix error positions for decoded strings with backwards
  651. tokenize errors. Patch by Pablo Galindo
  652. - gh-issue-112367: Avoid undefined behaviour when using the perf trampolines
  653. by not freeing the code arenas until shutdown. Patch by Pablo Galindo
  654. - gh-issue-112243: Don't include comments in f-string debug expressions.
  655. Patch by Pablo Galindo
  656. - gh-issue-112266: Change docstrings of :attr:`~object.__dict__` and
  657. :attr:`~object.__weakref__`.
  658. - gh-issue-111654: Fix runtime crash when some error happens in opcode
  659. ``LOAD_FROM_DICT_OR_DEREF``.
  660. - gh-issue-109181: Speed up :obj:`Traceback` object creation by lazily
  661. compute the line number. Patch by Pablo Galindo
  662. - gh-issue-102388: Fix a bug where ``iso2022_jp_3`` and ``iso2022_jp_2004``
  663. codecs read out of bounds
  664. - gh-issue-111366: Fix an issue in the :mod:`codeop` that was causing
  665. :exc:`SyntaxError` exceptions raised in the presence of invalid syntax to
  666. not contain precise error messages. Patch by Pablo Galindo
  667. - gh-issue-111380: Fix a bug that was causing :exc:`SyntaxWarning` to appear
  668. twice when parsing if invalid syntax is encountered later. Patch by Pablo
  669. galindo
  670. - gh-issue-94438: Fix a regression that prevented jumping across ``is None``
  671. and ``is not None`` when debugging. Patch by Savannah Ostrowski.
  672. - gh-issue-110938: Fix error messages for indented blocks with functions and
  673. classes with generic type parameters. Patch by Pablo Galindo
  674. - gh-issue-109894: Fixed crash due to improperly initialized static
  675. :exc:`MemoryError` in subinterpreter.
  676. - gh-issue-110782: Fix crash when :class:`typing.TypeVar` is constructed
  677. with a keyword argument. Patch by Jelle Zijlstra.
  678. - gh-issue-110696: Fix incorrect error message for invalid argument
  679. unpacking. Patch by Pablo Galindo
  680. - gh-issue-110543: Fix regression in Python 3.12 where
  681. :meth:`types.CodeType.replace` would produce a broken code object if
  682. called on a module or class code object that contains a comprehension.
  683. Patch by Jelle Zijlstra.
  684. - gh-issue-110514: Add ``PY_THROW`` to :func:`sys.setprofile` events
  685. - gh-issue-110455: Guard ``assert(tstate->thread_id > 0)`` with ``#ifndef
  686. HAVE_PTHREAD_STUBS``. This allows for for pydebug builds to work under
  687. WASI which (currently) lacks thread support.
  688. - gh-issue-110259: Correctly identify the format spec in f-strings (with
  689. single or triple quotes) that have multiple lines in the expression part
  690. and include a formatting spec. Patch by Pablo Galindo
  691. - gh-issue-110237: Fix missing error checks for calls to ``PyList_Append``
  692. in ``_PyEval_MatchClass``.
  693. - gh-issue-109889: Fix the compiler's redundant NOP detection algorithm to
  694. skip over NOPs with no line number when looking for the next instruction's
  695. lineno.
  696. - gh-issue-109853: ``sys.path[0]`` is now set correctly for subinterpreters.
  697. - gh-issue-105716: Subinterpreters now correctly handle the case where they
  698. have threads running in the background. Before, such threads would
  699. interfere with cleaning up and destroying them, as well as prevent running
  700. another script.
  701. - gh-issue-109793: The main thread no longer exits prematurely when a
  702. subinterpreter is cleaned up during runtime finalization. The bug was a
  703. problem particularly because, when triggered, the Python process would
  704. always return with a 0 exitcode, even if it failed.
  705. - gh-issue-109596: Fix some tokens in the grammar that were incorrectly
  706. marked as soft keywords. Also fix some repeated rule names and ensure that
  707. repeated rules are not allowed. Patch by Pablo Galindo
  708. - gh-issue-109351: Fix crash when compiling an invalid AST involving a named
  709. (walrus) expression.
  710. - gh-issue-109216: Fix possible memory leak in :opcode:`BUILD_MAP`.
  711. - gh-issue-109207: Fix a SystemError in ``__repr__`` of symtable entry
  712. object.
  713. - gh-issue-109179: Fix bug where the C traceback display drops notes from
  714. :exc:`SyntaxError`.
  715. - gh-issue-109052: Use the base opcode when comparing code objects to avoid
  716. interference from instrumentation
  717. - gh-issue-88943: Improve syntax error for non-ASCII character that follows
  718. a numerical literal. It now points on the invalid non-ASCII character, not
  719. on the valid numerical literal.
  720. - gh-issue-106931: Statically allocated string objects are now interned
  721. globally instead of per-interpreter. This fixes a situation where such a
  722. string would only be interned in a single interpreter. Normal string
  723. objects are unaffected.
  724. Library
  725. -------
  726. - gh-issue-79325: Fix an infinite recursion error in
  727. :func:`tempfile.TemporaryDirectory` cleanup on Windows.
  728. - gh-issue-112645: Remove deprecation error on passing ``onerror`` to
  729. :func:`shutil.rmtree`.
  730. - gh-issue-112618: Fix a caching bug relating to :data:`typing.Annotated`.
  731. ``Annotated[str, True]`` is no longer identical to ``Annotated[str, 1]``.
  732. - gh-issue-112334: Fixed a performance regression in 3.12's
  733. :mod:`subprocess` on Linux where it would no longer use the fast-path
  734. ``vfork()`` system call when it should have due to a logic bug, instead
  735. always falling back to the safe but slower ``fork()``.
  736. Also fixed a related 3.12 security regression: If a value of
  737. ``extra_groups=[]`` was passed to :mod:`subprocess.Popen` or related APIs,
  738. the underlying ``setgroups(0, NULL)`` system call to clear the groups list
  739. would not be made in the child process prior to ``exec()``. This has been
  740. assigned CVE-2023-6507.
  741. This was identified via code inspection in the process of fixing the first
  742. bug.
  743. - gh-issue-110190: Fix ctypes structs with array on Arm platform by setting
  744. ``MAX_STRUCT_SIZE`` to 32 in stgdict. Patch by Diego Russo.
  745. - gh-issue-112578: Fix a spurious :exc:`RuntimeWarning` when executing the
  746. :mod:`zipfile` module.
  747. - gh-issue-112509: Fix edge cases that could cause a key to be present in
  748. both the ``__required_keys__`` and ``__optional_keys__`` attributes of a
  749. :class:`typing.TypedDict`. Patch by Jelle Zijlstra.
  750. - gh-issue-112414: Fix regression in Python 3.12 where calling :func:`repr`
  751. on a module that had been imported using a custom :term:`loader` could
  752. fail with :exc:`AttributeError`. Patch by Alex Waygood.
  753. - gh-issue-112358: Revert change to :class:`struct.Struct` initialization
  754. that broke some cases of subclassing.
  755. - gh-issue-94722: Fix bug where comparison between instances of
  756. :class:`~doctest.DocTest` fails if one of them has ``None`` as its lineno.
  757. - gh-issue-112105: Make :func:`readline.set_completer_delims` work with
  758. libedit
  759. - gh-issue-111942: Fix SystemError in the TextIOWrapper constructor with
  760. non-encodable "errors" argument in non-debug mode.
  761. - gh-issue-109538: Issue warning message instead of having
  762. :class:`RuntimeError` be displayed when event loop has already been closed
  763. at :meth:`StreamWriter.__del__`.
  764. - gh-issue-111942: Fix crashes in :meth:`io.TextIOWrapper.reconfigure` when
  765. pass invalid arguments, e.g. non-string encoding.
  766. - gh-issue-111460: :mod:`curses`: restore wide character support (including
  767. :func:`curses.unget_wch` and :meth:`~curses.window.get_wch`) on macOS,
  768. which was unavailable due to a regression in Python 3.12.
  769. - gh-issue-103791: :class:`contextlib.suppress` now supports suppressing
  770. exceptions raised as part of a :exc:`BaseExceptionGroup`, in addition to
  771. the recent support for :exc:`ExceptionGroup`.
  772. - gh-issue-111804: Remove posix.fallocate() under WASI as the underlying
  773. posix_fallocate() is not available in WASI preview2.
  774. - gh-issue-111841: Fix truncating arguments on an embedded null character in
  775. :meth:`os.putenv` and :meth:`os.unsetenv` on Windows.
  776. - gh-issue-111541: Fix :mod:`doctest` for :exc:`SyntaxError` not-builtin
  777. subclasses.
  778. - gh-issue-110894: Call loop exception handler for exceptions in
  779. ``client_connected_cb`` of :func:`asyncio.start_server` so that
  780. applications can handle it. Patch by Kumar Aditya.
  781. - gh-issue-111531: Fix reference leaks in ``bind_class()`` and
  782. ``bind_all()`` methods of :mod:`tkinter` widgets.
  783. - gh-issue-111356: Added :func:`io.text_encoding()`,
  784. :data:`io.DEFAULT_BUFFER_SIZE`, and :class:`io.IncrementalNewlineDecoder`
  785. to ``io.__all__``.
  786. - gh-issue-111342: Fixed typo in :func:`math.sumprod`.
  787. - gh-issue-68166: Remove mention of not supported "vsapi" element type in
  788. :meth:`tkinter.ttk.Style.element_create`. Add tests for
  789. ``element_create()`` and other ``ttk.Style`` methods. Add examples for
  790. ``element_create()`` in the documentation.
  791. - gh-issue-75666: Fix the behavior of :mod:`tkinter` widget's ``unbind()``
  792. method with two arguments. Previously, ``widget.unbind(sequence, funcid)``
  793. destroyed the current binding for *sequence*, leaving *sequence* unbound,
  794. and deleted the *funcid* command. Now it removes only *funcid* from the
  795. binding for *sequence*, keeping other commands, and deletes the *funcid*
  796. command. It leaves *sequence* unbound only if *funcid* was the last bound
  797. command.
  798. - gh-issue-79033: Another attempt at fixing
  799. :func:`asyncio.Server.wait_closed()`. It now blocks until both conditions
  800. are true: the server is closed, *and* there are no more active
  801. connections. (This means that in some cases where in 3.12.0 this function
  802. would *incorrectly* have returned immediately, it will now block; in
  803. particular, when there are no active connections but the server hasn't
  804. been closed yet.)
  805. - gh-issue-111295: Fix :mod:`time` not checking for errors when
  806. initializing.
  807. - gh-issue-111253: Add error checking during :mod:`!_socket` module init.
  808. - gh-issue-111251: Fix :mod:`_blake2` not checking for errors when
  809. initializing.
  810. - gh-issue-111174: Fix crash in :meth:`io.BytesIO.getbuffer` called
  811. repeatedly for empty BytesIO.
  812. - gh-issue-111187: Postpone removal version for locale.getdefaultlocale() to
  813. Python 3.15.
  814. - gh-issue-111159: Fix :mod:`doctest` output comparison for exceptions with
  815. notes.
  816. - gh-issue-110910: Fix invalid state handling in :class:`asyncio.TaskGroup`
  817. and :class:`asyncio.Timeout`. They now raise proper RuntimeError if they
  818. are improperly used and are left in consistent state after this.
  819. - gh-issue-111092: Make turtledemo run without default root enabled.
  820. - gh-issue-110488: Fix a couple of issues in
  821. :meth:`pathlib.PurePath.with_name`: a single dot was incorrectly
  822. considered a valid name, and in :class:`PureWindowsPath`, a name with an
  823. NTFS alternate data stream, like ``a:b``, was incorrectly considered
  824. invalid.
  825. - gh-issue-110392: Fix :func:`tty.setraw` and :func:`tty.setcbreak`:
  826. previously they returned partially modified list of the original tty
  827. attributes. :func:`tty.cfmakeraw` and :func:`tty.cfmakecbreak` now make a
  828. copy of the list of special characters before modifying it.
  829. - gh-issue-110590: Fix a bug in :meth:`!_sre.compile` where :exc:`TypeError`
  830. would be overwritten by :exc:`OverflowError` when the *code* argument was
  831. a list of non-ints.
  832. - gh-issue-65052: Prevent :mod:`pdb` from crashing when trying to display
  833. undisplayable objects
  834. - gh-issue-110519: Deprecation warning about non-integer number in
  835. :mod:`gettext` now alwais refers to the line in the user code where
  836. gettext function or method is used. Previously it could refer to a line in
  837. ``gettext`` code.
  838. - gh-issue-110395: Ensure that :func:`select.kqueue` objects correctly
  839. appear as closed in forked children, to prevent operations on an invalid
  840. file descriptor.
  841. - gh-issue-110378: :func:`~contextlib.contextmanager` and
  842. :func:`~contextlib.asynccontextmanager` context managers now close an
  843. invalid underlying generator object that yields more then one value.
  844. - gh-issue-110365: Fix :func:`termios.tcsetattr` bug that was overwritting
  845. existing errors during parsing integers from ``term`` list.
  846. - gh-issue-109653: Fix a Python 3.12 regression in the import time of
  847. :mod:`random`. Patch by Alex Waygood.
  848. - gh-issue-110196: Add ``__reduce__`` method to :class:`IPv6Address` in
  849. order to keep ``scope_id``
  850. - gh-issue-110036: On Windows, multiprocessing ``Popen.terminate()`` now
  851. catchs :exc:`PermissionError` and get the process exit code. If the
  852. process is still running, raise again the :exc:`PermissionError`.
  853. Otherwise, the process terminated as expected: store its exit code. Patch
  854. by Victor Stinner.
  855. - gh-issue-110038: Fixed an issue that caused :meth:`KqueueSelector.select`
  856. to not return all the ready events in some cases when a file descriptor is
  857. registered for both read and write.
  858. - gh-issue-109631: :mod:`re` functions such as :func:`re.findall`,
  859. :func:`re.split`, :func:`re.search` and :func:`re.sub` which perform short
  860. repeated matches can now be interrupted by user.
  861. - gh-issue-109747: Improve errors for unsupported look-behind patterns. Now
  862. re.error is raised instead of OverflowError or RuntimeError for too large
  863. width of look-behind pattern.
  864. - gh-issue-109818: Fix :func:`reprlib.recursive_repr` not copying
  865. ``__type_params__`` from decorated function.
  866. - gh-issue-109047: :mod:`concurrent.futures`: The *executor manager thread*
  867. now catches exceptions when adding an item to the *call queue*. During
  868. Python finalization, creating a new thread can now raise
  869. :exc:`RuntimeError`. Catch the exception and call ``terminate_broken()``
  870. in this case. Patch by Victor Stinner.
  871. - gh-issue-109782: Ensure the signature of :func:`os.path.isdir` is
  872. identical on all platforms. Patch by Amin Alaee.
  873. - gh-issue-109590: :func:`shutil.which` will prefer files with an extension
  874. in ``PATHEXT`` if the given mode includes ``os.X_OK`` on win32. If no
  875. ``PATHEXT`` match is found, a file without an extension in ``PATHEXT`` can
  876. be returned. This change will have :func:`shutil.which` act more similarly
  877. to previous behavior in Python 3.11.
  878. - gh-issue-109786: Fix possible reference leaks and crash when re-enter the
  879. ``__next__()`` method of :class:`itertools.pairwise`.
  880. - gh-issue-109593: Avoid deadlocking on a reentrant call to the
  881. multiprocessing resource tracker. Such a reentrant call, though unlikely,
  882. can happen if a GC pass invokes the finalizer for a multiprocessing object
  883. such as SemLock.
  884. - gh-issue-109613: Fix :func:`os.stat` and :meth:`os.DirEntry.stat`: check
  885. for exceptions. Previously, on Python built in debug mode, these functions
  886. could trigger a fatal Python error (and abort the process) when a function
  887. succeeded with an exception set. Patch by Victor Stinner.
  888. - gh-issue-109375: The :mod:`pdb` ``alias`` command now prevents registering
  889. aliases without arguments.
  890. - gh-issue-107219: Fix a race condition in ``concurrent.futures``. When a
  891. process in the process pool was terminated abruptly (while the future was
  892. running or pending), close the connection write end. If the call queue is
  893. blocked on sending bytes to a worker process, closing the connection write
  894. end interrupts the send, so the queue can be closed. Patch by Victor
  895. Stinner.
  896. - gh-issue-50644: Attempts to pickle or create a shallow or deep copy of
  897. :mod:`codecs` streams now raise a TypeError. Previously, copying failed
  898. with a RecursionError, while pickling produced wrong results that
  899. eventually caused unpickling to fail with a RecursionError.
  900. - gh-issue-108987: Fix :func:`_thread.start_new_thread` race condition. If a
  901. thread is created during Python finalization, the newly spawned thread now
  902. exits immediately instead of trying to access freed memory and lead to a
  903. crash. Patch by Victor Stinner.
  904. - gh-issue-108791: Improved error handling in :mod:`pdb` command line
  905. interface, making it produce more concise error messages.
  906. - gh-issue-105829: Fix concurrent.futures.ProcessPoolExecutor deadlock
  907. - gh-issue-106584: Fix exit code for ``unittest`` if all tests are skipped.
  908. Patch by Egor Eliseev.
  909. - gh-issue-102956: Fix returning of empty byte strings after seek in zipfile
  910. module
  911. - gh-issue-84867: :class:`unittest.TestLoader` no longer loads test cases
  912. from exact :class:`unittest.TestCase` and
  913. :class:`unittest.FunctionTestCase` classes.
  914. - gh-issue-91133: Fix a bug in :class:`tempfile.TemporaryDirectory` cleanup,
  915. which now no longer dereferences symlinks when working around file system
  916. permission errors.
  917. - gh-issue-73561: Omit the interface scope from an IPv6 address when used as
  918. Host header by :mod:`http.client`.
  919. - gh-issue-86826: :mod:`zipinfo` now supports the full range of values in
  920. the TZ string determined by RFC 8536 and detects all invalid formats. Both
  921. Python and C implementations now raise exceptions of the same type on
  922. invalid data.
  923. - bpo-43153: On Windows, ``tempfile.TemporaryDirectory`` previously masked a
  924. ``PermissionError`` with ``NotADirectoryError`` during directory cleanup.
  925. It now correctly raises ``PermissionError`` if errors are not ignored.
  926. Patch by Andrei Kulakov and Ken Jin.
  927. - bpo-35332: The :func:`shutil.rmtree` function now ignores errors when
  928. calling :func:`os.close` when *ignore_errors* is ``True``, and
  929. :func:`os.close` no longer retried after error.
  930. - bpo-41422: Fixed memory leaks of :class:`pickle.Pickler` and
  931. :class:`pickle.Unpickler` involving cyclic references via the internal
  932. memo mapping.
  933. - bpo-40262: The :meth:`ssl.SSLSocket.recv_into` method no longer requires
  934. the *buffer* argument to implement ``__len__`` and supports buffers with
  935. arbitrary item size.
  936. Documentation
  937. -------------
  938. - gh-issue-111699: Relocate ``smtpd`` deprecation notice to its own section
  939. rather than under ``locale`` in What's New in Python 3.12 document
  940. - gh-issue-108826: :mod:`dis` module command-line interface is now mentioned
  941. in documentation.
  942. Tests
  943. -----
  944. - gh-issue-112769: The tests now correctly compare zlib version when
  945. :const:`zlib.ZLIB_RUNTIME_VERSION` contains non-integer suffixes. For
  946. example zlib-ng defines the version as ``1.3.0.zlib-ng``.
  947. - gh-issue-110367: Make regrtest ``--verbose3`` option compatible with
  948. ``--huntrleaks -jN`` options. The ``./python -m test -j1 -R 3:3
  949. --verbose3`` command now works as expected. Patch by Victor Stinner.
  950. - gh-issue-111165: Remove no longer used functions ``run_unittest()`` and
  951. ``run_doctest()`` from the :mod:`test.support` module.
  952. - gh-issue-110932: Fix regrtest if the ``SOURCE_DATE_EPOCH`` environment
  953. variable is defined: use the variable value as the random seed. Patch by
  954. Victor Stinner.
  955. - gh-issue-110995: test_gdb: Fix detection of gdb built without Python
  956. scripting support. Patch by Victor Stinner.
  957. - gh-issue-110918: Test case matching patterns specified by options
  958. ``--match``, ``--ignore``, ``--matchfile`` and ``--ignorefile`` are now
  959. tested in the order of specification, and the last match determines
  960. whether the test case be run or ignored.
  961. - gh-issue-110647: Fix test_stress_modifying_handlers() of test_signal.
  962. Patch by Victor Stinner.
  963. - gh-issue-103053: Fix test_tools.test_freeze on FreeBSD: run "make
  964. distclean" instead of "make clean" in the copied source directory to
  965. remove also the "python" program. Patch by Victor Stinner.
  966. - gh-issue-110167: Fix a deadlock in test_socket when server fails with a
  967. timeout but the client is still running in its thread. Don't hold a lock
  968. to call cleanup functions in doCleanups(). One of the cleanup function
  969. waits until the client completes, whereas the client could deadlock if it
  970. called addCleanup() in such situation. Patch by Victor Stinner.
  971. - gh-issue-110388: Add tests for :mod:`tty`.
  972. - gh-issue-81002: Add tests for :mod:`termios`.
  973. - gh-issue-110267: Add tests for pickling and copying PyStructSequence
  974. objects. Patched by Xuehai Pan.
  975. - gh-issue-110031: Skip test_threading tests using thread+fork if Python is
  976. built with Address Sanitizer (ASAN). Patch by Victor Stinner.
  977. - gh-issue-110088: Fix test_asyncio timeouts: don't measure the maximum
  978. duration, a test should not measure a CI performance. Only measure the
  979. minimum duration when a task has a timeout or delay. Add ``CLOCK_RES`` to
  980. ``test_asyncio.utils``. Patch by Victor Stinner.
  981. - gh-issue-109974: Fix race conditions in test_threading lock tests. Wait
  982. until a condition is met rather than using :func:`time.sleep` with a
  983. hardcoded number of seconds. Patch by Victor Stinner.
  984. - gh-issue-110033: Fix ``test_interprocess_signal()`` of ``test_signal``.
  985. Make sure that the ``subprocess.Popen`` object is deleted before the test
  986. raising an exception in a signal handler. Otherwise, ``Popen.__del__()``
  987. can get the exception which is logged as ``Exception ignored in: ...`` and
  988. the test fails. Patch by Victor Stinner.
  989. - gh-issue-109594: Fix test_timeout() of test_concurrent_futures.test_wait.
  990. Remove the future which may or may not complete depending if it takes
  991. longer than the timeout ot not. Keep the second future which does not
  992. complete before wait() timeout. Patch by Victor Stinner.
  993. - gh-issue-109972: Split test_gdb.py file into a test_gdb package made of
  994. multiple tests, so tests can now be run in parallel. Patch by Victor
  995. Stinner.
  996. - gh-issue-103053: Skip test_freeze_simple_script() of
  997. test_tools.test_freeze if Python is built with ``./configure
  998. --enable-optimizations``, which means with Profile Guided Optimization
  999. (PGO): it just makes the test too slow. The freeze tool is tested by many
  1000. other CIs with other (faster) compiler flags. Patch by Victor Stinner.
  1001. - gh-issue-109580: Skip ``test_perf_profiler`` if Python is built with ASAN,
  1002. MSAN or UBSAN sanitizer. Python does crash randomly in this test on such
  1003. build. Patch by Victor Stinner.
  1004. - gh-issue-104736: Fix test_gdb on Python built with LLVM clang 16 on Linux
  1005. ppc64le (ex: Fedora 38). Search patterns in gdb "bt" command output to
  1006. detect when gdb fails to retrieve the traceback. For example, skip a test
  1007. if ``Backtrace stopped: frame did not save the PC`` is found. Patch by
  1008. Victor Stinner.
  1009. - gh-issue-108927: Fixed order dependence in running tests in the same
  1010. process when a test that has submodules (e.g. test_importlib) follows a
  1011. test that imports its submodule (e.g. test_importlib.util) and precedes a
  1012. test (e.g. test_unittest or test_compileall) that uses that submodule.
  1013. Build
  1014. -----
  1015. - gh-issue-112088: Add ``Tools/build/regen-configure.sh`` script to
  1016. regenerate the ``configure`` with an Ubuntu container image. The
  1017. ``quay.io/tiran/cpython_autoconf:271`` container image
  1018. (`tiran/cpython_autoconf <https://github.com/tiran/cpython_autoconf>`_) is
  1019. no longer used. Patch by Victor Stinner.
  1020. - gh-issue-111046: For wasi-threads, memory is now exported to fix
  1021. compatibility issues with some wasm runtimes.
  1022. - gh-issue-103053: "make check-clean-src" now also checks if the "python"
  1023. program is found in the source directory: fail with an error if it does
  1024. exist. Patch by Victor Stinner.
  1025. - gh-issue-109191: Fix compile error when building with recent versions of
  1026. libedit.
  1027. Windows
  1028. -------
  1029. - gh-issue-111856: Fixes :func:`~os.fstat` on file systems that do not
  1030. support file ID requests. This includes FAT32 and exFAT.
  1031. - gh-issue-111293: Fix :data:`os.DirEntry.inode` dropping higher 64 bits of
  1032. a file id on some filesystems on Windows.
  1033. - gh-issue-110913: WindowsConsoleIO now correctly chunks large buffers
  1034. without splitting up UTF-8 sequences.
  1035. - gh-issue-110437: Allows overriding the source of VC redistributables so
  1036. that releases can be guaranteed to never downgrade between updates.
  1037. - gh-issue-109286: Update Windows installer to use SQLite 3.43.1.
  1038. macOS
  1039. -----
  1040. - gh-issue-109981: Use ``/dev/fd`` on macOS to determine the number of open
  1041. files in ``test.support.os_helper.fd_count`` to avoid a crash with
  1042. "guarded" file descriptors when probing for open files.
  1043. - gh-issue-110950: Update macOS installer to include an upstream Tcl/Tk fix
  1044. for the ``Secure coding is not enabled for restorable state!`` warning
  1045. encountered in Tkinter on macOS 14 Sonoma.
  1046. - gh-issue-111015: Ensure that IDLE.app and Python Launcher.app are
  1047. installed with appropriate permissions on macOS builds.
  1048. - gh-issue-109286: Update macOS installer to use SQLite 3.43.1.
  1049. - gh-issue-71383: Update macOS installer to include an upstream Tcl/Tk fix
  1050. for the ``ttk::ThemeChanged`` error encountered in Tkinter.
  1051. - gh-issue-92603: Update macOS installer to include a fix accepted by
  1052. upstream Tcl/Tk for a crash encountered after the first :meth:`tkinter.Tk`
  1053. instance is destroyed.
  1054. IDLE
  1055. ----
  1056. - bpo-35668: Add docstrings to the IDLE debugger module. Fix two bugs:
  1057. initialize Idb.botframe (should be in Bdb); in Idb.in_rpc_code, check
  1058. whether prev_frame is None before trying to use it. Greatly expand
  1059. test_debugger.
  1060. C API
  1061. -----
  1062. - gh-issue-106560: Fix redundant declarations in the public C API. Declare
  1063. PyBool_Type and PyLong_Type only once. Patch by Victor Stinner.
  1064. - gh-issue-112438: Fix support of format units "es", "et", "es#", and "et#"
  1065. in nested tuples in :c:func:`PyArg_ParseTuple`-like functions.
  1066. - gh-issue-109521: :c:func:`PyImport_GetImporter` now sets RuntimeError if
  1067. it fails to get :data:`sys.path_hooks` or :data:`sys.path_importer_cache`
  1068. or they are not list and dict correspondingly. Previously it could return
  1069. NULL without setting error in obscure cases, crash or raise SystemError if
  1070. these attributes have wrong type.
  1071. What's New in Python 3.12.0 final?
  1072. ==================================
  1073. *Release date: 2023-10-02*
  1074. Core and Builtins
  1075. -----------------
  1076. - gh-issue-109823: Fix bug where compiler does not adjust labels when
  1077. removing an empty basic block which is a jump target.
  1078. - gh-issue-109719: Fix missing jump target labels when compiler reorders
  1079. cold/warm blocks.
  1080. - gh-issue-109627: Fix bug where the compiler does not assign a new jump
  1081. target label to a duplicated small exit block.
  1082. Library
  1083. -------
  1084. - gh-issue-110045: Update the :mod:`symtable` module to support the new
  1085. scopes introduced by :pep:`695`.
  1086. Documentation
  1087. -------------
  1088. - gh-issue-109209: The minimum Sphinx version required for the documentation
  1089. is now 4.2.
  1090. Windows
  1091. -------
  1092. - gh-issue-109991: Update Windows build to use OpenSSL 3.0.11.
  1093. macOS
  1094. -----
  1095. - gh-issue-109991: Update macOS installer to use OpenSSL 3.0.11.
  1096. Tools/Demos
  1097. -----------
  1098. - gh-issue-109991: Update GitHub CI workflows to use OpenSSL 3.0.11 and
  1099. multissltests to use 1.1.1w, 3.0.11, and 3.1.3.
  1100. What's New in Python 3.12.0 release candidate 3?
  1101. ================================================
  1102. *Release date: 2023-09-18*
  1103. Core and Builtins
  1104. -----------------
  1105. - gh-issue-109496: On a Python built in debug mode, :c:func:`Py_DECREF()`
  1106. now calls ``_Py_NegativeRefcount()`` if the object is a dangling pointer
  1107. to deallocated memory: memory filled with ``0xDD`` "dead byte" by the
  1108. debug hook on memory allocators. The fix is to check the reference count
  1109. *before* checking for ``_Py_IsImmortal()``. Patch by Victor Stinner.
  1110. - gh-issue-109371: Deopted instructions correctly for tool initialization
  1111. and modified the incorrect assertion in instrumentation, when a previous
  1112. tool already sets INSTRUCTION events
  1113. - gh-issue-105658: Fix bug where the line trace of an except block ending
  1114. with a conditional includes an excess event with the line of the
  1115. conditional expression.
  1116. - gh-issue-109219: Fix compiling type param scopes that use a name which is
  1117. also free in an inner scope.
  1118. - gh-issue-109341: Fix crash when compiling an invalid AST involving a
  1119. :class:`ast.TypeAlias`.
  1120. - gh-issue-109195: Fix source location for the ``LOAD_*`` instruction
  1121. preceding a ``LOAD_SUPER_ATTR`` to load the ``super`` global (or shadowing
  1122. variable) so that it encompasses only the name ``super`` and not the
  1123. following parentheses.
  1124. - gh-issue-109118: Disallow nested scopes (lambdas, generator expressions,
  1125. and comprehensions) within PEP 695 annotation scopes that are nested
  1126. within classes.
  1127. - gh-issue-109114: Relax the detection of the error message for invalid
  1128. lambdas inside f-strings to not search for arbitrary replacement fields to
  1129. avoid false positives. Patch by Pablo Galindo
  1130. - gh-issue-109118: Fix interpreter crash when a NameError is raised inside
  1131. the type parameters of a generic class.
  1132. - gh-issue-108976: Fix crash that occurs after de-instrumenting a code
  1133. object in a monitoring callback.
  1134. - gh-issue-108732: Make iteration variables of module- and class-scoped
  1135. comprehensions visible to pdb and other tools that use ``frame.f_locals``
  1136. again.
  1137. - gh-issue-108959: Fix caret placement for error locations for subscript and
  1138. binary operations that involve non-semantic parentheses and spaces. Patch
  1139. by Pablo Galindo
  1140. Library
  1141. -------
  1142. - gh-issue-108682: Enum: require ``names=()`` or ``type=...`` to create an
  1143. empty enum using the functional syntax.
  1144. - gh-issue-108843: Fix an issue in :func:`ast.unparse` when unparsing
  1145. f-strings containing many quote types.
  1146. Documentation
  1147. -------------
  1148. - gh-issue-102823: Document the return type of ``x // y`` when ``x`` and
  1149. ``y`` have type :class:`float`.
  1150. Tests
  1151. -----
  1152. - gh-issue-109396: Fix ``test_socket.test_hmac_sha1()`` in FIPS mode. Use a
  1153. longer key: FIPS mode requires at least of at least 112 bits. The previous
  1154. key was only 32 bits. Patch by Victor Stinner.
  1155. - gh-issue-104736: Fix test_gdb on Python built with LLVM clang 16 on Linux
  1156. ppc64le (ex: Fedora 38). Search patterns in gdb "bt" command output to
  1157. detect when gdb fails to retrieve the traceback. For example, skip a test
  1158. if ``Backtrace stopped: frame did not save the PC`` is found. Patch by
  1159. Victor Stinner.
  1160. - gh-issue-109237: Fix ``test_site.test_underpth_basic()`` when the working
  1161. directory contains at least one non-ASCII character: encode the ``._pth``
  1162. file to UTF-8 and enable the UTF-8 Mode to use UTF-8 for the child process
  1163. stdout. Patch by Victor Stinner.
  1164. - gh-issue-109230: Fix ``test_pyexpat.test_exception()``: it can now be run
  1165. from a directory different than Python source code directory. Before, the
  1166. test failed in this case. Skip the test if Modules/pyexpat.c source is
  1167. not available. Skip also the test on Python implementations other than
  1168. CPython. Patch by Victor Stinner.
  1169. - gh-issue-109015: Fix test_asyncio, test_imaplib and test_socket tests on
  1170. FreeBSD if the TCP blackhole is enabled (``sysctl
  1171. net.inet.tcp.blackhole``). Skip the few tests which failed with
  1172. ``ETIMEDOUT`` which such non standard configuration. Currently, the
  1173. `FreeBSD GCP image enables TCP and UDP blackhole
  1174. <https://reviews.freebsd.org/D41751>`_ (``sysctl
  1175. net.inet.tcp.blackhole=2`` and ``sysctl net.inet.udp.blackhole=1``).
  1176. Patch by Victor Stinner.
  1177. - gh-issue-91960: Skip ``test_gdb`` if gdb is unable to retrieve Python
  1178. frame objects: if a frame is ``<optimized out>``. When Python is built
  1179. with "clang -Og", gdb can fail to retrive the *frame* parameter of
  1180. ``_PyEval_EvalFrameDefault()``. In this case, tests like ``py_bt()`` are
  1181. likely to fail. Without getting access to Python frames, ``python-gdb.py``
  1182. is mostly clueless on retrieving the Python traceback. Moreover,
  1183. ``test_gdb`` is no longer skipped on macOS if Python is built with Clang.
  1184. Patch by Victor Stinner.
  1185. - gh-issue-108962: Skip ``test_tempfile.test_flags()`` if ``chflags()``
  1186. fails with "OSError: [Errno 45] Operation not supported" (ex: on FreeBSD
  1187. 13). Patch by Victor Stinner.
  1188. - gh-issue-108851: Fix ``test_tomllib`` recursion tests for WASI buildbots:
  1189. reduce the recursion limit and compute the maximum nested array/dict
  1190. depending on the current available recursion limit. Patch by Victor
  1191. Stinner.
  1192. - gh-issue-108851: Add ``get_recursion_available()`` and
  1193. ``get_recursion_depth()`` functions to the :mod:`test.support` module.
  1194. Patch by Victor Stinner.
  1195. - gh-issue-108834: Add ``--fail-rerun option`` option to regrtest: if a test
  1196. failed when then passed when rerun in verbose mode, exit the process with
  1197. exit code 2 (error), instead of exit code 0 (success). Patch by Victor
  1198. Stinner.
  1199. - gh-issue-108834: Rename regrtest ``--verbose2`` option (``-w``) to
  1200. ``--rerun``. Keep ``--verbose2`` as a deprecated alias. Patch by Victor
  1201. Stinner.
  1202. - gh-issue-108834: When regrtest reruns failed tests in verbose mode
  1203. (``./python -m test --rerun``), tests are now rerun in fresh worker
  1204. processes rather than being executed in the main process. If a test does
  1205. crash or is killed by a timeout, the main process can detect and handle
  1206. the killed worker process. Tests are rerun in parallel if the ``-jN``
  1207. option is used to run tests in parallel. Patch by Victor Stinner.
  1208. - gh-issue-103186: Suppress and assert expected RuntimeWarnings in
  1209. test_sys_settrace.py
  1210. Build
  1211. -----
  1212. - gh-issue-108740: Fix a race condition in ``make regen-all``. The
  1213. ``deepfreeze.c`` source and files generated by Argument Clinic are now
  1214. generated or updated before generating "global objects". Previously, some
  1215. identifiers may miss depending on the order in which these files were
  1216. generated. Patch by Victor Stinner.
  1217. What's New in Python 3.12.0 release candidate 2?
  1218. ================================================
  1219. *Release date: 2023-09-05*
  1220. Security
  1221. --------
  1222. - gh-issue-108310: Fixed an issue where instances of :class:`ssl.SSLSocket`
  1223. were vulnerable to a bypass of the TLS handshake and included protections
  1224. (like certificate verification) and treating sent unencrypted data as if
  1225. it were post-handshake TLS encrypted data. Security issue reported as
  1226. `CVE-2023-40217
  1227. <https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2023-40217>`_ by Aapo
  1228. Oksman. Patch by Gregory P. Smith.
  1229. - gh-issue-107774: PEP 669 specifies that
  1230. ``sys.monitoring.register_callback`` will generate an audit event.
  1231. Pre-releases of Python 3.12 did not generate the audit event. This is now
  1232. fixed.
  1233. Core and Builtins
  1234. -----------------
  1235. - gh-issue-108520: Fix
  1236. :meth:`multiprocessing.synchronize.SemLock.__setstate__` to properly
  1237. initialize :attr:`multiprocessing.synchronize.SemLock._is_fork_ctx`. This
  1238. fixes a regression when passing a SemLock accross nested processes.
  1239. Rename :attr:`multiprocessing.synchronize.SemLock.is_fork_ctx` to
  1240. :attr:`multiprocessing.synchronize.SemLock._is_fork_ctx` to avoid exposing
  1241. it as public API.
  1242. - gh-issue-108654: Restore locals shadowed by an inlined comprehension if
  1243. the comprehension raises an exception.
  1244. - gh-issue-108487: Change an assert that would cause a spurious crash in a
  1245. devious case that should only trigger deoptimization.
  1246. - gh-issue-106176: Use a ``WeakValueDictionary`` to track the lists
  1247. containing the modules each thread is currently importing. This helps
  1248. avoid a reference leak from keeping the list around longer than necessary.
  1249. Weakrefs are used as GC can't interrupt the cleanup.
  1250. - gh-issue-107901: Fix missing line number on :opcode:`JUMP_BACKWARD` at the
  1251. end of a for loop.
  1252. - gh-issue-108390: Raise an exception when setting a non-local event
  1253. (``RAISE``, ``EXCEPTION_HANDLED``, etc.) in
  1254. ``sys.monitoring.set_local_events``.
  1255. Fixes crash when tracing in recursive calls to Python classes.
  1256. - gh-issue-91051: Fix abort / segfault when using all eight type watcher
  1257. slots, on platforms where ``char`` is signed by default.
  1258. - gh-issue-107724: In pre-release versions of 3.12, up to rc1, the
  1259. sys.monitoring callback function for the ``PY_THROW`` event was missing
  1260. the third, exception argument. That is now fixed.
  1261. - gh-issue-107080: Trace refs builds (``--with-trace-refs``) were crashing
  1262. when used with isolated subinterpreters. The problematic global state has
  1263. been isolated to each interpreter. Other fixing the crashes, this change
  1264. does not affect users.
  1265. - gh-issue-77377: Ensure that multiprocessing synchronization objects
  1266. created in a fork context are not sent to a different process created in a
  1267. spawn context. This changes a segfault into an actionable RuntimeError in
  1268. the parent process.
  1269. Library
  1270. -------
  1271. - gh-issue-108469: :func:`ast.unparse` now supports new :term:`f-string`
  1272. syntax introduced in Python 3.12. Note that the :term:`f-string` quotes
  1273. are reselected for simplicity under the new syntax. (Patch by Steven Sun)
  1274. - gh-issue-108682: Enum: raise :exc:`TypeError` if ``super().__new__()`` is
  1275. called from a custom ``__new__``.
  1276. - gh-issue-108295: Fix crashes related to use of weakrefs on
  1277. :data:`typing.TypeVar`.
  1278. - gh-issue-64662: Fix support for virtual tables in
  1279. :meth:`sqlite3.Connection.iterdump`. Patch by Aviv Palivoda.
  1280. - gh-issue-108111: Fix a regression introduced in GH-101251 for 3.12,
  1281. resulting in an incorrect offset calculation in
  1282. :meth:`gzip.GzipFile.seek`.
  1283. - gh-issue-105736: Harmonized the pure Python version of
  1284. :class:`~collections.OrderedDict` with the C version. Now, both versions
  1285. set up their internal state in ``__new__``. Formerly, the pure Python
  1286. version did the set up in ``__init__``.
  1287. - gh-issue-108083: Fix bugs in the constructor of :mod:`sqlite3.Connection`
  1288. and :meth:`sqlite3.Connection.close` where exceptions could be leaked.
  1289. Patch by Erlend E. Aasland.
  1290. - gh-issue-107963: Fix :func:`multiprocessing.set_forkserver_preload` to
  1291. check the given list of modules names. Patch by Donghee Na.
  1292. - gh-issue-106242: Fixes :func:`os.path.normpath` to handle embedded null
  1293. characters without truncating the path.
  1294. - gh-issue-107913: Fix possible losses of ``errno`` and ``winerror`` values
  1295. in :exc:`OSError` exceptions if they were cleared or modified by the
  1296. cleanup code before creating the exception object.
  1297. - gh-issue-107845: :func:`tarfile.data_filter` now takes the location of
  1298. symlinks into account when determining their target, so it will no longer
  1299. reject some valid tarballs with ``LinkOutsideDestinationError``.
  1300. - gh-issue-107805: Fix signatures of module-level generated functions in
  1301. :mod:`turtle`.
  1302. - gh-issue-107715: Fix :meth:`doctest.DocTestFinder.find` in presence of
  1303. class names with special characters. Patch by Gertjan van Zwieten.
  1304. - gh-issue-100814: Passing a callable object as an option value to a Tkinter
  1305. image now raises the expected TclError instead of an AttributeError.
  1306. - gh-issue-106684: Close :class:`asyncio.StreamWriter` when it is not closed
  1307. by application leading to memory leaks. Patch by Kumar Aditya.
  1308. - gh-issue-107396: tarfiles; Fixed use before assignment of self.exception
  1309. for gzip decompression
  1310. - gh-issue-106052: :mod:`re` module: fix the matching of possessive
  1311. quantifiers in the case of a subpattern containing backtracking.
  1312. - gh-issue-100061: Fix a bug that causes wrong matches for regular
  1313. expressions with possessive qualifier.
  1314. - gh-issue-99203: Restore following CPython <= 3.10.5 behavior of
  1315. :func:`shutil.make_archive`: do not create an empty archive if
  1316. ``root_dir`` is not a directory, and, in that case, raise
  1317. :class:`FileNotFoundError` or :class:`NotADirectoryError` regardless of
  1318. ``format`` choice. Beyond the brought-back behavior, the function may now
  1319. also raise these exceptions in ``dry_run`` mode.
  1320. Documentation
  1321. -------------
  1322. - gh-issue-105052: Update ``timeit`` doc to specify that time in seconds is
  1323. just the default.
  1324. Tests
  1325. -----
  1326. - gh-issue-89392: Removed support of ``test_main()`` function in tests. They
  1327. now always use normal unittest test runner.
  1328. - gh-issue-108388: Convert test_concurrent_futures to a package of 7
  1329. sub-tests. Patch by Victor Stinner.
  1330. - gh-issue-108388: Split test_multiprocessing_fork,
  1331. test_multiprocessing_forkserver and test_multiprocessing_spawn into test
  1332. packages. Each package is made of 4 sub-tests: processes, threads, manager
  1333. and misc. It allows running more tests in parallel and so reduce the total
  1334. test duration. Patch by Victor Stinner.
  1335. - gh-issue-105776: Fix test_cppext when the C compiler command ``-std=c11``
  1336. option: remove ``-std=`` options from the compiler command. Patch by
  1337. Victor Stinner.
  1338. - gh-issue-107178: Add the C API test for functions in the Mapping Protocol,
  1339. the Sequence Protocol and some functions in the Object Protocol.
  1340. Build
  1341. -----
  1342. - gh-issue-63760: Fix Solaris build: no longer redefine the
  1343. ``gethostname()`` function. Solaris defines the function since 2005. Patch
  1344. by Victor Stinner, original patch by Jakub Kulík.
  1345. - gh-issue-107814: When calling ``find_python.bat`` with ``-q`` it did not
  1346. properly silence the output of nuget. That is now fixed.
  1347. Windows
  1348. -------
  1349. - gh-issue-107565: Update Windows build to use OpenSSL 3.0.10.
  1350. - gh-issue-106242: Fixes :func:`~os.path.realpath` to behave consistently
  1351. when passed a path containing an embedded null character on Windows. In
  1352. strict mode, it now raises :exc:`OSError` instead of the unexpected
  1353. :exc:`ValueError`, and in non-strict mode will make the path absolute.
  1354. - gh-issue-106844: Fix integer overflow and truncating by the null character
  1355. in :func:`!_winapi.LCMapStringEx` which affects :func:`ntpath.normcase`.
  1356. macOS
  1357. -----
  1358. - gh-issue-107565: Update macOS installer to use OpenSSL 3.0.10.
  1359. Tools/Demos
  1360. -----------
  1361. - gh-issue-107565: Update multissltests and GitHub CI workflows to use
  1362. OpenSSL 1.1.1v, 3.0.10, and 3.1.2.
  1363. - gh-issue-95065: Argument Clinic now supports overriding automatically
  1364. generated signature by using directive ``@text_signature``.
  1365. C API
  1366. -----
  1367. - gh-issue-107916: C API functions :c:func:`PyErr_SetFromErrnoWithFilename`,
  1368. :c:func:`PyErr_SetExcFromWindowsErrWithFilename` and
  1369. :c:func:`PyErr_SetFromWindowsErrWithFilename` save now the error code
  1370. before calling :c:func:`PyUnicode_DecodeFSDefault`.
  1371. - gh-issue-107915: Such C API functions as ``PyErr_SetString()``,
  1372. ``PyErr_Format()``, ``PyErr_SetFromErrnoWithFilename()`` and many others
  1373. no longer crash or ignore errors if it failed to format the error message
  1374. or decode the filename. Instead, they keep a corresponding error.
  1375. - gh-issue-107810: Improve :exc:`DeprecationWarning` for uses of
  1376. :c:type:`PyType_Spec` with metaclasses that have custom ``tp_new``.
  1377. What's New in Python 3.12.0 release candidate 1?
  1378. ================================================
  1379. *Release date: 2023-08-05*
  1380. Security
  1381. --------
  1382. - gh-issue-102988: Reverted the :mod:`email.utils` security improvement
  1383. change released in 3.12beta4 that unintentionally caused
  1384. :mod:`email.utils.getaddresses` to fail to parse email addresses with a
  1385. comma in the quoted name field. See :gh:`106669`.
  1386. - gh-issue-102509: Start initializing ``ob_digit`` during creation of
  1387. :c:type:`PyLongObject` objects. Patch by Illia Volochii.
  1388. Core and Builtins
  1389. -----------------
  1390. - gh-issue-107263: Increase C recursion limit for functions other than the
  1391. main interpreter from 800 to 1500. This should allow functions like
  1392. ``list.__repr__`` and ``json.dumps`` to handle all the inputs that they
  1393. could prior to 3.12
  1394. - gh-issue-104432: Fix potential unaligned memory access on C APIs involving
  1395. returned sequences of ``char *`` pointers within the :mod:`grp` and
  1396. :mod:`socket` modules. These were revealed using a
  1397. ``-fsaniziter=alignment`` build on ARM macOS. Patch by Christopher Chavez.
  1398. - gh-issue-106898: Add the exception as the third argument to ``PY_UNIND``
  1399. callbacks in ``sys.monitoring``. This makes the ``PY_UNWIND`` callback
  1400. consistent with the other exception hanlding callbacks.
  1401. - gh-issue-106895: Raise a ``ValueError`` when a monitoring callback funtion
  1402. returns ``DISABLE`` for events that cannot be disabled locally.
  1403. - gh-issue-106897: Add a ``RERAISE`` event to ``sys.monitoring``, which
  1404. occurs when an exception is reraised, either explicitly by a plain
  1405. ``raise`` statement, or implicitly in an ``except`` or ``finally`` block.
  1406. - gh-issue-104621: Unsupported modules now always fail to be imported.
  1407. - gh-issue-106917: Fix classmethod-style :func:`super` method calls (i.e.,
  1408. where the second argument to :func:`super`, or the implied second argument
  1409. drawn from ``self/cls`` in the case of zero-arg super, is a type) when the
  1410. target of the call is not a classmethod.
  1411. - gh-issue-105699: Python no longer crashes due an infrequent race when
  1412. initialzing per-interpreter interned strings. The crash would manifest
  1413. when the interpreter was finalized.
  1414. - gh-issue-105699: Python no longer crashes due to an infrequent race in
  1415. setting ``Py_FileSystemDefaultEncoding`` and
  1416. ``Py_FileSystemDefaultEncodeErrors`` (both deprecated), when
  1417. simultaneously initializing two isolated subinterpreters. Now they are
  1418. only set during runtime initialization.
  1419. - gh-issue-106092: Fix a segmentation fault caused by a use-after-free bug
  1420. in ``frame_dealloc`` when the trashcan delays the deallocation of a
  1421. ``PyFrameObject``.
  1422. - gh-issue-106719: No longer suppress arbitrary errors in the
  1423. ``__annotations__`` getter and setter in the type and module types.
  1424. - gh-issue-106723: Propagate ``frozen_modules`` to multiprocessing spawned
  1425. process interpreters.
  1426. - gh-issue-105235: Prevent out-of-bounds memory access during
  1427. ``mmap.find()`` calls.
  1428. Library
  1429. -------
  1430. - gh-issue-107077: Seems that in some conditions, OpenSSL will return
  1431. ``SSL_ERROR_SYSCALL`` instead of ``SSL_ERROR_SSL`` when a certification
  1432. verification has failed, but the error parameters will still contain
  1433. ``ERR_LIB_SSL`` and ``SSL_R_CERTIFICATE_VERIFY_FAILED``. We are now
  1434. detecting this situation and raising the appropiate
  1435. ``ssl.SSLCertVerificationError``. Patch by Pablo Galindo
  1436. - gh-issue-107576: Fix :func:`types.get_original_bases` to only return
  1437. :attr:`!__orig_bases__` if it is present on ``cls`` directly. Patch by
  1438. James Hilton-Balfe.
  1439. - gh-issue-46376: Prevent memory leak and use-after-free when using pointers
  1440. to pointers with ctypes
  1441. - gh-issue-62519: Make :func:`gettext.pgettext` search plural definitions
  1442. when translation is not found.
  1443. - gh-issue-83006: Document behavior of :func:`shutil.disk_usage` for
  1444. non-mounted filesystems on Unix.
  1445. - gh-issue-106186: Do not report ``MultipartInvariantViolationDefect``
  1446. defect when the :class:`email.parser.Parser` class is used to parse emails
  1447. with ``headersonly=True``.
  1448. - gh-issue-105002: Fix invalid result from :meth:`PurePath.relative_to`
  1449. method when attempting to walk a "``..``" segment in *other* with
  1450. *walk_up* enabled. A :exc:`ValueError` exception is now raised in this
  1451. case.
  1452. - gh-issue-106831: Fix potential missing ``NULL`` check of
  1453. ``d2i_SSL_SESSION`` result in ``_ssl.c``.
  1454. - gh-issue-106774: Update the bundled copy of pip to version 23.2.1.
  1455. - gh-issue-106752: Fixed several bugs in zipfile.Path, including: in
  1456. ``Path.match``, Windows separators are no longer honored (and never were
  1457. meant to be); Fixed ``name``/``suffix``/``suffixes``/``stem`` operations
  1458. when no filename is present and the Path is not at the root of the
  1459. zipfile; Reworked glob for performance and more correct matching behavior.
  1460. - gh-issue-106602: Add __copy__ and __deepcopy__ in :mod:`enum`
  1461. - gh-issue-106530: Revert a change to :func:`colorsys.rgb_to_hls` that
  1462. caused division by zero for certain almost-white inputs. Patch by Terry
  1463. Jan Reedy.
  1464. - gh-issue-106403: Instances of :class:`typing.TypeVar`,
  1465. :class:`typing.ParamSpec`, :class:`typing.ParamSpecArgs`,
  1466. :class:`typing.ParamSpecKwargs`, and :class:`typing.TypeVarTuple` once
  1467. again support weak references, fixing a regression introduced in Python
  1468. 3.12.0 beta 1. Patch by Jelle Zijlstra.
  1469. - gh-issue-106350: Detect possible memory allocation failure in the
  1470. libtommath function :c:func:`mp_init` used by the ``_tkinter`` module.
  1471. - gh-issue-106263: Fix crash when calling ``repr`` with a manually
  1472. constructed SignalDict object. Patch by Charlie Zhao.
  1473. - gh-issue-105626: Change the default return value of
  1474. :meth:`http.client.HTTPConnection.get_proxy_response_headers` to be
  1475. ``None`` and not ``{}``.
  1476. - bpo-18319: Ensure ``gettext(msg)`` retrieve translations even if a plural
  1477. form exists. In other words: ``gettext(msg) == ngettext(msg, '', 1)``.
  1478. Documentation
  1479. -------------
  1480. - gh-issue-107305: Add documentation for :c:type:`PyInterpreterConfig` and
  1481. :c:func:`Py_NewInterpreterFromConfig`. Also clarify some of the nearby
  1482. docs relative to per-interpreter GIL.
  1483. - gh-issue-107008: Document the :mod:`curses` module variables
  1484. :const:`~curses.LINES` and :const:`~curses.COLS`.
  1485. - gh-issue-106948: Add a number of standard external names to
  1486. ``nitpick_ignore``.
  1487. - gh-issue-54738: Add documentation on how to localize the :mod:`argparse`
  1488. module.
  1489. Tests
  1490. -----
  1491. - gh-issue-107237: ``test_logging``: Fix ``test_udp_reconnection()`` by
  1492. increasing the timeout from 100 ms to 5 minutes (LONG_TIMEOUT). Patch by
  1493. Victor Stinner.
  1494. - gh-issue-106714: test_capi: Fix test_no_FatalError_infinite_loop() to no
  1495. longer write a coredump, by using test.support.SuppressCrashReport. Patch
  1496. by Victor Stinner.
  1497. - gh-issue-104090: Avoid creating a reference to the test object in
  1498. :meth:`~unittest.TestResult.collectedDurations`.
  1499. - gh-issue-106752: Moved tests for ``zipfile.Path`` into
  1500. ``Lib/test/test_zipfile/_path``. Made ``zipfile._path`` a package.
  1501. Build
  1502. -----
  1503. - gh-issue-106881: Check for ``linux/limits.h`` before including it in
  1504. ``Modules/posixmodule.c``.
  1505. - gh-issue-106962: Detect MPI compilers in :file:`configure`.
  1506. - gh-issue-101538: Add experimental wasi-threads support. Patch by Takashi
  1507. Yamamoto.
  1508. Windows
  1509. -------
  1510. - gh-issue-99079: Update Windows build to use OpenSSL 3.0.9
  1511. macOS
  1512. -----
  1513. - gh-issue-99079: Update macOS installer to use OpenSSL 3.0.9.
  1514. Tools/Demos
  1515. -----------
  1516. - gh-issue-106970: Fix bugs in the Argument Clinic ``destination <name>
  1517. clear`` command; the destination buffers would never be cleared, and the
  1518. ``destination`` directive parser would simply continue to the fault
  1519. handler after processing the command. Patch by Erlend E. Aasland.
  1520. - gh-issue-103186: ``freeze`` now fetches ``CONFIG_ARGS`` from the original
  1521. CPython instance the Makefile uses to call utility scripts. Patch by
  1522. Ijtaba Hussain.
  1523. C API
  1524. -----
  1525. - gh-issue-107226: :c:func:`PyModule_AddObjectRef` is now only available in
  1526. the limited API version 3.10 or later.
  1527. What's New in Python 3.12.0 beta 4?
  1528. ===================================
  1529. *Release date: 2023-07-11*
  1530. Security
  1531. --------
  1532. - gh-issue-102988: CVE-2023-27043: Prevent :func:`email.utils.parseaddr` and
  1533. :func:`email.utils.getaddresses` from returning the realname portion of an
  1534. invalid RFC2822 email header in the email address portion of the 2-tuple
  1535. returned after being parsed by :class:`email._parseaddr.AddressList`.
  1536. Core and Builtins
  1537. -----------------
  1538. - gh-issue-106396: When the format specification of an f-string expression
  1539. is empty, the parser now generates an empty :class:`ast.JoinedStr` node
  1540. for it instead of an one-element :class:`ast.JoinedStr` with an empty
  1541. string :class:`ast.Constant`.
  1542. - gh-issue-106145: Make ``end_lineno`` and ``end_col_offset`` required on
  1543. ``type_param`` ast nodes.
  1544. - gh-issue-105979: Fix crash in :func:`!_imp.get_frozen_object` due to
  1545. improper exception handling.
  1546. - gh-issue-98931: Ensure custom :exc:`SyntaxError` error messages are raised
  1547. for invalid imports with multiple targets. Patch by Pablo Galindo
  1548. - gh-issue-105908: Fixed bug where :gh:`99111` breaks future import
  1549. ``barry_as_FLUFL`` in the Python REPL.
  1550. - gh-issue-105340: Include the comprehension iteration variable in
  1551. ``locals()`` inside a module- or class-scope comprehension.
  1552. - gh-issue-105486: Change the repr of ``ParamSpec`` list of args in
  1553. ``types.GenericAlias``.
  1554. - gh-issue-101006: Improve error handling when read :mod:`marshal` data.
  1555. Library
  1556. -------
  1557. - gh-issue-106524: Fix crash in :func:`!_sre.template` with templates
  1558. containing invalid group indices.
  1559. - gh-issue-106510: Improve debug output for atomic groups in regular
  1560. expressions.
  1561. - gh-issue-106503: Fix ref cycle in
  1562. :class:`!asyncio._SelectorSocketTransport` by removing ``_write_ready`` in
  1563. ``close``.
  1564. - gh-issue-105497: Fix flag mask inversion when unnamed flags exist.
  1565. - gh-issue-90876: Prevent :mod:`multiprocessing.spawn` from failing to
  1566. *import* in environments where ``sys.executable`` is ``None``. This
  1567. regressed in 3.11 with the addition of support for path-like objects in
  1568. multiprocessing.
  1569. - gh-issue-106292: Check for an instance-dict cached value in the
  1570. :meth:`__get__` method of :func:`functools.cached_property`. This better
  1571. matches the pre-3.12 behavior and improves compatibility for users
  1572. subclassing :func:`functools.cached_property` and adding a :meth:`__set__`
  1573. method.
  1574. - gh-issue-106330: Fix incorrect matching of empty paths in
  1575. :meth:`pathlib.PurePath.match`. This bug was introduced in Python 3.12.0
  1576. beta 1.
  1577. - gh-issue-102541: Make pydoc.doc catch bad module ImportError when output
  1578. stream is not None.
  1579. - gh-issue-106152: Added PY_THROW event hook for :mod:`cProfile` for
  1580. generators
  1581. - gh-issue-106075: Added ``asyncio.taskgroups.__all__`` to
  1582. ``asyncio.__all__`` for export in star imports.
  1583. - gh-issue-105987: Fix crash due to improper reference counting in
  1584. :mod:`asyncio` eager task factory internal routines.
  1585. - gh-issue-105974: Fix bug where a :class:`typing.Protocol` class that had
  1586. one or more non-callable members would raise :exc:`TypeError` when
  1587. :func:`issubclass` was called against it, even if it defined a custom
  1588. ``__subclasshook__`` method. The behaviour in Python 3.11 and lower --
  1589. which has now been restored -- was not to raise :exc:`TypeError` in these
  1590. situations if a custom ``__subclasshook__`` method was defined. Patch by
  1591. Alex Waygood.
  1592. - gh-issue-96145: Reverted addition of ``json.AttrDict``.
  1593. - gh-issue-105497: Fix flag inversion when alias/mask members exist.
  1594. - gh-issue-104554: Add RTSPS scheme support in urllib.parse
  1595. - gh-issue-94777: Fix hanging :mod:`multiprocessing` ``ProcessPoolExecutor``
  1596. when a child process crashes while data is being written in the call
  1597. queue.
  1598. Documentation
  1599. -------------
  1600. - gh-issue-106232: Make timeit doc command lines compatible with Windows by
  1601. using double quotes for arguments. This works on linux and macOS also.
  1602. Tests
  1603. -----
  1604. - gh-issue-101634: When running the Python test suite with ``-jN`` option,
  1605. if a worker stdout cannot be decoded from the locale encoding report a
  1606. failed testn so the exitcode is non-zero. Patch by Victor Stinner.
  1607. Build
  1608. -----
  1609. - gh-issue-106118: Fix compilation for platforms without :data:`!O_CLOEXEC`.
  1610. The issue was introduced with Python 3.12b1 in :gh:`103295`. Patch by
  1611. Erlend Aasland.
  1612. - gh-issue-104692: Include ``commoninstall`` as a prerequisite for
  1613. ``bininstall``
  1614. This ensures that ``commoninstall`` is completed before ``bininstall`` is
  1615. started when parallel builds are used (``make -j install``), and so the
  1616. ``python3`` symlink is only installed after all standard library modules
  1617. are installed.
  1618. Tools/Demos
  1619. -----------
  1620. - gh-issue-106359: Argument Clinic now explicitly forbids "kwarg splats" in
  1621. function calls used as annotations.
  1622. C API
  1623. -----
  1624. - gh-issue-105227: The new :c:func:`PyType_GetDict` provides the dictionary
  1625. for the given type object that is normally exposed by ``cls.__dict__``.
  1626. Normally it's sufficient to use :c:member:`~PyTypeObject.tp_dict`, but for
  1627. the static builtin types :c:member:`!tp_dict` is now always ``NULL``.
  1628. :c:func:`!PyType_GetDict()` provides the correct dict object instead.
  1629. What's New in Python 3.12.0 beta 3?
  1630. ===================================
  1631. *Release date: 2023-06-19*
  1632. Core and Builtins
  1633. -----------------
  1634. - gh-issue-105840: Fix possible crashes when specializing function calls
  1635. with too many ``__defaults__``.
  1636. - gh-issue-105831: Fix an f-string bug, where using a debug expression (the
  1637. ``=`` sign) that appears in the last line of a file results to the debug
  1638. buffer that holds the expression text being one character too small.
  1639. - gh-issue-105800: Correctly issue :exc:`SyntaxWarning` in f-strings if
  1640. invalid sequences are used. Patch by Pablo Galindo
  1641. - gh-issue-105587: The runtime can't guarantee that immortal objects will
  1642. not be mutated by Extensions. Thus, this modifies
  1643. _PyStaticObject_CheckRefcnt to warn instead of asserting.
  1644. - gh-issue-105564: Don't include artificil newlines in the ``line``
  1645. attribute of tokens in the APIs of the :mod:`tokenize` module. Patch by
  1646. Pablo Galindo
  1647. - gh-issue-105549: Tokenize separately ``NUMBER`` and ``NAME`` tokens that
  1648. are not ambiguous. Patch by Pablo Galindo.
  1649. - gh-issue-105588: Fix an issue that could result in crashes when compiling
  1650. malformed :mod:`ast` nodes.
  1651. - gh-issue-105375: Fix bugs in the :mod:`builtins` module where exceptions
  1652. could end up being overwritten.
  1653. - gh-issue-105375: Fix bug in the compiler where an exception could end up
  1654. being overwritten.
  1655. - gh-issue-105375: Improve error handling in
  1656. :c:func:`PyUnicode_BuildEncodingMap` where an exception could end up being
  1657. overwritten.
  1658. - gh-issue-105435: Fix spurious newline character if file ends on a comment
  1659. without a newline. Patch by Pablo Galindo
  1660. - gh-issue-105390: Correctly raise :exc:`tokenize.TokenError` exceptions
  1661. instead of :exc:`SyntaxError` for tokenize errors such as incomplete
  1662. input. Patch by Pablo Galindo
  1663. - gh-issue-104812: The "pending call" machinery now works for all
  1664. interpreters, not just the main interpreter, and runs in all threads, not
  1665. just the main thread. Some calls are still only done in the main thread,
  1666. ergo in the main interpreter. This change does not affect signal handling
  1667. nor the existing public C-API (``Py_AddPendingCall()``), which both still
  1668. only target the main thread. The new functionality is meant strictly for
  1669. internal use for now, since consequences of its use are not well
  1670. understood yet outside some very restricted cases. This change brings the
  1671. capability in line with the intention when the state was made
  1672. per-interpreter several years ago.
  1673. Library
  1674. -------
  1675. - gh-issue-105808: Fix a regression introduced in GH-101251 for 3.12,
  1676. causing :meth:`gzip.GzipFile.flush` to not flush the compressor (nor pass
  1677. along the ``zip_mode`` argument).
  1678. - gh-issue-104799: Enable :func:`ast.unparse` to unparse function and class
  1679. definitions created without the new ``type_params`` field from :pep:`695`.
  1680. Patch by Jelle Zijlstra.
  1681. - gh-issue-105745: Fix ``webbrowser.Konqueror.open`` method.
  1682. - gh-issue-105375: Fix a bug in :c:func:`!_Unpickler_SetInputStream` where
  1683. an exception could end up being overwritten in case of failure.
  1684. - gh-issue-105375: Fix bugs in :mod:`sys` where exceptions could end up
  1685. being overwritten because of deferred error handling.
  1686. - gh-issue-105605: Harden :mod:`pyexpat` error handling during module
  1687. initialisation to prevent exceptions from possibly being overwritten, and
  1688. objects from being dereferenced twice.
  1689. - gh-issue-105375: Fix bug in :mod:`decimal` where an exception could end up
  1690. being overwritten.
  1691. - gh-issue-105375: Fix bugs in :mod:`!_datetime` where exceptions could be
  1692. overwritten in case of module initialisation failure.
  1693. - gh-issue-105375: Fix bugs in :mod:`!_ssl` initialisation which could lead
  1694. to leaked references and overwritten exceptions.
  1695. - gh-issue-105375: Fix a bug in :class:`array.array` where an exception
  1696. could end up being overwritten.
  1697. - gh-issue-105375: Fix bugs in :mod:`_ctypes` where exceptions could end up
  1698. being overwritten.
  1699. - gh-issue-105375: Fix a bug in the :mod:`posix` module where an exception
  1700. could be overwritten.
  1701. - gh-issue-105375: Fix bugs in :mod:`!_elementtree` where exceptions could
  1702. be overwritten.
  1703. - gh-issue-105375: Fix bugs in :mod:`zoneinfo` where exceptions could be
  1704. overwritten.
  1705. - gh-issue-105375: Fix bugs in :mod:`errno` where exceptions could be
  1706. overwritten.
  1707. - gh-issue-105375: Fix bugs in :mod:`pickle` where exceptions could be
  1708. overwritten.
  1709. - gh-issue-105375: Fix a bug in :mod:`sqlite3` where an exception could be
  1710. overwritten in the :meth:`collation <sqlite3.Connection.create_collation>`
  1711. callback.
  1712. - gh-issue-105332: Revert pickling method from by-name back to by-value.
  1713. - gh-issue-104310: In the beta 1 release we added a utility function for
  1714. extension module authors, to use when testing their module for support in
  1715. multiple interpreters or under a per-interpreter GIL. The name of that
  1716. function has changed from ``allowing_all_extensions`` to
  1717. ``_incompatible_extension_module_restrictions``. The default for the
  1718. "disable_check" argument has change from ``True`` to ``False``, to better
  1719. match the new function name.
  1720. - gh-issue-104996: Improve performance of :class:`pathlib.PurePath`
  1721. initialisation by deferring joining of paths when multiple arguments are
  1722. given.
  1723. - gh-issue-102541: Hide traceback in :func:`help` prompt, when import
  1724. failed.
  1725. Tests
  1726. -----
  1727. - gh-issue-105084: When the Python build is configured
  1728. ``--with-wheel-pkg-dir``, tests requiring the ``setuptools`` and ``wheel``
  1729. wheels will search for the wheels in ``WHEEL_PKG_DIR``.
  1730. Windows
  1731. -------
  1732. - gh-issue-105436: Ensure that an empty environment block is terminated by
  1733. two null characters, as is required by Windows.
  1734. C API
  1735. -----
  1736. - gh-issue-105375: Fix a bug in :c:func:`PyErr_WarnExplicit` where an
  1737. exception could end up being overwritten if the API failed internally.
  1738. - gh-issue-105603: We've renamed the new (in 3.12)
  1739. ``PyInterpreterConfig.own_gil`` to ``PyInterpreterConfig.gil`` and changed
  1740. the meaning of the value from "bool" to an integer with supported values
  1741. of ``PyInterpreterConfig_DEFAULT_GIL``,
  1742. ``PyInterpreterConfig_SHARED_GIL``, and ``PyInterpreterConfig_OWN_GIL``.
  1743. The default is "shared".
  1744. - gh-issue-105387: In the limited C API version 3.12, :c:func:`Py_INCREF`
  1745. and :c:func:`Py_DECREF` functions are now implemented as opaque function
  1746. calls to hide implementation details. Patch by Victor Stinner.
  1747. - gh-issue-103968: :c:func:`PyType_FromMetaclass` now allows metaclasses
  1748. with ``tp_new`` set to ``NULL``.
  1749. What's New in Python 3.12.0 beta 2?
  1750. ===================================
  1751. *Release date: 2023-06-06*
  1752. Security
  1753. --------
  1754. - gh-issue-103142: The version of OpenSSL used in our binary builds has been
  1755. upgraded to 1.1.1u to address several CVEs.
  1756. - gh-issue-99108: Refresh our new HACL* built-in :mod:`hashlib` code from
  1757. upstream. Built-in SHA2 should be faster and an issue with SHA3 on 32-bit
  1758. platforms is fixed.
  1759. Core and Builtins
  1760. -----------------
  1761. - gh-issue-105259: Don't include newline character for trailing ``NEWLINE``
  1762. tokens emitted in the :mod:`tokenize` module. Patch by Pablo Galindo
  1763. - gh-issue-105324: Fix the main function of the :mod:`tokenize` module when
  1764. reading from ``sys.stdin``. Patch by Pablo Galindo
  1765. - gh-issue-98963: Restore the ability for a subclass of :class:`property` to
  1766. define ``__slots__`` or otherwise be dict-less by ignoring failures to set
  1767. a docstring on such a class. This behavior had regressed in 3.12beta1.
  1768. An :exc:`AttributeError` where there had not previously been one was
  1769. disruptive to existing code.
  1770. - gh-issue-105194: Do not escape with backslashes f-string format
  1771. specifiers. Patch by Pablo Galindo
  1772. - gh-issue-105162: Fixed bug in generator.close()/throw() where an inner
  1773. iterator would be ignored when the outer iterator was instrumented.
  1774. - gh-issue-105164: Ensure annotations are set up correctly if the only
  1775. annotation in a block is within a :keyword:`match` block. Patch by Jelle
  1776. Zijlstra.
  1777. - gh-issue-104799: Attributes of :mod:`ast` nodes that are lists now default
  1778. to the empty list if omitted. This means that some code that previously
  1779. raised :exc:`TypeError` when the AST node was used will now proceed with
  1780. the empty list instead. Patch by Jelle Zijlstra.
  1781. - gh-issue-105035: Fix :func:`super` calls on types with custom
  1782. :attr:`tp_getattro` implementation (e.g. meta-types.)
  1783. - gh-issue-105017: Show CRLF lines in the tokenize string attribute in both
  1784. NL and NEWLINE tokens. Patch by Marta Gómez.
  1785. - gh-issue-105013: Fix handling of multiline parenthesized lambdas in
  1786. :func:`inspect.getsource`. Patch by Pablo Galindo
  1787. - gh-issue-105017: Do not include an additional final ``NL`` token when
  1788. parsing files having CRLF lines. Patch by Marta Gómez.
  1789. - gh-issue-104976: Ensure that trailing ``DEDENT``
  1790. :class:`tokenize.TokenInfo` objects emitted by the :mod:`tokenize` module
  1791. are reported as in Python 3.11. Patch by Pablo Galindo
  1792. - gh-issue-104972: Ensure that the ``line`` attribute in
  1793. :class:`tokenize.TokenInfo` objects in the :mod:`tokenize` module are
  1794. always correct. Patch by Pablo Galindo
  1795. - gh-issue-104955: Fix signature for the new
  1796. :meth:`~object.__release_buffer__` slot. Patch by Jelle Zijlstra.
  1797. - gh-issue-104690: Starting new threads and process creation through
  1798. :func:`os.fork` during interpreter shutdown (such as from :mod:`atexit`
  1799. handlers) is no longer supported. It can lead to race condition between
  1800. the main Python runtime thread freeing thread states while internal
  1801. :mod:`threading` routines are trying to allocate and use the state of just
  1802. created threads. Or forked children trying to use the mid-shutdown runtime
  1803. and thread state in the child process.
  1804. - gh-issue-104879: Fix crash when accessing the ``__module__`` attribute of
  1805. type aliases defined outside a module. Patch by Jelle Zijlstra.
  1806. - gh-issue-104825: Tokens emitted by the :mod:`tokenize` module do not
  1807. include an implicit ``\n`` character in the ``line`` attribute anymore.
  1808. Patch by Pablo Galindo
  1809. Library
  1810. -------
  1811. - gh-issue-105280: Fix bug where ``isinstance([], collections.abc.Mapping)``
  1812. could evaluate to ``True`` if garbage collection happened at the wrong
  1813. time. The bug was caused by changes to the implementation of
  1814. :class:`typing.Protocol` in Python 3.12.
  1815. - gh-issue-105239: Fix longstanding bug where ``issubclass(object,
  1816. typing.Protocol)`` would evaluate to ``True`` in some edge cases. Patch by
  1817. Alex Waygood.
  1818. - gh-issue-105080: Fixed inconsistent signature on derived classes for
  1819. :func:`inspect.signature`
  1820. - gh-issue-105144: Fix a recent regression in the :mod:`typing` module. The
  1821. regression meant that doing ``class Foo(X, typing.Protocol)``, where ``X``
  1822. was a class that had :class:`abc.ABCMeta` as its metaclass, would then
  1823. cause subsequent ``isinstance(1, X)`` calls to erroneously raise
  1824. :exc:`TypeError`. Patch by Alex Waygood.
  1825. - gh-issue-105113: Improve performance of :meth:`pathlib.PurePath.match` by
  1826. compiling an :class:`re.Pattern` object for the entire pattern.
  1827. - gh-issue-101588: Deprecate undocumented copy/deepcopy/pickle support for
  1828. itertools.
  1829. - gh-issue-103631: Fix
  1830. ``pathlib.PurePosixPath(pathlib.PureWindowsPath(...))`` not converting
  1831. path separators to restore 3.11 compatible behavior.
  1832. - gh-issue-104947: Make comparisons between :class:`pathlib.PureWindowsPath`
  1833. objects consistent across Windows and Posix to match 3.11 behavior.
  1834. - gh-issue-104935: Fix bugs with the interaction between
  1835. :func:`typing.runtime_checkable` and :class:`typing.Generic` that were
  1836. introduced by the :pep:`695` implementation. Patch by Jelle Zijlstra.
  1837. - gh-issue-104874: Document the ``__name__`` and ``__supertype__``
  1838. attributes of :class:`typing.NewType`. Patch by Jelle Zijlstra.
  1839. - gh-issue-104799: Adjust the location of the (see :pep:`695`)
  1840. ``type_params`` field on :class:`ast.ClassDef`,
  1841. :class:`ast.AsyncFunctionDef`, and :class:`ast.FunctionDef` to better
  1842. preserve backward compatibility. Patch by Jelle Zijlstra
  1843. - gh-issue-104797: Allow :class:`typing.Protocol` classes to inherit from
  1844. :class:`collections.abc.Buffer`. Patch by Jelle Zijlstra.
  1845. - gh-issue-104372: On Linux where :mod:`subprocess` can use the ``vfork()``
  1846. syscall for faster spawning, prevent the parent process from blocking
  1847. other threads by dropping the GIL while it waits for the vfork'ed child
  1848. process ``exec()`` outcome. This prevents spawning a binary from a slow
  1849. filesystem from blocking the rest of the application.
  1850. - gh-issue-99108: We now release the GIL around built-in :mod:`hashlib`
  1851. computations of reasonable size for the SHA families and MD5 hash
  1852. functions, matching what our OpenSSL backed hash computations already
  1853. does.
  1854. - gh-issue-104399: Prepare the ``_tkinter`` module for building with Tcl 9.0
  1855. and future libtommath by replacing usage of deprecated functions
  1856. :c:func:`mp_to_unsigned_bin_n` and :c:func:`mp_unsigned_bin_size` when
  1857. necessary.
  1858. - gh-issue-102024: Reduce calls of ``_idle_semaphore.release()`` in
  1859. :func:`concurrent.futures.thread._worker`.
  1860. Documentation
  1861. -------------
  1862. - gh-issue-89455: Add missing documentation for the ``max_group_depth`` and
  1863. ``max_group_width`` parameters and the ``exceptions`` attribute of the
  1864. :class:`traceback.TracebackException` class.
  1865. - gh-issue-89412: Add missing documentation for the ``end_lineno`` and
  1866. ``end_offset`` attributes of the :class:`traceback.TracebackException`
  1867. class.
  1868. - gh-issue-104943: Remove mentions of old Python versions in
  1869. :class:`typing.NamedTuple`.
  1870. Build
  1871. -----
  1872. - gh-issue-90005: Fix a regression in :file:`configure` where we could end
  1873. up unintentionally linking with ``libbsd``.
  1874. - gh-issue-89886: Autoconf 2.71 and aclocal 1.16.4 is now required to
  1875. regenerate :file:`!configure`.
  1876. Windows
  1877. -------
  1878. - gh-issue-105146: Updated the links at the end of the installer to point to
  1879. Discourse rather than the mailing lists.
  1880. - gh-issue-103646: When installed from the Microsoft Store, ``pip`` no
  1881. longer defaults to per-user installs. However, as the install directory is
  1882. unwritable, it should automatically decide to do a per-user install
  1883. anyway. This should resolve issues when ``pip`` is passed an option that
  1884. conflicts with ``--user``.
  1885. - gh-issue-88745: Improve performance of :func:`shutil.copy2` by using the
  1886. operating system's ``CopyFile2`` function. This may result in subtle
  1887. changes to metadata copied along with some files, bringing them in line
  1888. with normal OS behavior.
  1889. - gh-issue-104820: Fixes :func:`~os.stat` and related functions on file
  1890. systems that do not support file ID requests. This includes FAT32 and
  1891. exFAT.
  1892. - gh-issue-104803: Add :func:`os.path.isdevdrive` to detect whether a path
  1893. is on a Windows Dev Drive. Returns ``False`` on platforms that do not
  1894. support Dev Drive, and is absent on non-Windows platforms.
  1895. macOS
  1896. -----
  1897. - gh-issue-103142: Update macOS installer to use OpenSSL 1.1.1u.
  1898. IDLE
  1899. ----
  1900. - gh-issue-104719: Remove IDLE's modification of tokenize.tabsize and test
  1901. other uses of tokenize data and methods.
  1902. C API
  1903. -----
  1904. - gh-issue-105115: ``PyTypeObject.tp_bases`` (and ``tp_mro``) for builtin
  1905. static types are now shared by all interpreters, whereas in 3.12-beta1
  1906. they were stored on ``PyInterpreterState``. Also note that now the tuples
  1907. are immortal objects.
  1908. - gh-issue-105071: Add ``PyUnstable_Exc_PrepReraiseStar`` to the unstable C
  1909. api to expose the implementation of :keyword:`except* <except_star>`.
  1910. - gh-issue-104668: Don't call :c:var:`PyOS_InputHook` or
  1911. :c:var:`PyOS_ReadlineFunctionPointer` in subinterpreters, since it's
  1912. generally difficult to avoid using global state in their registered
  1913. callbacks. This also avoids situations where extensions may find
  1914. themselves running in a subinterpreter they don't support (or haven't yet
  1915. been loaded in).
  1916. What's New in Python 3.12.0 beta 1?
  1917. ===================================
  1918. *Release date: 2023-05-22*
  1919. Security
  1920. --------
  1921. - gh-issue-99889: Fixed a security in flaw in :func:`uu.decode` that could
  1922. allow for directory traversal based on the input if no ``out_file`` was
  1923. specified.
  1924. - gh-issue-104049: Do not expose the local on-disk location in directory
  1925. indexes produced by :class:`http.client.SimpleHTTPRequestHandler`.
  1926. - gh-issue-99108: Upgrade built-in :mod:`hashlib` SHA3 implementation to a
  1927. verified implementation from the ``HACL*`` project. Used when OpenSSL is
  1928. not present or lacks SHA3.
  1929. - gh-issue-102153: :func:`urllib.parse.urlsplit` now strips leading C0
  1930. control and space characters following the specification for URLs defined
  1931. by WHATWG in response to CVE-2023-24329. Patch by Illia Volochii.
  1932. Core and Builtins
  1933. -----------------
  1934. - gh-issue-102856: Implement PEP 701 changes in the :mod:`tokenize` module.
  1935. Patch by Marta Gómez Macías and Pablo Galindo Salgado
  1936. - gh-issue-104615: Fix wrong ordering of assignments in code like ``a, a =
  1937. x, y``. Contributed by Carl Meyer.
  1938. - gh-issue-104572: Improve syntax error message for invalid constructs in
  1939. :pep:`695` contexts and in annotations when ``from __future__ import
  1940. annotations`` is active.
  1941. - gh-issue-104482: Fix three error handling bugs in ast.c's validation of
  1942. pattern matching statements.
  1943. - gh-issue-102818: Do not add a frame to the traceback in the
  1944. ``sys.setprofile`` and ``sys.settrace`` trampoline functions. This ensures
  1945. that frames are not duplicated if an exception is raised in the callback
  1946. function, and ensures that frames are not omitted if a C callback is used
  1947. and that does not add the frame.
  1948. - gh-issue-104405: Fix an issue where some :term:`bytecode` instructions
  1949. could ignore :pep:`523` when "inlining" calls.
  1950. - gh-issue-103082: Change behavior of ``sys.monitoring.events.LINE`` events
  1951. in ``sys.monitoring``: Line events now occur when a new line is reached
  1952. dynamically, instead of using a static approximation, as before. This
  1953. makes the behavior very similar to that of "line" events in
  1954. ``sys.settrace``. This should ease porting of tools from 3.11 to 3.12.
  1955. - gh-issue-104263: Fix ``float("nan")`` to produce a quiet NaN on platforms
  1956. (like MIPS) where the meaning of the signalling / quiet bit is inverted
  1957. from its usual meaning. Also introduce a new macro ``Py_INFINITY``
  1958. matching C99's ``INFINITY``, and refactor internals to rely on C99's
  1959. ``NAN`` and ``INFINITY`` macros instead of hard-coding bit patterns for
  1960. infinities and NaNs. Thanks Sebastian Berg.
  1961. - gh-issue-99113: Multi-phase init extension modules may now indicate that
  1962. they support running in subinterpreters that have their own GIL. This is
  1963. done by using ``Py_MOD_PER_INTERPRETER_GIL_SUPPORTED`` as the value for
  1964. the ``Py_mod_multiple_interpreters`` module def slot. Otherwise the
  1965. module, by default, cannot be imported in such subinterpreters. (This
  1966. does not affect the main interpreter or subinterpreters that do not have
  1967. their own GIL.) In addition to the isolation that multi-phase init
  1968. already normally requires, support for per-interpreter GIL involves one
  1969. additional constraint: thread-safety. If the module has external (linked)
  1970. dependencies and those libraries have any state that isn't thread-safe
  1971. then the module must do the additional work to add thread-safety. This
  1972. should be an uncommon case.
  1973. - gh-issue-99113: The GIL is now (optionally) per-interpreter. This is the
  1974. fundamental change for PEP 684. This is all made possible by virtue of
  1975. the isolated state of each interpreter in the process. The behavior of
  1976. the main interpreter remains unchanged. Likewise, interpreters created
  1977. using ``Py_NewInterpreter()`` are not affected. To get an interpreter
  1978. with its own GIL, call ``Py_NewInterpreterFromConfig()``.
  1979. - gh-issue-104108: Multi-phase init extension modules may now indicate
  1980. whether or not they actually support multiple interpreters. By default
  1981. such modules are expected to support use in multiple interpreters. In the
  1982. uncommon case that one does not, it may use the new
  1983. ``Py_mod_multiple_interpreters`` module def slot. A value of ``0`` means
  1984. the module does not support them. ``1`` means it does. The default is
  1985. ``1``.
  1986. - gh-issue-104142: Fix an issue where :class:`list` or :class:`tuple`
  1987. repetition could fail to respect :pep:`683`.
  1988. - gh-issue-104078: Improve the performance of
  1989. :c:func:`PyObject_HasAttrString`
  1990. - gh-issue-104066: Improve the performance of :func:`hasattr` for module
  1991. objects with a missing attribute.
  1992. - gh-issue-104028: Reduce object creation while calling callback function
  1993. from gc. Patch by Donghee Na.
  1994. - gh-issue-104018: Disallow the "z" format specifier in %-format of bytes
  1995. objects.
  1996. - gh-issue-102213: Fix performance loss when accessing an object's
  1997. attributes with ``__getattr__`` defined.
  1998. - gh-issue-103895: Improve handling of edge cases in showing
  1999. ``Exception.__notes__``. Ensures that the messages always end with a
  2000. newline and that string/bytes are not exploded over multiple lines. Patch
  2001. by Carey Metcalfe.
  2002. - gh-issue-103907: Don't modify the refcounts of known immortal objects
  2003. (:const:`True`, :const:`False`, and :const:`None`) in the main interpreter
  2004. loop.
  2005. - gh-issue-103899: Provide a helpful hint in the :exc:`TypeError` message
  2006. when accidentally calling a :term:`module` object that has a callable
  2007. attribute of the same name (such as :func:`dis.dis` or
  2008. :class:`datetime.datetime`).
  2009. - gh-issue-103845: Remove both line and instruction instrumentation before
  2010. adding new ones for monitoring, to avoid newly added instrumentation being
  2011. removed immediately.
  2012. - gh-issue-103763: Implement :pep:`695`, adding syntactic support for
  2013. generic classes, generic functions, and type aliases.
  2014. A new ``type X = ...`` syntax is added for type aliases, which resolves at
  2015. runtime to an instance of the new class ``typing.TypeAliasType``. The
  2016. value is lazily evaluated and is accessible through the ``.__value__``
  2017. attribute. This is implemented as a new AST node ``ast.TypeAlias``.
  2018. New syntax (``class X[T]: ...``, ``def func[T](): ...``) is added for
  2019. defining generic functions and classes. This is implemented as a new
  2020. ``type_params`` attribute on the AST nodes for classes and functions. This
  2021. node holds instances of the new AST classes ``ast.TypeVar``,
  2022. ``ast.ParamSpec``, and ``ast.TypeVarTuple``.
  2023. ``typing.TypeVar``, ``typing.ParamSpec``, ``typing.ParamSpecArgs``,
  2024. ``typing.ParamSpecKwargs``, ``typing.TypeVarTuple``, and
  2025. ``typing.Generic`` are now implemented in C rather than Python.
  2026. There are new bytecode instructions ``LOAD_LOCALS``,
  2027. ``LOAD_CLASSDICT_OR_GLOBAL``, and ``LOAD_CLASSDICT_OR_DEREF`` to support
  2028. correct resolution of names in class namespaces.
  2029. Patch by Eric Traut, Larry Hastings, and Jelle Zijlstra.
  2030. - gh-issue-103801: Adds three minor linting fixes to the wasm module caught
  2031. that were caught by ruff.
  2032. - gh-issue-103793: Optimized asyncio Task creation by deferring expensive
  2033. string formatting (task name generation) from Task creation to the first
  2034. time ``get_name`` is called. This makes asyncio benchmarks up to 5%
  2035. faster.
  2036. - gh-issue-102310: Change the error range for invalid bytes literals.
  2037. - gh-issue-103590: Do not wrap a single exception raised from a
  2038. ``try-except*`` construct in an :exc:`ExceptionGroup`.
  2039. - gh-issue-103650: Change the perf map format to remove the '0x' prefix from
  2040. the addresses
  2041. - gh-issue-102856: Implement the required C tokenizer changes for PEP 701.
  2042. Patch by Pablo Galindo Salgado, Lysandros Nikolaou, Batuhan Taskaya, Marta
  2043. Gómez Macías and sunmy2019.
  2044. - gh-issue-100530: Clarify the error message raised when the called part of
  2045. a class pattern isn't actually a class.
  2046. - gh-issue-101517: Fix bug in line numbers of instructions emitted for
  2047. :keyword:`except* <except_star>`.
  2048. - gh-issue-103492: Clarify :exc:`SyntaxWarning` with literal ``is``
  2049. comparison by specifying which literal is problematic, since comparisons
  2050. using ``is`` with e.g. None and bool literals are idiomatic.
  2051. - gh-issue-87729: Add :opcode:`LOAD_SUPER_ATTR` (and a specialization for
  2052. ``super().method()``) to speed up ``super().method()`` and
  2053. ``super().attr``. This makes ``super().method()`` roughly 2.3x faster and
  2054. brings it within 20% of the performance of a simple method call. Patch by
  2055. Vladimir Matveev and Carl Meyer.
  2056. - gh-issue-103488: Change the internal offset distinguishing yield and
  2057. return target addresses, so that the instruction pointer is correct for
  2058. exception handling and other stack unwinding.
  2059. - gh-issue-82012: The bitwise inversion operator (``~``) on bool is
  2060. deprecated. It returns the bitwise inversion of the underlying ``int``
  2061. representation such that ``bool(~True) == True``, which can be confusing.
  2062. Use ``not`` for logical negation of bools. In the rare case that you
  2063. really need the bitwise inversion of the underlying ``int``, convert to
  2064. int explicitly ``~int(x)``.
  2065. - gh-issue-77757: Exceptions raised in a typeobject's ``__set_name__``
  2066. method are no longer wrapped by a :exc:`RuntimeError`. Context information
  2067. is added to the exception as a :pep:`678` note.
  2068. - gh-issue-103333: :exc:`AttributeError` now retains the ``name`` attribute
  2069. when pickled and unpickled.
  2070. - gh-issue-103242: Migrate :meth:`~ssl.SSLContext.set_ecdh_curve` method not
  2071. to use deprecated OpenSSL APIs. Patch by Donghee Na.
  2072. - gh-issue-103323: We've replaced our use of ``_PyRuntime.tstate_current``
  2073. with a thread-local variable. This is a fairly low-level implementation
  2074. detail, and there should be no change in behavior.
  2075. - gh-issue-84436: The implementation of PEP-683 which adds Immortal Objects
  2076. by using a fixed reference count that skips reference counting to make
  2077. objects truly immutable.
  2078. - gh-issue-102700: Allow built-in modules to be submodules. This allows
  2079. submodules to be statically linked into a CPython binary.
  2080. - gh-issue-103082: Implement :pep:`669` Low Impact Monitoring for CPython.
  2081. - gh-issue-88691: Reduce the number of inline :opcode:`CACHE` entries for
  2082. :opcode:`CALL`.
  2083. - gh-issue-102500: Make the buffer protocol accessible in Python code using
  2084. the new ``__buffer__`` and ``__release_buffer__`` magic methods. See
  2085. :pep:`688` for details. Patch by Jelle Zijlstra.
  2086. - gh-issue-97933: :pep:`709`: inline list, dict and set comprehensions to
  2087. improve performance and reduce bytecode size.
  2088. - gh-issue-99184: Bypass instance attribute access of ``__name__`` in
  2089. ``repr`` of :class:`weakref.ref`.
  2090. - gh-issue-98003: Complex function calls are now faster and consume no C
  2091. stack space.
  2092. - bpo-39610: ``len()`` for 0-dimensional :class:`memoryview` objects (such
  2093. as ``memoryview(ctypes.c_uint8(42))``) now raises a :exc:`TypeError`.
  2094. Previously this returned ``1``, which was not consistent with
  2095. ``mem_0d[0]`` raising an :exc:`IndexError`.
  2096. - bpo-31821: Fix :func:`!pause_reading` to work when called from
  2097. :func:`!connection_made` in :mod:`asyncio`.
  2098. Library
  2099. -------
  2100. - gh-issue-104600: :func:`functools.update_wrapper` now sets the
  2101. ``__type_params__`` attribute (added by :pep:`695`).
  2102. - gh-issue-104340: When an ``asyncio`` pipe protocol loses its connection
  2103. due to an error, and the caller doesn't await ``wait_closed()`` on the
  2104. corresponding ``StreamWriter``, don't log a warning about an exception
  2105. that was never retrieved. After all, according to the
  2106. ``StreamWriter.close()`` docs, the ``wait_closed()`` call is optional
  2107. ("not mandatory").
  2108. - gh-issue-104555: Fix issue where an :func:`issubclass` check comparing a
  2109. class ``X`` against a :func:`runtime-checkable protocol
  2110. <typing.runtime_checkable>` ``Y`` with non-callable members would not
  2111. cause :exc:`TypeError` to be raised if an :func:`isinstance` call had
  2112. previously been made comparing an instance of ``X`` to ``Y``. This issue
  2113. was present in edge cases on Python 3.11, but became more prominent in
  2114. 3.12 due to some unrelated changes that were made to runtime-checkable
  2115. protocols. Patch by Alex Waygood.
  2116. - gh-issue-104372: Refactored the ``_posixsubprocess`` internals to avoid
  2117. Python C API usage between fork and exec when marking ``pass_fds=`` file
  2118. descriptors inheritable.
  2119. - gh-issue-104484: Added *case_sensitive* argument to
  2120. :meth:`pathlib.PurePath.match`
  2121. - gh-issue-75367: Fix data descriptor detection in
  2122. :func:`inspect.getattr_static`.
  2123. - gh-issue-104536: Fix a race condition in the internal
  2124. :mod:`multiprocessing.process` cleanup logic that could manifest as an
  2125. unintended ``AttributeError`` when calling ``process.close()``.
  2126. - gh-issue-103857: Update datetime deprecations' stracktrace to point to the
  2127. calling line
  2128. - gh-issue-101520: Move the core functionality of the ``tracemalloc`` module
  2129. in the ``Python/`` folder, leaving just the module wrapper in
  2130. ``Modules/``.
  2131. - gh-issue-104392: Remove undocumented and unused ``_paramspec_tvars``
  2132. attribute from some classes in :mod:`typing`.
  2133. - gh-issue-102613: Fix issue where :meth:`pathlib.Path.glob` raised
  2134. :exc:`RecursionError` when walking deep directory trees.
  2135. - gh-issue-103000: Improve performance of :func:`dataclasses.asdict` for the
  2136. common case where *dict_factory* is ``dict``. Patch by David C Ellis.
  2137. - gh-issue-104301: Allow leading whitespace in disambiguated statements in
  2138. :mod:`pdb`.
  2139. - gh-issue-104139: Teach :func:`urllib.parse.unsplit` to retain the ``"//"``
  2140. when assembling ``itms-services://?action=generate-bugs`` style `Apple
  2141. Platform Deployment
  2142. <https://support.apple.com/en-gb/guide/deployment/depce7cefc4d/web>`_
  2143. URLs.
  2144. - gh-issue-104307: :func:`socket.getnameinfo` now releases the GIL while
  2145. contacting the DNS server
  2146. - gh-issue-104310: Users may now use
  2147. ``importlib.util.allowing_all_extensions()`` (a context manager) to
  2148. temporarily disable the strict compatibility checks for importing
  2149. extension modules in subinterpreters.
  2150. - gh-issue-87695: Fix issue where :meth:`pathlib.Path.glob` raised
  2151. :exc:`OSError` when it encountered a symlink to an overly long path.
  2152. - gh-issue-104265: Prevent possible crash by disallowing instantiation of
  2153. the :class:`!_csv.Reader` and :class:`!_csv.Writer` types. The regression
  2154. was introduced in 3.10.0a4 with PR 23224 (:issue:`14935`). Patch by
  2155. Radislav Chugunov.
  2156. - gh-issue-102613: Improve performance of :meth:`pathlib.Path.glob` when
  2157. expanding recursive wildcards ("``**``") by merging adjacent wildcards and
  2158. de-duplicating results only when necessary.
  2159. - gh-issue-65772: Remove unneeded comments and code in turtle.py.
  2160. - gh-issue-90208: Fixed issue where :meth:`pathlib.Path.glob` returned
  2161. incomplete results when it encountered a :exc:`PermissionError`. This
  2162. method now suppresses all :exc:`OSError` exceptions, except those raised
  2163. from calling :meth:`~pathlib.Path.is_dir` on the top-level path.
  2164. - gh-issue-104144: Optimize :class:`asyncio.TaskGroup` when using
  2165. :func:`asyncio.eager_task_factory`. Skip scheduling a done callback if a
  2166. TaskGroup task completes eagerly.
  2167. - gh-issue-104144: Optimize :func:`asyncio.gather` when using
  2168. :func:`asyncio.eager_task_factory` to complete eagerly if all fututres
  2169. completed eagerly. Avoid scheduling done callbacks for futures that
  2170. complete eagerly.
  2171. - gh-issue-104114: Fix issue where :meth:`pathlib.Path.glob` returns paths
  2172. using the case of non-wildcard segments for corresponding path segments,
  2173. rather than the real filesystem case.
  2174. - gh-issue-104104: Improve performance of :meth:`pathlib.Path.glob` by using
  2175. :const:`re.IGNORECASE` to implement case-insensitive matching.
  2176. - gh-issue-104102: Improve performance of :meth:`pathlib.Path.glob` when
  2177. evaluating patterns that contain ``'../'`` segments.
  2178. - gh-issue-103822: Update the return type of ``weekday`` to the newly added
  2179. Day attribute
  2180. - gh-issue-103629: Update the ``repr`` of :class:`typing.Unpack` according
  2181. to :pep:`692`.
  2182. - gh-issue-103963: Make :mod:`dis` display the names of the args for
  2183. :opcode:`!CALL_INTRINSIC_*`.
  2184. - gh-issue-104035: Do not ignore user-defined ``__getstate__`` and
  2185. ``__setstate__`` methods for slotted frozen dataclasses.
  2186. - gh-issue-103987: In :mod:`mmap`, fix several bugs that could lead to
  2187. access to memory-mapped files after they have been invalidated.
  2188. - gh-issue-103977: Improve import time of :mod:`platform` module.
  2189. - gh-issue-88773: Added :func:`turtle.teleport` to the :mod:`turtle` module
  2190. to move a turtle to a new point without tracing a line, visible or
  2191. invisible. Patch by Liam Gersten.
  2192. - gh-issue-103935: Use :func:`io.open_code` for files to be executed instead
  2193. of raw :func:`open`
  2194. - gh-issue-68968: Fixed garbled output of
  2195. :meth:`~unittest.TestCase.assertEqual` when an input lacks final newline.
  2196. - gh-issue-100370: Fix potential :exc:`OverflowError` in
  2197. :meth:`sqlite3.Connection.blobopen` for 32-bit builds. Patch by Erlend E.
  2198. Aasland.
  2199. - gh-issue-102628: Substitute CTRL-D with CTRL-Z in :mod:`sqlite3` CLI
  2200. banner when running on Windows.
  2201. - gh-issue-103636: Module-level attributes ``January`` and ``February`` are
  2202. deprecated from :mod:`calendar`.
  2203. - gh-issue-103583: Isolate :mod:`!_multibytecodec` and codecs extension
  2204. modules. Patches by Erlend E. Aasland.
  2205. - gh-issue-103848: Add checks to ensure that ``[`` bracketed ``]`` hosts
  2206. found by :func:`urllib.parse.urlsplit` are of IPv6 or IPvFuture format.
  2207. - gh-issue-103872: Update the bundled copy of pip to version 23.1.2.
  2208. - gh-issue-99944: Make :mod:`dis` display the value of oparg of
  2209. :opcode:`KW_NAMES`.
  2210. - gh-issue-74940: The C.UTF-8 locale is no longer converted to en_US.UTF-8,
  2211. enabling the use of UTF-8 encoding on systems which have no locales
  2212. installed.
  2213. - gh-issue-103861: Fix ``zipfile.Zipfile`` creating invalid zip files when
  2214. ``force_zip64`` was used to add files to them. Patch by Carey Metcalfe.
  2215. - gh-issue-103857: Deprecated :meth:`datetime.datetime.utcnow` and
  2216. :meth:`datetime.datetime.utcfromtimestamp`. (Patch by Paul Ganssle)
  2217. - gh-issue-103839: Avoid compilation error due to tommath.h not being found
  2218. when building Tkinter against Tcl 8.7 built with bundled libtommath.
  2219. - gh-issue-103791: :class:`contextlib.suppress` now supports suppressing
  2220. exceptions raised as part of an :exc:`ExceptionGroup`. If other exceptions
  2221. exist on the group, they are re-raised in a group that does not contain
  2222. the suppressed exceptions.
  2223. - gh-issue-90750: Use :meth:`datetime.datetime.fromisocalendar` in the
  2224. implementation of :meth:`datetime.datetime.strptime`, which should now
  2225. accept only valid ISO dates. (Patch by Paul Ganssle)
  2226. - gh-issue-103685: Prepare :meth:`tkinter.Menu.index` for Tk 8.7 so that it
  2227. does not raise ``TclError: expected integer but got ""`` when it should
  2228. return ``None``.
  2229. - gh-issue-81403: :class:`urllib.request.CacheFTPHandler` no longer raises
  2230. :class:`URLError` if a cached FTP instance is reused. ftplib's endtransfer
  2231. method calls voidresp to drain the connection to handle FTP instance reuse
  2232. properly.
  2233. - gh-issue-103699: Add ``__orig_bases__`` to non-generic TypedDicts,
  2234. call-based TypedDicts, and call-based NamedTuples. Other TypedDicts and
  2235. NamedTuples already had the attribute.
  2236. - gh-issue-103693: Add convenience variable feature to :mod:`pdb`
  2237. - gh-issue-92248: Deprecate ``type``, ``choices``, and ``metavar``
  2238. parameters of ``argparse.BooleanOptionalAction``.
  2239. - gh-issue-89415: Add :mod:`socket` constants for source-specific multicast.
  2240. Patch by Reese Hyde.
  2241. - gh-issue-103673: :mod:`socketserver` gains ``ForkingUnixStreamServer`` and
  2242. ``ForkingUnixDatagramServer`` classes. Patch by Jay Berry.
  2243. - gh-issue-103636: Added Enum for months and days in the calendar module.
  2244. - gh-issue-84976: Create a new ``Lib/_pydatetime.py`` file that defines the
  2245. Python version of the ``datetime`` module, and make ``datetime`` import
  2246. the contents of the new library only if the C implementation is missing.
  2247. Currently, the full Python implementation is defined and then deleted if
  2248. the C implementation is not available, slowing down ``import datetime``
  2249. unnecessarily.
  2250. - gh-issue-103596: Attributes/methods are no longer shadowed by same-named
  2251. enum members, although they may be shadowed by enum.property's.
  2252. - gh-issue-103584: Updated ``importlib.metadata`` with changes from
  2253. ``importlib_metadata`` 5.2 through 6.5.0, including: Support
  2254. ``installed-files.txt`` for ``Distribution.files`` when present.
  2255. ``PackageMetadata`` now stipulates an additional ``get`` method allowing
  2256. for easy querying of metadata keys that may not be present.
  2257. ``packages_distributions`` now honors packages and modules with Python
  2258. modules that not ``.py`` sources (e.g. ``.pyc``, ``.so``). Expand protocol
  2259. for ``PackageMetadata.get_all`` to match the upstream implementation of
  2260. ``email.message.Message.get_all`` in python/typeshed#9620. Deprecated use
  2261. of ``Distribution`` without defining abstract methods. Deprecated
  2262. expectation that ``PackageMetadata.__getitem__`` will return ``None`` for
  2263. missing keys. In the future, it will raise a ``KeyError``.
  2264. - gh-issue-103578: Fixed a bug where :mod:`pdb` crashes when reading source
  2265. file with different encoding by replacing :func:`io.open` with
  2266. :func:`io.open_code`. The new method would also call into the hook set by
  2267. :c:func:`PyFile_SetOpenCodeHook`.
  2268. - gh-issue-103556: Now creating :class:`inspect.Signature` objects with
  2269. positional-only parameter with a default followed by a
  2270. positional-or-keyword parameter without one is impossible.
  2271. - gh-issue-103559: Update the bundled copy of pip to version 23.1.1.
  2272. - gh-issue-103548: Improve performance of :meth:`pathlib.Path.absolute` and
  2273. :meth:`~pathlib.Path.cwd` by joining paths only when necessary. Also
  2274. improve performance of :meth:`pathlib.PurePath.is_absolute` on Posix by
  2275. skipping path parsing and normalization.
  2276. - gh-issue-103538: Remove ``_tkinter`` module code guarded by definition of
  2277. the ``TK_AQUA`` macro which was only needed for Tk 8.4.7 or earlier and
  2278. was never actually defined by any build system or documented for manual
  2279. use.
  2280. - gh-issue-103533: Update :mod:`cProfile` to use PEP 669 API
  2281. - gh-issue-103525: Fix misleading exception message when mixed ``str`` and
  2282. ``bytes`` arguments are supplied to :class:`pathlib.PurePath` and
  2283. :class:`~pathlib.Path`.
  2284. - gh-issue-103489: Add :meth:`~sqlite3.Connection.getconfig` and
  2285. :meth:`~sqlite3.Connection.setconfig` to :class:`~sqlite3.Connection` to
  2286. make configuration changes to a database connection. Patch by Erlend E.
  2287. Aasland.
  2288. - gh-issue-103365: Set default Flag boundary to ``STRICT`` and fix bitwise
  2289. operations.
  2290. - gh-issue-103472: Avoid a potential :exc:`ResourceWarning` in
  2291. :class:`http.client.HTTPConnection` by closing the proxy / tunnel's
  2292. CONNECT response explicitly.
  2293. - gh-issue-103462: Fixed an issue with using
  2294. :meth:`~asyncio.WriteTransport.writelines` in :mod:`asyncio` to send very
  2295. large payloads that exceed the amount of data that can be written in one
  2296. call to :meth:`socket.socket.send` or :meth:`socket.socket.sendmsg`,
  2297. resulting in the remaining buffer being left unwritten.
  2298. - gh-issue-103449: Fix a bug in doc string generation in
  2299. :func:`dataclasses.dataclass`.
  2300. - gh-issue-103092: Isolate :mod:`!_collections` (apply :pep:`687`). Patch by
  2301. Erlend E. Aasland.
  2302. - gh-issue-103357: Added support for :class:`logging.Formatter` ``defaults``
  2303. parameter to :func:`logging.config.dictConfig` and
  2304. :func:`logging.config.fileConfig`. Patch by Bar Harel.
  2305. - gh-issue-103092: Adapt the :mod:`winreg` extension module to :pep:`687`.
  2306. - gh-issue-74690: The performance of :func:`isinstance` checks against
  2307. :func:`runtime-checkable protocols <typing.runtime_checkable>` has been
  2308. considerably improved for protocols that only have a few members. To
  2309. achieve this improvement, several internal implementation details of the
  2310. :mod:`typing` module have been refactored, including
  2311. ``typing._ProtocolMeta.__instancecheck__``,
  2312. ``typing._is_callable_members_only``, and ``typing._get_protocol_attrs``.
  2313. Patches by Alex Waygood.
  2314. - gh-issue-74690: The members of a runtime-checkable protocol are now
  2315. considered "frozen" at runtime as soon as the class has been created. See
  2316. :ref:`"What's new in Python 3.12" <whatsnew-typing-py312>` for more
  2317. details.
  2318. - gh-issue-103256: Fixed a bug that caused :mod:`hmac` to raise an exception
  2319. when the requested hash algorithm was not available in OpenSSL despite
  2320. being available separately as part of ``hashlib`` itself. It now falls
  2321. back properly to the built-in. This could happen when, for example, your
  2322. OpenSSL does not include SHA3 support and you want to compute
  2323. ``hmac.digest(b'K', b'M', 'sha3_256')``.
  2324. - gh-issue-102778: Support ``sys.last_exc`` in :mod:`idlelib`.
  2325. - gh-issue-103285: Improve performance of :func:`ast.get_source_segment`.
  2326. - gh-issue-103225: Fix a bug in :mod:`pdb` when displaying line numbers of
  2327. module-level source code.
  2328. - gh-issue-103092: Adapt the :mod:`msvcrt` extension module to :pep:`687`.
  2329. - gh-issue-103092: Adapt the :mod:`winsound` extension module to :pep:`687`.
  2330. - gh-issue-93910: Remove deprecation of enum ``memmber.member`` access.
  2331. - gh-issue-102978: Fixes :func:`unittest.mock.patch` not enforcing function
  2332. signatures for methods decorated with ``@classmethod`` or
  2333. ``@staticmethod`` when patch is called with ``autospec=True``.
  2334. - gh-issue-103092: Isolate :mod:`!_socket` (apply :pep:`687`). Patch by
  2335. Erlend E. Aasland.
  2336. - gh-issue-100479: Add :meth:`pathlib.PurePath.with_segments`, which creates
  2337. a path object from arguments. This method is called whenever a derivative
  2338. path is created, such as from :attr:`pathlib.PurePath.parent`. Subclasses
  2339. may override this method to share information between path objects.
  2340. - gh-issue-103220: Fix issue where :func:`os.path.join` added a slash when
  2341. joining onto an incomplete UNC drive with a trailing slash on Windows.
  2342. - gh-issue-103204: Fixes :mod:`http.server` accepting HTTP requests with
  2343. HTTP version numbers preceded by '+', or '-', or with digit-separating '_'
  2344. characters. The length of the version numbers is also constrained.
  2345. - gh-issue-75586: Fix various Windows-specific issues with ``shutil.which``.
  2346. - gh-issue-103193: Improve performance of :func:`inspect.getattr_static`.
  2347. Patch by Alex Waygood.
  2348. - gh-issue-103176: :func:`sys._current_exceptions` now returns a mapping
  2349. from thread-id to an exception instance, rather than to a ``(typ, exc,
  2350. tb)`` tuple.
  2351. - gh-issue-103143: Polish the help messages and docstrings of :mod:`pdb`.
  2352. - gh-issue-103015: Add *entrypoint* keyword-only parameter to
  2353. :meth:`sqlite3.Connection.load_extension`, for overriding the SQLite
  2354. extension entry point. Patch by Erlend E. Aasland.
  2355. - gh-issue-103000: Improve performance of :func:`dataclasses.astuple` and
  2356. :func:`dataclasses.asdict` in cases where the contents are common Python
  2357. types.
  2358. - gh-issue-102953: The extraction methods in :mod:`tarfile`, and
  2359. :func:`shutil.unpack_archive`, have a new a *filter* argument that allows
  2360. limiting tar features than may be surprising or dangerous, such as
  2361. creating files outside the destination directory. See
  2362. :ref:`tarfile-extraction-filter` for details.
  2363. - gh-issue-97696: Implemented an eager task factory in asyncio. When used as
  2364. a task factory on an event loop, it performs eager execution of
  2365. coroutines. Coroutines that are able to complete synchronously (e.g.
  2366. return or raise without blocking) are returned immediately as a finished
  2367. task, and the task is never scheduled to the event loop. If the coroutine
  2368. blocks, the (pending) task is scheduled and returned.
  2369. - gh-issue-81079: Add *case_sensitive* keyword-only argument to
  2370. :meth:`pathlib.Path.glob` and :meth:`~pathlib.Path.rglob`.
  2371. - gh-issue-101819: Isolate the :mod:`io` extension module by applying
  2372. :pep:`687`. Patch by Kumar Aditya, Victor Stinner, and Erlend E. Aasland.
  2373. - gh-issue-91896: Deprecate :class:`collections.abc.ByteString`
  2374. - gh-issue-101362: Speed up :class:`pathlib.Path` construction by omitting
  2375. the path anchor from the internal list of path parts.
  2376. - gh-issue-102114: Functions in the :mod:`dis` module that accept a source
  2377. code string as argument now print a more concise traceback when the string
  2378. contains a syntax or indentation error.
  2379. - gh-issue-62432: The :mod:`unittest` runner will now exit with status code
  2380. 5 if no tests were run. It is common for test runner misconfiguration to
  2381. fail to find any tests, this should be an error.
  2382. - gh-issue-78079: Fix incorrect normalization of UNC device path roots, and
  2383. partial UNC share path roots, in :class:`pathlib.PurePath`. Pathlib no
  2384. longer appends a trailing slash to such paths.
  2385. - gh-issue-85984: Add :func:`tty.cfmakeraw` and :func:`tty.cfmakecbreak` to
  2386. :mod:`tty` and modernize, the behavior of :func:`tty.setraw` and
  2387. :func:`tty.setcbreak` to use POSIX.1-2017 Chapter 11 "General Terminal
  2388. Interface" flag masks by default.
  2389. - gh-issue-101688: Implement :func:`types.get_original_bases` to provide
  2390. further introspection for types.
  2391. - gh-issue-101640: :class:`argparse.ArgumentParser` now catches errors when
  2392. writing messages, such as when :data:`sys.stderr` is ``None``. Patch by
  2393. Oleg Iarygin.
  2394. - gh-issue-83861: Fix datetime.astimezone method return value when invoked
  2395. on a naive datetime instance that represents local time falling in a
  2396. timezone transition gap. PEP 495 requires that instances with fold=1
  2397. produce earlier times than those with fold=0 in this case.
  2398. - gh-issue-89550: Decrease execution time of some :mod:`gzip` file writes by
  2399. 15% by adding more appropriate buffering.
  2400. - gh-issue-95299: Remove the bundled setuptools wheel from ``ensurepip``,
  2401. and stop installing setuptools in environments created by ``venv``.
  2402. - gh-issue-99353: Respect the :class:`http.client.HTTPConnection`
  2403. ``.debuglevel`` flag in :class:`urllib.request.AbstractHTTPHandler` when
  2404. its constructor parameter ``debuglevel`` is not set. And do the same for
  2405. ``*HTTPS*``.
  2406. - gh-issue-98040: Remove the long-deprecated ``imp`` module.
  2407. - gh-issue-97850: Deprecate :func:`pkgutil.find_loader` and
  2408. :func:`pkgutil.get_loader` in favor of :func:`importlib.util.find_spec`.
  2409. - gh-issue-94473: Flatten arguments in :meth:`tkinter.Canvas.coords`. It now
  2410. accepts not only ``x1, y1, x2, y2, ...`` and ``[x1, y1, x2, y2, ...]``,
  2411. but also ``(x1, y1), (x2, y2), ...`` and ``[(x1, y1), (x2, y2), ...]``.
  2412. - gh-issue-98040: Remove more deprecated importlib APIs: ``find_loader()``,
  2413. ``find_module()``, ``importlib.abc.Finder``, ``pkgutil.ImpImporter``,
  2414. ``pkgutil.ImpLoader``.
  2415. - gh-issue-96522: Fix potential deadlock in pty.spawn()
  2416. - gh-issue-96534: Support divert(4) added in FreeBSD 14.
  2417. - gh-issue-87474: Fix potential file descriptor leaks in
  2418. :class:`subprocess.Popen`.
  2419. - gh-issue-94906: Support multiple steps in :func:`math.nextafter`. Patch by
  2420. Shantanu Jain and Matthias Gorgens.
  2421. - gh-issue-51574: Make :func:`tempfile.mkdtemp` return absolute paths when
  2422. its *dir* parameter is relative.
  2423. - gh-issue-94518: Convert private :meth:`_posixsubprocess.fork_exec` to use
  2424. Argument Clinic.
  2425. - gh-issue-92184: When creating zip files using :mod:`zipfile`,
  2426. ``os.altsep``, if not ``None``, will always be treated as a path separator
  2427. even when it is not ``/``. Patch by Carey Metcalfe.
  2428. - bpo-46797: Deprecation warnings are now emitted for :class:`!ast.Num`,
  2429. :class:`!ast.Bytes`, :class:`!ast.Str`, :class:`!ast.NameConstant` and
  2430. :class:`!ast.Ellipsis`. These have been documented as deprecated since
  2431. Python 3.8, and will be removed in Python 3.14.
  2432. - bpo-44844: Enables :mod:`webbrowser` to detect and launch Microsoft Edge
  2433. browser.
  2434. - bpo-45606: Fixed the bug in :meth:`pathlib.Path.glob` -- previously a
  2435. dangling symlink would not be found by this method when the pattern is an
  2436. exact match, but would be found when the pattern contains a wildcard or
  2437. the recursive wildcard (``**``). With this change, a dangling symlink will
  2438. be found in both cases.
  2439. - bpo-23041: Add :const:`~csv.QUOTE_STRINGS` and :const:`~csv.QUOTE_NOTNULL`
  2440. to the suite of :mod:`csv` module quoting styles.
  2441. - bpo-24964: Added
  2442. :meth:`http.client.HTTPConnection.get_proxy_response_headers` that
  2443. provides access to the HTTP headers on a proxy server response to the
  2444. ``CONNECT`` request.
  2445. - bpo-17258: :mod:`multiprocessing` now supports stronger HMAC algorithms
  2446. for inter-process connection authentication rather than only HMAC-MD5.
  2447. - bpo-39744: Make :func:`asyncio.subprocess.Process.communicate` close the
  2448. subprocess's stdin even when called with ``input=None``.
  2449. - bpo-22708: http.client CONNECT method tunnel improvements: Use HTTP 1.1
  2450. protocol; send a matching Host: header with CONNECT, if one is not
  2451. provided; convert IDN domain names to Punycode. Patch by Michael Handler.
  2452. Documentation
  2453. -------------
  2454. - gh-issue-67056: Document that the effect of registering or unregistering
  2455. an :mod:`atexit` cleanup function from within a registered cleanup
  2456. function is undefined.
  2457. - gh-issue-103629: Mention the new way of typing ``**kwargs`` with
  2458. ``Unpack`` and ``TypedDict`` introduced in :pep:`692`.
  2459. - gh-issue-48241: Clarifying documentation about the url parameter to
  2460. urllib.request.urlopen and urllib.request.Request needing to be encoded
  2461. properly.
  2462. - gh-issue-86094: Add support for Unicode Path Extra Field in ZipFile. Patch
  2463. by Yeojin Kim and Andrea Giudiceandrea
  2464. - gh-issue-99202: Fix extension type from documentation for compiling in
  2465. C++20 mode
  2466. Tests
  2467. -----
  2468. - gh-issue-104494: Update ``test_pack_configure_in`` and
  2469. ``test_place_configure_in`` for changes to error message formatting in Tk
  2470. 8.7.
  2471. - gh-issue-104461: Run test_configure_screen on X11 only, since the
  2472. ``DISPLAY`` environment variable and ``-screen`` option for toplevels are
  2473. not useful on Tk for Win32 or Aqua.
  2474. - gh-issue-86275: Added property-based tests to the :mod:`zoneinfo` tests,
  2475. along with stubs for the ``hypothesis`` interface. (Patch by Paul Ganssle)
  2476. - gh-issue-103329: Regression tests for the behaviour of
  2477. ``unittest.mock.PropertyMock`` were added.
  2478. - gh-issue-102795: fix use of poll in test_epoll's test_control_and_wait
  2479. - gh-issue-75729: Fix the :func:`os.spawn* <os.spawnl>` tests failing on
  2480. Windows when the working directory or interpreter path contains spaces.
  2481. Build
  2482. -----
  2483. - gh-issue-101282: BOLT optimization is now applied to the libpython shared
  2484. library if building a shared library. BOLT instrumentation and application
  2485. settings can now be influenced via the ``BOLT_INSTRUMENT_FLAGS`` and
  2486. ``BOLT_APPLY_FLAGS`` configure variables.
  2487. - gh-issue-99017: ``PYTHON_FOR_REGEN`` now require Python 3.10 or newer.
  2488. - gh-issue-104490: Define ``.PHONY`` / virtual make targets consistently and
  2489. properly.
  2490. - gh-issue-104106: Add gcc fallback of mkfifoat/mknodat for macOS. Patch by
  2491. Donghee Na.
  2492. - gh-issue-103532: The ``TKINTER_PROTECT_LOADTK`` macro is no longer defined
  2493. or used in the ``_tkinter`` module. It was previously only defined when
  2494. building against Tk 8.4.13 and older, but Tk older than 8.5.12 has been
  2495. unsupported since gh-issue-91152.
  2496. - gh-issue-99069: Extended workaround defining ``static_assert`` when
  2497. missing from the libc headers to all clang and gcc builds. In particular,
  2498. this fixes building on macOS <= 10.10.
  2499. - gh-issue-100220: Changed the default value of the ``SHELL`` Makefile
  2500. variable from ``/bin/sh`` to ``/bin/sh -e`` to ensure that complex recipes
  2501. correctly fail after an error. Previously, ``make install`` could fail to
  2502. install some files and yet return a successful result.
  2503. - gh-issue-90656: Add platform triplets for 64-bit LoongArch:
  2504. * loongarch64-linux-gnusf
  2505. * loongarch64-linux-gnuf32
  2506. * loongarch64-linux-gnu
  2507. Patch by Zhang Na.
  2508. Windows
  2509. -------
  2510. - gh-issue-104623: Update Windows installer to use SQLite 3.42.0.
  2511. - gh-issue-82814: Fix a potential ``[Errno 13] Permission denied`` when
  2512. using :func:`shutil.copystat` within Windows Subsystem for Linux (WSL) on
  2513. a mounted filesystem by adding ``errno.EACCES`` to the list of ignored
  2514. errors within the internal implementation.
  2515. - gh-issue-103088: Fix virtual environment :file:`activate` script having
  2516. incorrect line endings for Cygwin.
  2517. - gh-issue-103088: Fixes venvs not working in bash on Windows across
  2518. different disks
  2519. - gh-issue-102997: Update Windows installer to use SQLite 3.41.2.
  2520. - gh-issue-88013: Fixed a bug where :exc:`TypeError` was raised when calling
  2521. :func:`ntpath.realpath` with a bytes parameter in some cases.
  2522. macOS
  2523. -----
  2524. - gh-issue-99834: Update macOS installer to Tcl/Tk 8.6.13.
  2525. - gh-issue-104623: Update macOS installer to SQLite 3.42.0.
  2526. - gh-issue-103545: Add ``os.PRIO_DARWIN_THREAD``,
  2527. ``os.PRIO_DARWIN_PROCESS``, ``os.PRIO_DARWIN_BG`` and
  2528. ``os.PRIO_DARWIN_NONUI``. These can be used with ``os.setpriority`` to run
  2529. the process at a lower priority and make use of the efficiency cores on
  2530. Apple Silicon systems.
  2531. - gh-issue-104180: Support reading SOCKS proxy configuration from macOS
  2532. System Configuration. Patch by Sam Schott.
  2533. - gh-issue-60436: update curses textbox to additionally handle backspace
  2534. using the ``curses.ascii.DEL`` key press.
  2535. - gh-issue-102997: Update macOS installer to SQLite 3.41.2.
  2536. IDLE
  2537. ----
  2538. - gh-issue-104499: Fix completions for Tk Aqua 8.7 (currently blank).
  2539. - gh-issue-104496: About prints both tcl and tk versions if different
  2540. (expected someday).
  2541. - gh-issue-88496: Fix IDLE test hang on macOS.
  2542. Tools/Demos
  2543. -----------
  2544. - gh-issue-104389: Argument Clinic C converters now accept the ``unused``
  2545. keyword, for wrapping a parameter with :c:macro:`Py_UNUSED`. Patch by
  2546. Erlend E. Aasland.
  2547. C API
  2548. -----
  2549. - gh-issue-101291: Added unstable C API for extracting the value of
  2550. "compact" integers: :c:func:`PyUnstable_Long_IsCompact` and
  2551. :c:func:`PyUnstable_Long_CompactValue`.
  2552. - gh-issue-104109: We've added ``Py_NewInterpreterFromConfig()`` and
  2553. ``PyInterpreterConfig`` to the public C-API (but not the stable ABI; not
  2554. yet at least). The new function may be used to create a new interpreter
  2555. with various features configured. The function was added to support PEP
  2556. 684 (per-interpreter GIL).
  2557. - gh-issue-103968: :c:func:`PyType_FromSpec` and its variants now allow
  2558. creating classes whose metaclass overrides
  2559. :c:member:`~PyTypeObject.tp_new`. The ``tp_new`` is ignored. This behavior
  2560. is deprecated and will be disallowed in 3.14+. The new
  2561. :c:func:`PyType_FromMetaclass` already disallows it.
  2562. - gh-issue-103743: Add :c:func:`PyUnstable_Object_GC_NewWithExtraData`
  2563. function that can be used to allocate additional memory after an object
  2564. for data not managed by Python.
  2565. - gh-issue-103295: Introduced :c:func:`PyUnstable_WritePerfMapEntry`,
  2566. :c:func:`PyUnstable_PerfMapState_Init` and
  2567. :c:func:`PyUnstable_PerfMapState_Fini`. These allow extension modules (JIT
  2568. compilers in particular) to write to perf-map files in a thread safe
  2569. manner. The :doc:`../howto/perf_profiling` also uses these APIs to write
  2570. entries in the perf-map file.
  2571. - gh-issue-103509: Added C API for extending types whose instance memory
  2572. layout is opaque: :c:member:`PyType_Spec.basicsize` can now be zero or
  2573. negative, :c:func:`PyObject_GetTypeData` can be used to get
  2574. subclass-specific data, and :c:macro:`Py_TPFLAGS_ITEMS_AT_END` can be used
  2575. to safely extend variable-size objects. See :pep:`697` for details.
  2576. - gh-issue-103091: Add a new C-API function to eagerly assign a version tag
  2577. to a PyTypeObject: ``PyUnstable_Type_AssignVersionTag()``.
  2578. - gh-issue-101408: :c:macro:`PyObject_GC_Resize` should calculate preheader
  2579. size if needed. Patch by Donghee Na.
  2580. - gh-issue-98836: Add support of more formatting options (left aligning,
  2581. octals, uppercase hexadecimals, :c:type:`intmax_t`, :c:type:`ptrdiff_t`,
  2582. :c:type:`wchar_t` C strings, variable width and precision) in
  2583. :c:func:`PyUnicode_FromFormat` and :c:func:`PyUnicode_FromFormatV`.
  2584. - gh-issue-96803: Add unstable C-API functions to get the code object, lasti
  2585. and line number from the internal ``_PyInterpreterFrame`` in the limited
  2586. API. The functions are:
  2587. * ``PyCodeObject * PyUnstable_InterpreterFrame_GetCode(struct _PyInterpreterFrame *frame)``
  2588. * ``int PyUnstable_InterpreterFrame_GetLasti(struct _PyInterpreterFrame *frame)``
  2589. * ``int PyUnstable_InterpreterFrame_GetLine(struct _PyInterpreterFrame *frame)``
  2590. What's New in Python 3.12.0 alpha 7?
  2591. ====================================
  2592. *Release date: 2023-04-04*
  2593. Core and Builtins
  2594. -----------------
  2595. - gh-issue-102192: Deprecated ``_PyErr_ChainExceptions`` in favour of
  2596. ``_PyErr_ChainExceptions1``.
  2597. - gh-issue-89987: Reduce the number of inline :opcode:`CACHE` entries for
  2598. :opcode:`BINARY_SUBSCR`.
  2599. - gh-issue-102859: Removed :opcode:`!JUMP_IF_FALSE_OR_POP` and
  2600. :opcode:`!JUMP_IF_TRUE_OR_POP` instructions.
  2601. - gh-issue-101975: Fixed ``stacktop`` value on tracing entries to avoid
  2602. corruption on garbage collection.
  2603. - gh-issue-102778: Add :data:`sys.last_exc` and deprecate
  2604. :data:`sys.last_type`, :data:`sys.last_value` and
  2605. :data:`sys.last_traceback`, which hold the same information in its legacy
  2606. form.
  2607. - gh-issue-100982: Replace all occurrences of ``COMPARE_AND_BRANCH`` with
  2608. :opcode:`COMPARE_OP`.
  2609. - gh-issue-102701: Fix overflow when creating very large dict.
  2610. - gh-issue-102755: Add :c:func:`PyErr_DisplayException` which takes just an
  2611. exception instance, to replace the legacy :c:func:`PyErr_Display` which
  2612. takes the ``(typ, exc, tb)`` triplet.
  2613. - gh-issue-102594: Add note to exception raised in ``PyErr_SetObject`` when
  2614. normalization fails.
  2615. - gh-issue-90997: Shrink the number of inline :opcode:`CACHE` entries used
  2616. by :opcode:`LOAD_GLOBAL`.
  2617. - gh-issue-102491: Improve import time of ``platform`` by removing
  2618. IronPython version parsing. The IronPython version parsing was not
  2619. functional (see https://github.com/IronLanguages/ironpython3/issues/1667).
  2620. - gh-issue-101291: Rearrage bits in first field (after header) of
  2621. PyLongObject. * Bits 0 and 1: 1 - sign. I.e. 0 for positive numbers, 1 for
  2622. zero and 2 for negative numbers. * Bit 2 reserved (probably for the
  2623. immortal bit) * Bits 3+ the unsigned size.
  2624. This makes a few operations slightly more efficient, and will enable a
  2625. more compact and faster 2s-complement representation of most ints in
  2626. future.
  2627. - gh-issue-102397: Fix segfault from race condition in signal handling
  2628. during garbage collection. Patch by Kumar Aditya.
  2629. - gh-issue-102406: :mod:`codecs` encoding/decoding errors now get the
  2630. context information (which operation and which codecs) attached as
  2631. :pep:`678` notes instead of through chaining a new instance of the
  2632. exception.
  2633. - gh-issue-102281: Fix potential nullptr dereference and use of
  2634. uninitialized memory in fileutils. Patch by Max Bachmann.
  2635. - gh-issue-102300: Reuse operands with refcount of 1 in float
  2636. specializations of BINARY_OP.
  2637. - gh-issue-102213: Fix performance loss when accessing an object's
  2638. attributes with ``__getattr__`` defined.
  2639. - gh-issue-102255: Improve build support for the Xbox. Patch by Max
  2640. Bachmann.
  2641. - gh-issue-102027: Fix SSE2 and SSE3 detection in ``_blake2`` internal
  2642. module. Patch by Max Bachmann.
  2643. - gh-issue-101865: Deprecate ``co_lnotab`` in code objects, schedule it for
  2644. removal in Python 3.14
  2645. - bpo-1635741: Adapt :mod:`!_pickle` to :pep:`687`. Patch by Mohamed Koubaa
  2646. and Erlend Aasland.
  2647. Library
  2648. -------
  2649. - gh-issue-103085: Pure python :func:`locale.getencoding()` will not warn
  2650. deprecation.
  2651. - gh-issue-103068: It's no longer possible to register conditional
  2652. breakpoints in :class:`~pdb.Pdb` that raise :exc:`SyntaxError`. Patch by
  2653. Tian Gao.
  2654. - gh-issue-102549: Don't ignore exceptions in member type creation.
  2655. - gh-issue-103056: Ensure final ``_generate_next_value_`` is a
  2656. ``staticmethod``.
  2657. - gh-issue-103046: Display current line label correctly in :mod:`dis` when
  2658. ``show_caches`` is False and ``lasti`` points to a CACHE entry.
  2659. - gh-issue-102433: :func:`isinstance` checks against
  2660. :func:`runtime-checkable protocols <typing.runtime_checkable>` now use
  2661. :func:`inspect.getattr_static` rather than :func:`hasattr` to lookup
  2662. whether attributes exist. This means that descriptors and
  2663. :meth:`~object.__getattr__` methods are no longer unexpectedly evaluated
  2664. during ``isinstance()`` checks against runtime-checkable protocols.
  2665. However, it may also mean that some objects which used to be considered
  2666. instances of a runtime-checkable protocol may no longer be considered
  2667. instances of that protocol on Python 3.12+, and vice versa. Most users are
  2668. unlikely to be affected by this change. Patch by Alex Waygood.
  2669. - gh-issue-103023: It's no longer possible to register expressions to
  2670. display in :class:`~pdb.Pdb` that raise :exc:`SyntaxError`. Patch by Tian
  2671. Gao.
  2672. - gh-issue-102947: Improve traceback when :func:`dataclasses.fields` is
  2673. called on a non-dataclass. Patch by Alex Waygood
  2674. - gh-issue-102780: The :class:`asyncio.Timeout` context manager now works
  2675. reliably even when performing cleanup due to task cancellation.
  2676. Previously it could raise a :exc:`~asyncio.CancelledError` instead of an
  2677. :exc:`~asyncio.TimeoutError` in such cases.
  2678. - gh-issue-102871: Remove support for obsolete browsers from
  2679. :mod:`webbrowser`. Removed browsers include Grail, Mosaic, Netscape,
  2680. Galeon, Skipstone, Iceape, Firebird, and Firefox versions 35 and below.
  2681. - gh-issue-102839: Improve performance of :func:`math.log` arguments
  2682. handling by removing the argument clinic.
  2683. - gh-issue-102828: Add the ``onexc`` arg to :func:`shutil.rmtree`, which is
  2684. like ``onerror`` but expects an exception instance rather than an exc_info
  2685. tuple. Deprecate ``onerror``.
  2686. - gh-issue-88965: typing: Fix a bug relating to substitution in custom
  2687. classes generic over a :class:`~typing.ParamSpec`. Previously, if the
  2688. ``ParamSpec`` was substituted with a parameters list that itself contained
  2689. a :class:`~typing.TypeVar`, the ``TypeVar`` in the parameters list could
  2690. not be subsequently substituted. This is now fixed.
  2691. Patch by Nikita Sobolev.
  2692. - gh-issue-76846: Fix issue where ``__new__()`` and ``__init__()`` methods
  2693. of :class:`pathlib.PurePath` and :class:`~pathlib.Path` subclasses were
  2694. not called in some circumstances.
  2695. - gh-issue-78530: :func:`asyncio.wait` now accepts generators yielding
  2696. tasks. Patch by Kumar Aditya.
  2697. - gh-issue-102748: :func:`asyncio.iscoroutine` now returns ``False`` for
  2698. generators as :mod:`asyncio` does not support legacy generator-based
  2699. coroutines. Patch by Kumar Aditya.
  2700. - gh-issue-102670: Optimized fmean(), correlation(), covariance(), and
  2701. linear_regression() using the new math.sumprod() function.
  2702. - gh-issue-102615: Typing: Improve the ``repr`` of generic aliases for
  2703. classes generic over a :class:`~typing.ParamSpec`. (Use square brackets to
  2704. represent a parameter list.)
  2705. - gh-issue-100112: :meth:`asyncio.Task.get_coro` now always returns a
  2706. coroutine when wrapping an awaitable object. Patch by Kumar Aditya.
  2707. - gh-issue-102578: Speed up setting or deleting mutable attributes on
  2708. non-dataclass subclasses of frozen dataclasses. Due to the implementation
  2709. of ``__setattr__`` and ``__delattr__`` for frozen dataclasses, this
  2710. previously had a time complexity of *O*\ (*n*). It now has a time
  2711. complexity of *O*\ (1).
  2712. - gh-issue-102519: Add :func:`os.listdrives`, :func:`os.listvolumes` and
  2713. :func:`os.listmounts` functions on Windows for enumerating drives, volumes
  2714. and mount points
  2715. - gh-issue-74468: Attribute name of the extracted :mod:`tarfile` file object
  2716. now holds filename of itself rather than of the archive it is contained
  2717. in. Patch by Oleg Iarygin.
  2718. - gh-issue-102378: Private helper method
  2719. ``inspect._signature_strip_non_python_syntax`` will no longer strip ``/``
  2720. from the input string.
  2721. - gh-issue-79940: Add :func:`inspect.getasyncgenstate` and
  2722. :func:`inspect.getasyncgenlocals`. Patch by Thomas Krennwallner.
  2723. - gh-issue-102103: Add ``module`` argument to
  2724. :func:`dataclasses.make_dataclass` and make classes produced by it
  2725. pickleable.
  2726. - gh-issue-102069: Fix ``__weakref__`` descriptor generation for custom
  2727. dataclasses.
  2728. - gh-issue-102038: Skip a ``stat`` in :mod:`site` if we have already found a
  2729. ``pyvenv.cfg``
  2730. - gh-issue-98886: Fix issues when defining dataclasses that have fields with
  2731. specific underscore names that aren't clearly reserved by
  2732. :mod:`dataclasses`.
  2733. - gh-issue-101673: Fix a :mod:`pdb` bug where ``ll`` clears the changes to
  2734. local variables.
  2735. - gh-issue-101313: Added -h and --help arguments to the webbrowser CLI
  2736. - gh-issue-100372: :meth:`ssl.SSLContext.load_verify_locations` no longer
  2737. incorrectly accepts some cases of trailing data when parsing DER.
  2738. - gh-issue-89727: Fix pathlib.Path.walk RecursionError on deep directory
  2739. trees by rewriting it using iteration instead of recursion.
  2740. - gh-issue-100131: Added an optional ``delete`` keyword argument to
  2741. :class:`tempfile.TemporaryDirectory`.
  2742. - gh-issue-48330: Added ``--durations`` command line option, showing the N
  2743. slowest test cases. :class:`unittest.TextTestRunner` and
  2744. :class:`unittest.TextTestResult` constructors accept a new *durations*
  2745. keyword argument. Subclasses should take this into account or accept
  2746. ``**kwargs``. Added :meth:`unittest.TestResult.addDuration` method and
  2747. :attr:`unittest.TestResult.collectedDurations` attribute.
  2748. (Contributed by Giampaolo Rodola)
  2749. - gh-issue-98169: Fix :func:`dataclasses.astuple` crash when
  2750. :class:`collections.defaultdict` is present in the attributes.
  2751. - gh-issue-96931: Fix incorrect results from
  2752. :meth:`ssl.SSLSocket.shared_ciphers`
  2753. - gh-issue-95495: When built against OpenSSL 3.0, the :mod:`ssl` module had
  2754. a bug where it reported unauthenticated EOFs (i.e. without close_notify)
  2755. as a clean TLS-level EOF. It now raises :exc:`~ssl.SSLEOFError`, matching
  2756. the behavior in previous versions of OpenSSL. The
  2757. :attr:`~ssl.SSLContext.options` attribute on :class:`~ssl.SSLContext` also
  2758. no longer includes :const:`~ssl.OP_IGNORE_UNEXPECTED_EOF` by default. This
  2759. option may be set to specify the previous OpenSSL 3.0 behavior.
  2760. - gh-issue-94684: Now :func:`uuid.uuid3` and :func:`uuid.uuid5` functions
  2761. support :class:`bytes` objects as their *name* argument.
  2762. - gh-issue-94440: Fix a :mod:`concurrent.futures.process` bug where
  2763. ``ProcessPoolExecutor`` shutdown could hang after a future has been
  2764. quickly submitted and canceled.
  2765. - gh-issue-72346: Added deprecation warning to *isdst* parameter of
  2766. :func:`email.utils.localtime`.
  2767. - bpo-36305: Fix handling of Windows filenames that resemble drives, such as
  2768. ``./a:b``, in :mod:`pathlib`.
  2769. Documentation
  2770. -------------
  2771. - gh-issue-103112: Add docstring to :meth:`http.client.HTTPResponse.read` to
  2772. fix ``pydoc`` output.
  2773. Tests
  2774. -----
  2775. - gh-issue-102980: Improve test coverage on :mod:`pdb`.
  2776. - gh-issue-102537: Adjust the error handling strategy in
  2777. ``test_zoneinfo.TzPathTest.python_tzpath_context``. Patch by Paul Ganssle.
  2778. - gh-issue-101377: Improved test_locale_calendar_formatweekday of calendar.
  2779. Build
  2780. -----
  2781. - gh-issue-102973: Add a dev container (along with accompanying Dockerfile)
  2782. for development purposes.
  2783. - gh-issue-102711: Fix ``-Wstrict-prototypes`` compiler warnings.
  2784. Windows
  2785. -------
  2786. - gh-issue-102690: Update :mod:`webbrowser` to fall back to Microsoft Edge
  2787. instead of Internet Explorer.
  2788. - gh-issue-99726: Improves correctness of stat results for Windows, and uses
  2789. faster API when available
  2790. Tools/Demos
  2791. -----------
  2792. - gh-issue-102809: ``Misc/gdbinit`` was removed.
  2793. C API
  2794. -----
  2795. - gh-issue-102013: Add a new (unstable) C-API function for iterating over
  2796. GC'able objects using a callback: ``PyUnstable_VisitObjects``.
  2797. What's New in Python 3.12.0 alpha 6?
  2798. ====================================
  2799. *Release date: 2023-03-07*
  2800. Security
  2801. --------
  2802. - gh-issue-99108: Replace builtin hashlib implementations of MD5 and SHA1
  2803. with verified ones from the HACL* project.
  2804. - gh-issue-101727: Updated the OpenSSL version used in Windows and macOS
  2805. binary release builds to 1.1.1t to address CVE-2023-0286, CVE-2022-4303,
  2806. and CVE-2022-4303 per `the OpenSSL 2023-02-07 security advisory
  2807. <https://www.openssl.org/news/secadv/20230207.txt>`_.
  2808. - gh-issue-99108: Replace the builtin :mod:`hashlib` implementations of
  2809. SHA2-384 and SHA2-512 originally from LibTomCrypt with formally verified,
  2810. side-channel resistant code from the `HACL*
  2811. <https://github.com/hacl-star/hacl-star/>`_ project. The builtins remain a
  2812. fallback only used when OpenSSL does not provide them.
  2813. - gh-issue-101283: :class:`subprocess.Popen` now uses a safer approach to
  2814. find ``cmd.exe`` when launching with ``shell=True``. Patch by Eryk Sun,
  2815. based on a patch by Oleg Iarygin.
  2816. Core and Builtins
  2817. -----------------
  2818. - gh-issue-102493: Fix regression in semantics of normalisation in
  2819. ``PyErr_SetObject``.
  2820. - gh-issue-102416: Do not memoize incorrectly automatically generated loop
  2821. rules in the parser. Patch by Pablo Galindo.
  2822. - gh-issue-102356: Fix a bug that caused a crash when deallocating deeply
  2823. nested filter objects. Patch by Marta Gómez Macías.
  2824. - gh-issue-102336: Cleanup Windows 7 specific special handling. Patch by Max
  2825. Bachmann.
  2826. - gh-issue-102250: Fixed a segfault occurring when the interpreter calls a
  2827. ``__bool__`` method that raises.
  2828. - gh-issue-102126: Fix deadlock at shutdown when clearing thread states if
  2829. any finalizer tries to acquire the runtime head lock. Patch by Kumar
  2830. Aditya.
  2831. - gh-issue-102027: Use ``GetCurrentProcessId`` on Windows when ``getpid`` is
  2832. unavailable. Patch by Max Bachmann.
  2833. - gh-issue-102056: Fix error handling bugs in interpreter's exception
  2834. printing code, which could cause a crash on infinite recursion.
  2835. - gh-issue-100982: Restrict the scope of the :opcode:`FOR_ITER_RANGE`
  2836. instruction to the scope of the original :opcode:`FOR_ITER` instruction,
  2837. to allow instrumentation.
  2838. - gh-issue-101967: Fix possible segfault in
  2839. ``positional_only_passed_as_keyword`` function, when new list created.
  2840. - gh-issue-101952: Fix possible segfault in ``BUILD_SET`` opcode, when new
  2841. set created.
  2842. - gh-issue-74895: :mod:`socket.getaddrinfo` no longer raises
  2843. :class:`OverflowError` for :class:`int` **port** values outside of the C
  2844. long range. Out of range values are left up to the underlying string based
  2845. C library API to report. A :class:`socket.gaierror` ``SAI_SERVICE`` may
  2846. occur instead, or no error at all as not all platform C libraries generate
  2847. an error.
  2848. - gh-issue-101799: Add :opcode:`CALL_INTRINSIC_2` and use it instead of
  2849. :opcode:`!PREP_RERAISE_STAR`.
  2850. - gh-issue-101857: Fix xattr support detection on Linux systems by widening
  2851. the check to linux, not just glibc. This fixes support for musl.
  2852. - gh-issue-84783: Make the slice object hashable. Patch by Will Bradshaw and
  2853. Furkan Onder.
  2854. - gh-issue-87849: Change the ``SEND`` instruction to leave the receiver on
  2855. the stack. This allows the specialized form of ``SEND`` to skip the chain
  2856. of C calls and jump directly to the ``RESUME`` in the generator or
  2857. coroutine.
  2858. - gh-issue-101765: Fix SystemError / segmentation fault in iter
  2859. ``__reduce__`` when internal access of ``builtins.__dict__`` keys mutates
  2860. the iter object.
  2861. - gh-issue-101430: Update :mod:`tracemalloc` to handle presize of object
  2862. properly. Patch by Donghee Na.
  2863. - gh-issue-101696: Invalidate type version tag in ``_PyStaticType_Dealloc``
  2864. for static types, avoiding bug where a false cache hit could crash the
  2865. interpreter. Patch by Kumar Aditya.
  2866. - gh-issue-101632: Adds a new :opcode:`RETURN_CONST` instruction.
  2867. - gh-issue-100719: Remove gi_code field from generator (and coroutine and
  2868. async generator) objects as it is redundant. The frame already includes a
  2869. reference to the code object.
  2870. - gh-issue-98627: When an interpreter is configured to check (and only
  2871. then), importing an extension module will now fail when the extension does
  2872. not support multiple interpreters (i.e. doesn't implement PEP 489
  2873. multi-phase init). This does not apply to the main interpreter, nor to
  2874. subinterpreters created with ``Py_NewInterpreter()``.
  2875. Library
  2876. -------
  2877. - gh-issue-102302: Micro-optimise hashing of :class:`inspect.Parameter`,
  2878. reducing the time it takes to hash an instance by around 40%.
  2879. - gh-issue-101979: Fix a bug where parentheses in the ``metavar`` argument
  2880. to :meth:`argparse.ArgumentParser.add_argument` were dropped. Patch by
  2881. Yeojin Kim.
  2882. - gh-issue-91038: :meth:`platform.platform` now has boolean default
  2883. arguments.
  2884. - gh-issue-81652: Add :const:`mmap.MAP_ALIGNED_SUPER` FreeBSD and
  2885. :const:`mmap.MAP_CONCEAL` OpenBSD constants to :mod:`mmap`. Patch by
  2886. Yeojin Kim.
  2887. - gh-issue-102179: Fix :func:`os.dup2` error message for negative fds.
  2888. - gh-issue-101961: For the binary mode, :func:`fileinput.hookcompressed`
  2889. doesn't set the ``encoding`` value even if the value is ``None``. Patch by
  2890. Gihwan Kim.
  2891. - gh-issue-101936: The default value of ``fp`` becomes :class:`io.BytesIO`
  2892. if :exc:`~urllib.error.HTTPError` is initialized without a designated
  2893. ``fp`` parameter. Patch by Long Vo.
  2894. - gh-issue-101566: In zipfile, sync Path with `zipp 3.14
  2895. <https://zipp.readthedocs.io/en/latest/history.html#v3-14-0>`_, including
  2896. fix for extractall on the underlying zipfile after being wrapped in
  2897. ``Path``.
  2898. - gh-issue-97930: Apply changes from `importlib_resources 5.12
  2899. <https://importlib-resources.readthedocs.io/en/latest/history.html#v5-12-0>`_,
  2900. including fix for ``MultiplexedPath`` to support directories in multiple
  2901. namespaces (python/importlib_resources#265).
  2902. - gh-issue-101997: Upgrade pip wheel bundled with ensurepip (pip 23.0.1)
  2903. - gh-issue-99108: The built-in extension modules for :mod:`hashlib` SHA2
  2904. algorithms, used when OpenSSL does not provide them, now live in a single
  2905. internal ``_sha2`` module instead of separate ``_sha256`` and ``_sha512``
  2906. modules.
  2907. - gh-issue-101892: Callable iterators no longer raise :class:`SystemError`
  2908. when the callable object exhausts the iterator but forgets to either
  2909. return a sentinel value or raise :class:`StopIteration`.
  2910. - gh-issue-87634: Remove locking behavior from
  2911. :func:`functools.cached_property`.
  2912. - gh-issue-97786: Fix potential undefined behaviour in corner cases of
  2913. floating-point-to-time conversions.
  2914. - gh-issue-101517: Fixed bug where :mod:`bdb` looks up the source line with
  2915. :mod:`linecache` with a ``lineno=None``, which causes it to fail with an
  2916. unhandled exception.
  2917. - gh-issue-101773: Optimize :class:`fractions.Fraction` for small
  2918. components. The private argument ``_normalize`` of the
  2919. :class:`fractions.Fraction` constructor has been removed.
  2920. - gh-issue-101693: In :meth:`sqlite3.Cursor.execute`,
  2921. :exc:`DeprecationWarning` is now emitted when :ref:`named placeholders
  2922. <sqlite3-placeholders>` are used together with parameters supplied as a
  2923. :term:`sequence` instead of as a :class:`dict`. Starting from Python 3.14,
  2924. using named placeholders with parameters supplied as a sequence will raise
  2925. a :exc:`~sqlite3.ProgrammingError`. Patch by Erlend E. Aasland.
  2926. - gh-issue-101446: Change repr of :class:`collections.OrderedDict` to use
  2927. regular dictionary formating instead of pairs of keys and values.
  2928. - gh-issue-101362: Speed up :class:`pathlib.PurePath` construction by
  2929. handling arguments more uniformly. When a :class:`pathlib.Path` argument
  2930. is supplied, we use its string representation rather than joining its
  2931. parts with :func:`os.path.join`.
  2932. - gh-issue-101362: Speed up :class:`pathlib.PurePath` construction by
  2933. calling :func:`os.path.join` only when two or more arguments are given.
  2934. - gh-issue-101362: Speed up :class:`pathlib.Path` construction by running
  2935. the path flavour compatibility check only when pathlib is imported.
  2936. - gh-issue-85984: Refactored the implementation of :func:`pty.fork` to use
  2937. :func:`os.login_tty`.
  2938. A :exc:`DeprecationWarning` is now raised by ``pty.master_open()`` and
  2939. ``pty.slave_open()``. They were undocumented and deprecated long long ago
  2940. in the docstring in favor of :func:`pty.openpty`.
  2941. - gh-issue-101561: Add a new decorator :func:`typing.override`. See
  2942. :pep:`698` for details. Patch by Steven Troxler.
  2943. - gh-issue-63301: Set exit code when :mod:`tabnanny` CLI exits on error.
  2944. - gh-issue-101360: Fix anchor matching in
  2945. :meth:`pathlib.PureWindowsPath.match`. Path and pattern anchors are now
  2946. matched with :mod:`fnmatch`, just like other path parts. This allows
  2947. patterns such as ``"*:/Users/*"`` to be matched.
  2948. - gh-issue-101277: Remove global state from :mod:`itertools` module
  2949. (:pep:`687`). Patches by Erlend E. Aasland.
  2950. - gh-issue-100809: Fix handling of drive-relative paths (like 'C:' and
  2951. 'C:foo') in :meth:`pathlib.Path.absolute`. This method now uses the OS API
  2952. to retrieve the correct current working directory for the drive.
  2953. - gh-issue-99138: Apply :pep:`687` to :mod:`zoneinfo`. Patch by Erlend E.
  2954. Aasland.
  2955. - gh-issue-96764: :func:`asyncio.wait_for` now uses :func:`asyncio.timeout`
  2956. as its underlying implementation. Patch by Kumar Aditya.
  2957. - gh-issue-88233: Correctly preserve "extra" fields in ``zipfile``
  2958. regardless of their ordering relative to a zip64 "extra."
  2959. - bpo-23224: Fix segfaults when creating :class:`lzma.LZMADecompressor` and
  2960. :class:`bz2.BZ2Decompressor` objects without calling ``__init__()``, and
  2961. fix leakage of locks and internal buffers when calling the ``__init__()``
  2962. methods of :class:`lzma.LZMADecompressor`, :class:`lzma.LZMACompressor`,
  2963. :class:`bz2.BZ2Compressor`, and :class:`bz2.BZ2Decompressor` objects
  2964. multiple times.
  2965. Documentation
  2966. -------------
  2967. - gh-issue-85417: Update :mod:`cmath` documentation to clarify behaviour on
  2968. branch cuts.
  2969. - gh-issue-97725: Fix :meth:`asyncio.Task.print_stack` description for
  2970. ``file=None``. Patch by Oleg Iarygin.
  2971. Tests
  2972. -----
  2973. - gh-issue-102019: Fix deadlock on shutdown if
  2974. ``test_current_{exception,frames}`` fails. Patch by Jacob Bower.
  2975. - gh-issue-85984: Utilize new "winsize" functions from termios in pty tests.
  2976. - gh-issue-89792: ``test_tools`` now copies up to 10x less source data to a
  2977. temporary directory during the ``freeze`` test by ignoring git metadata
  2978. and other artifacts. It also limits its python build parallelism based on
  2979. os.cpu_count instead of hard coding it as 8 cores.
  2980. Build
  2981. -----
  2982. - gh-issue-99942: On Android, in a static build, python-config in embed mode
  2983. no longer incorrectly reports a library to link to.
  2984. - gh-issue-99942: On Android, python.pc now correctly reports the library to
  2985. link to, the same as python-config.sh.
  2986. - gh-issue-100221: Fix creating install directories in ``make
  2987. sharedinstall`` if they exist outside ``DESTDIR`` already.
  2988. - gh-issue-96821: Explicitly mark C extension modules that need defined
  2989. signed integer overflow, and add a configure option
  2990. :option:`--with-strict-overflow`. Patch by Matthias Görgens and Shantanu
  2991. Jain.
  2992. Windows
  2993. -------
  2994. - gh-issue-102344: Implement ``winreg.QueryValue`` using ``QueryValueEx``
  2995. and ``winreg.SetValue`` using ``SetValueEx``. Patch by Max Bachmann.
  2996. - gh-issue-101881: Handle read and write operations on non-blocking pipes
  2997. properly on Windows.
  2998. - gh-issue-101881: Add support for the os.get_blocking() and
  2999. os.set_blocking() functions on Windows.
  3000. - gh-issue-101849: Ensures installer will correctly upgrade existing
  3001. ``py.exe`` launcher installs.
  3002. - gh-issue-101763: Updates copy of libffi bundled with Windows installs to
  3003. 3.4.4.
  3004. - gh-issue-101759: Update Windows installer to SQLite 3.40.1.
  3005. - gh-issue-101614: Correctly handle extensions built against debug binaries
  3006. that reference ``python3_d.dll``.
  3007. - gh-issue-101196: The functions ``os.path.isdir``, ``os.path.isfile``,
  3008. ``os.path.islink`` and ``os.path.exists`` are now 13% to 28% faster on
  3009. Windows, by making fewer Win32 API calls.
  3010. macOS
  3011. -----
  3012. - gh-issue-101759: Update macOS installer to SQLite 3.40.1.
  3013. C API
  3014. -----
  3015. - gh-issue-101907: Removes use of non-standard C++ extension in public
  3016. header files.
  3017. - gh-issue-99293: Document that the Py_TPFLAGS_VALID_VERSION_TAG is an
  3018. internal feature, should not be used, and will be removed.
  3019. - gh-issue-101578: Add :c:func:`PyErr_GetRaisedException` and
  3020. :c:func:`PyErr_SetRaisedException` for saving and restoring the current
  3021. exception. These functions return and accept a single exception object,
  3022. rather than the triple arguments of the now-deprecated
  3023. :c:func:`PyErr_Fetch` and :c:func:`PyErr_Restore`. This is less error
  3024. prone and a bit more efficient.
  3025. Add :c:func:`PyException_GetArgs` and :c:func:`PyException_SetArgs` as
  3026. convenience functions for retrieving and modifying the
  3027. :attr:`~BaseException.args` passed to the exception's constructor.
  3028. - gh-issue-91744: Introduced the *Unstable C API tier*, marking APi that is
  3029. allowed to change in minor releases without a deprecation period. See
  3030. :pep:`689` for details.
  3031. What's New in Python 3.12.0 alpha 5?
  3032. ====================================
  3033. *Release date: 2023-02-07*
  3034. Security
  3035. --------
  3036. - gh-issue-99108: Replace the builtin :mod:`hashlib` implementations of
  3037. SHA2-224 and SHA2-256 originally from LibTomCrypt with formally verified,
  3038. side-channel resistant code from the `HACL*
  3039. <https://github.com/hacl-star/hacl-star/>`_ project. The builtins remain a
  3040. fallback only used when OpenSSL does not provide them.
  3041. Core and Builtins
  3042. -----------------
  3043. - gh-issue-92173: Fix the ``defs`` and ``kwdefs`` arguments to
  3044. :c:func:`PyEval_EvalCodeEx` and a reference leak in that function.
  3045. - gh-issue-59956: The GILState API is now partially compatible with
  3046. subinterpreters. Previously, ``PyThreadState_GET()`` and
  3047. ``PyGILState_GetThisThreadState()`` would get out of sync, causing
  3048. inconsistent behavior and crashes.
  3049. - gh-issue-101400: Fix wrong lineno in exception message on
  3050. :keyword:`continue` or :keyword:`break` which are not in a loop. Patch by
  3051. Donghee Na.
  3052. - gh-issue-101372: Fix :func:`~unicodedata.is_normalized` to properly handle
  3053. the UCD 3.2.0 cases. Patch by Donghee Na.
  3054. - gh-issue-101266: Fix :func:`sys.getsizeof` reporting for :class:`int`
  3055. subclasses.
  3056. - gh-issue-101291: Refactor the ``PyLongObject`` struct into a normal Python
  3057. object header and a ``PyLongValue`` struct.
  3058. - gh-issue-101046: Fix a possible memory leak in the parser when raising
  3059. :exc:`MemoryError`. Patch by Pablo Galindo
  3060. - gh-issue-101037: Fix potential memory underallocation issue for instances
  3061. of :class:`int` subclasses with value zero.
  3062. - gh-issue-100762: Record the (virtual) exception block depth in the oparg
  3063. of :opcode:`YIELD_VALUE`. Use this to avoid the expensive ``throw()`` when
  3064. closing generators (and coroutines) that can be closed trivially.
  3065. - gh-issue-100982: Adds a new :opcode:`COMPARE_AND_BRANCH` instruction. This
  3066. is a bit more efficient when performing a comparison immediately followed
  3067. by a branch, and restores the design intent of PEP 659 that
  3068. specializations are local to a single instruction.
  3069. - gh-issue-100942: Fixed segfault in property.getter/setter/deleter that
  3070. occurred when a property subclass overrode the ``__new__`` method to
  3071. return a non-property instance.
  3072. - gh-issue-100923: Remove the ``mask`` cache entry for the
  3073. :opcode:`COMPARE_OP` instruction and embed the mask into the oparg.
  3074. - gh-issue-100892: Fix race while iterating over thread states in clearing
  3075. :class:`threading.local`. Patch by Kumar Aditya.
  3076. - gh-issue-91351: Fix a case where re-entrant imports could corrupt the
  3077. import deadlock detection code and cause a :exc:`KeyError` to be raised
  3078. out of :mod:`importlib/_bootstrap`. In addition to the straightforward
  3079. cases, this could also happen when garbage collection leads to a warning
  3080. being emitted -- as happens when it collects an open socket or file)
  3081. - gh-issue-100726: Optimize construction of ``range`` object for medium size
  3082. integers.
  3083. - gh-issue-100712: Added option to build cpython with specialization
  3084. disabled, by setting ``ENABLE_SPECIALIZATION=False`` in :mod:`opcode`,
  3085. followed by ``make regen-all``.
  3086. - bpo-32780: Inter-field padding is now inserted into the PEP3118 format
  3087. strings obtained from :class:`ctypes.Structure` objects, reflecting their
  3088. true representation in memory.
  3089. Library
  3090. -------
  3091. - gh-issue-101541: [Enum] - fix psuedo-flag creation
  3092. - gh-issue-101570: Upgrade pip wheel bundled with ensurepip (pip 23.0)
  3093. - gh-issue-101323: Fix a bug where errors where not thrown by
  3094. zlib._ZlibDecompressor if encountered during decompressing.
  3095. - gh-issue-101317: Add *ssl_shutdown_timeout* parameter for
  3096. :meth:`asyncio.StreamWriter.start_tls`.
  3097. - gh-issue-101326: Fix regression when passing ``None`` as second or third
  3098. argument to ``FutureIter.throw``.
  3099. - gh-issue-92123: Adapt the ``_elementtree`` extension module to multi-phase
  3100. init (:pep:`489`). Patches by Erlend E. Aasland.
  3101. - gh-issue-100795: Avoid potential unexpected ``freeaddrinfo`` call (double
  3102. free) in :mod:`socket` when when a libc ``getaddrinfo()`` implementation
  3103. leaves garbage in an output pointer when returning an error. Original
  3104. patch by Sergey G. Brester.
  3105. - gh-issue-101143: Remove unused references to :class:`~asyncio.TimerHandle`
  3106. in ``asyncio.base_events.BaseEventLoop._add_callback``.
  3107. - gh-issue-101144: Make :func:`zipfile.Path.open` and
  3108. :func:`zipfile.Path.read_text` also accept ``encoding`` as a positional
  3109. argument. This was the behavior in Python 3.9 and earlier. 3.10
  3110. introduced a regression where supplying it as a positional argument would
  3111. lead to a :exc:`TypeError`.
  3112. - gh-issue-94518: Group-related variables of ``_posixsubprocess`` module are
  3113. renamed to stress that supplimentary group affinity is added to a fork,
  3114. not replace the inherited ones. Patch by Oleg Iarygin.
  3115. - gh-issue-101015: Fix :func:`typing.get_type_hints` on ``'*tuple[...]'``
  3116. and ``*tuple[...]``. It must not drop the ``Unpack`` part.
  3117. - gh-issue-101000: Add :func:`os.path.splitroot()`, which splits a path into
  3118. a 3-item tuple ``(drive, root, tail)``. This new function is used by
  3119. :mod:`pathlib` to improve the performance of path construction by up to a
  3120. third.
  3121. - gh-issue-100573: Fix a Windows :mod:`asyncio` bug with named pipes where a
  3122. client doing ``os.stat()`` on the pipe would cause an error in the server
  3123. that disabled serving future requests.
  3124. - gh-issue-39615: :func:`warnings.warn` now has the ability to skip stack
  3125. frames based on code filename prefix rather than only a numeric
  3126. ``stacklevel`` via the new ``skip_file_prefixes`` keyword argument.
  3127. - gh-issue-100750: pass encoding kwarg to subprocess in platform
  3128. - gh-issue-100160: Emit a deprecation warning in
  3129. :meth:`asyncio.DefaultEventLoopPolicy.get_event_loop` if there is no
  3130. current event loop set and it decides to create one.
  3131. - gh-issue-96290: Fix handling of partial and invalid UNC drives in
  3132. ``ntpath.splitdrive()``, and in ``ntpath.normpath()`` on non-Windows
  3133. systems. Paths such as '\\server' and '\\' are now considered by
  3134. ``splitdrive()`` to contain only a drive, and consequently are not
  3135. modified by ``normpath()`` on non-Windows systems. The behaviour of
  3136. ``normpath()`` on Windows systems is unaffected, as native OS APIs are
  3137. used. Patch by Eryk Sun, with contributions by Barney Gale.
  3138. - gh-issue-99952: Fix a reference undercounting issue in
  3139. :class:`ctypes.Structure` with ``from_param()`` results larger than a C
  3140. pointer.
  3141. - gh-issue-67790: Add float-style formatting support for
  3142. :class:`fractions.Fraction` instances.
  3143. - gh-issue-99266: Preserve more detailed error messages in :mod:`ctypes`.
  3144. - gh-issue-86682: Ensure runtime-created collections have the correct module
  3145. name using the newly added (internal) :func:`sys._getframemodulename`.
  3146. - gh-issue-88597: :mod:`uuid` now has a command line interface. Try ``python
  3147. -m uuid -h``.
  3148. - gh-issue-60580: :data:`ctypes.wintypes.BYTE` definition changed from
  3149. :data:`~ctypes.c_byte` to :data:`~ctypes.c_ubyte` to match Windows SDK.
  3150. Patch by Anatoly Techtonik and Oleg Iarygin.
  3151. - gh-issue-94518: ``_posixsubprocess`` now initializes all UID and GID
  3152. variables using a reserved ``-1`` value instead of a separate flag. Patch
  3153. by Oleg Iarygin.
  3154. - bpo-38941: The :mod:`xml.etree.ElementTree` module now emits
  3155. :exc:`DeprecationWarning` when testing the truth value of an
  3156. :class:`xml.etree.ElementTree.Element`. Before, the Python implementation
  3157. emitted :exc:`FutureWarning`, and the C implementation emitted nothing.
  3158. - bpo-40077: Convert :mod:`elementtree` types to heap types. Patch by Erlend
  3159. E. Aasland.
  3160. - bpo-29847: Fix a bug where :class:`pathlib.Path` accepted and ignored
  3161. keyword arguments. Patch provided by Yurii Karabas.
  3162. - gh-issue-77772: :class:`ctypes.CDLL`, :class:`ctypes.OleDLL`,
  3163. :class:`ctypes.WinDLL`, and :class:`ctypes.PyDLL` now accept
  3164. :term:`path-like objects <path-like object>` as their ``name`` argument.
  3165. Patch by Robert Hoelzl.
  3166. Documentation
  3167. -------------
  3168. - gh-issue-88324: Reword :mod:`subprocess` to emphasize default behavior of
  3169. *stdin*, *stdout*, and *stderr* arguments. Remove inaccurate statement
  3170. about child file handle inheritance.
  3171. Tests
  3172. -----
  3173. - gh-issue-101334: ``test_tarfile`` has been updated to pass when run as a
  3174. high UID.
  3175. Build
  3176. -----
  3177. - gh-issue-101282: Update BOLT configration not to use depreacted usage of
  3178. ``--split functions``. Patch by Donghee Na.
  3179. - gh-issue-101522: Allow overriding Windows dependencies versions and paths
  3180. using MSBuild properties.
  3181. - gh-issue-77532: Minor fixes to allow building with
  3182. ``PlatformToolset=ClangCL`` on Windows.
  3183. - gh-issue-101152: In accordance with :PEP:`699`, the ``ma_version_tag``
  3184. field in :c:type:`PyDictObject` is deprecated for extension modules.
  3185. Accessing this field will generate a compiler warning at compile time.
  3186. This field will be removed in Python 3.14.
  3187. - gh-issue-100340: Allows -Wno-int-conversion for wasm-sdk 17 and onwards,
  3188. thus enables building WASI builds once against the latest sdk.
  3189. - gh-issue-101060: Conditionally add ``-fno-reorder-blocks-and-partition``
  3190. in configure. Effectively fixes ``--enable-bolt`` when using Clang, as
  3191. this appears to be a GCC-only flag.
  3192. - gh-issue-98705: ``__bool__`` is defined in AIX system header files which
  3193. breaks the build in AIX, so undefine it.
  3194. - gh-issue-98636: Fix a regression in detecting ``gdbm_compat`` library for
  3195. the ``_gdbm`` module build.
  3196. - gh-issue-96305: ``_aix_support`` now uses a simple code to get platform
  3197. details rather than the now non-existent ``_bootsubprocess`` during
  3198. bootstrap.
  3199. Windows
  3200. -------
  3201. - gh-issue-101543: Ensure the install path in the registry is only used when
  3202. the standard library hasn't been located in any other way.
  3203. - gh-issue-101467: The ``py.exe`` launcher now correctly filters when only a
  3204. single runtime is installed. It also correctly handles prefix matches on
  3205. tags so that ``-3.1`` does not match ``3.11``, but would still match
  3206. ``3.1-32``.
  3207. - gh-issue-99834: Updates bundled copy of Tcl/Tk to 8.6.13.0
  3208. - gh-issue-101135: Restore ability to launch older 32-bit versions from the
  3209. :file:`py.exe` launcher when both 32-bit and 64-bit installs of the same
  3210. version are available.
  3211. - gh-issue-82052: Fixed an issue where writing more than 32K of Unicode
  3212. output to the console screen in one go can result in mojibake.
  3213. - gh-issue-100320: Ensures the ``PythonPath`` registry key from an install
  3214. is used when launching from a different copy of Python that relies on an
  3215. existing install to provide a copy of its modules and standard library.
  3216. - gh-issue-100247: Restores support for the :file:`py.exe` launcher finding
  3217. shebang commands in its configuration file using the full command name.
  3218. What's New in Python 3.12.0 alpha 4?
  3219. ====================================
  3220. *Release date: 2023-01-10*
  3221. Core and Builtins
  3222. -----------------
  3223. - gh-issue-100776: Fix misleading default value in :func:`input`'s
  3224. ``__text_signature__``.
  3225. - gh-issue-99005: Remove :opcode:`!UNARY_POSITIVE`,
  3226. :opcode:`!ASYNC_GEN_WRAP` and :opcode:`!LIST_TO_TUPLE`, replacing them
  3227. with intrinsics.
  3228. - gh-issue-99005: Add new :opcode:`CALL_INTRINSIC_1` instruction. Remove
  3229. :opcode:`IMPORT_STAR`, :opcode:`PRINT_EXPR` and
  3230. :opcode:`STOPITERATION_ERROR`, replacing them with the
  3231. :opcode:`CALL_INTRINSIC_1` instruction.
  3232. - gh-issue-100288: Remove the LOAD_ATTR_METHOD_WITH_DICT specialized
  3233. instruction. Stats show it is not useful.
  3234. - gh-issue-100720: Added ``_PyFrame_NumSlotsForCodeObject``, which returns
  3235. the number of slots needed in a frame for a given code object.
  3236. - gh-issue-100719: Removed the co_nplaincellvars field from the code object,
  3237. as it is redundant.
  3238. - gh-issue-100637: Fix :func:`int.__sizeof__` calculation to include the 1
  3239. element ob_digit array for 0 and False.
  3240. - gh-issue-100649: Update the native_thread_id field of PyThreadState after
  3241. fork.
  3242. - gh-issue-100126: Fix an issue where "incomplete" frames could be briefly
  3243. visible to C code while other frames are being torn down, possibly
  3244. resulting in corruption or hard crashes of the interpreter while running
  3245. finalizers.
  3246. - gh-issue-87447: Fix :exc:`SyntaxError` on comprehension rebind checking
  3247. with names that are not actually redefined.
  3248. Now reassigning ``b`` in ``[(b := 1) for a, b.prop in some_iter]`` is
  3249. allowed. Reassigning ``a`` is still disallowed as per :pep:`572`.
  3250. - gh-issue-100268: Add :meth:`int.is_integer` to improve duck type
  3251. compatibility between :class:`int` and :class:`float`.
  3252. - gh-issue-100425: Improve the accuracy of ``sum()`` with compensated
  3253. summation.
  3254. - gh-issue-100374: Fix incorrect result and delay in :func:`socket.getfqdn`.
  3255. Patch by Dominic Socular.
  3256. - gh-issue-100357: Convert ``vars``, ``dir``, ``next``, ``getattr``, and
  3257. ``iter`` to argument clinic.
  3258. - gh-issue-100117: Improve the output of :meth:`codeobject.co_lines` by
  3259. emitting only one entry for each line range.
  3260. - gh-issue-90043: Handle NaNs when specializing :opcode:`COMPARE_OP` for
  3261. :class:`float` values.
  3262. - gh-issue-100222: Redefine the ``_Py_CODEUNIT`` typedef as a union to
  3263. describe its layout to the C compiler, avoiding type punning and improving
  3264. clarity.
  3265. - gh-issue-99955: Internal compiler functions (in compile.c) now
  3266. consistently return -1 on error and 0 on success.
  3267. - gh-issue-100188: The ``BINARY_SUBSCR_LIST_INT`` and
  3268. ``BINARY_SUBSCR_TUPLE_INT`` instructions are no longer used for negative
  3269. integers because those instructions always miss when encountering negative
  3270. integers.
  3271. - gh-issue-99110: Initialize frame->previous in frameobject.c to fix a
  3272. segmentation fault when accessing frames created by :c:func:`PyFrame_New`.
  3273. - gh-issue-94155: Improved the hashing algorithm for code objects,
  3274. mitigating some hash collisions.
  3275. - gh-issue-99540: ``None`` now hashes to a constant value. This is not a
  3276. requirements change.
  3277. - gh-issue-100143: When built with ``--enable-pystats``, stats collection is
  3278. now off by default. To enable it early at startup, pass the ``-Xpystats``
  3279. flag. Stats are now always dumped, even if switched off.
  3280. - gh-issue-100146: Improve ``BUILD_LIST`` opcode so that it works similarly
  3281. to the ``BUILD_TUPLE`` opcode, by stealing references from the stack
  3282. rather than repeatedly using stack operations to set list elements.
  3283. Implementation details are in a new private API
  3284. :c:func:`_PyList_FromArraySteal`.
  3285. - gh-issue-100110: Specialize ``FOR_ITER`` for tuples.
  3286. - gh-issue-100050: Honor existing errors obtained when searching for
  3287. mismatching parentheses in the tokenizer. Patch by Pablo Galindo
  3288. - gh-issue-92216: Improve the performance of :func:`hasattr` for type
  3289. objects with a missing attribute.
  3290. - gh-issue-99582: Freeze :mod:`zipimport` module into ``_bootstrap_python``.
  3291. - gh-issue-99554: Pack debugging location tables more efficiently during
  3292. bytecode compilation.
  3293. - gh-issue-98522: Add an internal version number to code objects, to give
  3294. better versioning of inner functions and comprehensions, and thus better
  3295. specialization of those functions. This change is invisible to both Python
  3296. and C extensions.
  3297. - gh-issue-94603: Improve performance of ``list.pop`` for small lists.
  3298. - gh-issue-89051: Add :const:`ssl.OP_LEGACY_SERVER_CONNECT`
  3299. - bpo-32782: ``ctypes`` arrays of length 0 now report a correct itemsize
  3300. when a ``memoryview`` is constructed from them, rather than always giving
  3301. a value of 0.
  3302. Library
  3303. -------
  3304. - gh-issue-100833: Speed up :func:`math.fsum` by removing defensive
  3305. ``volatile`` qualifiers.
  3306. - gh-issue-100805: Modify :func:`random.choice` implementation to once again
  3307. work with NumPy arrays.
  3308. - gh-issue-100813: Add :const:`socket.IP_PKTINFO` constant.
  3309. - gh-issue-100792: Make :meth:`email.message.Message.__contains__` twice as
  3310. fast.
  3311. - gh-issue-91851: Microoptimizations for
  3312. :meth:`fractions.Fraction.__round__`, :meth:`fractions.Fraction.__ceil__`
  3313. and :meth:`fractions.Fraction.__floor__`.
  3314. - gh-issue-90104: Avoid RecursionError on ``repr`` if a dataclass field
  3315. definition has a cyclic reference.
  3316. - gh-issue-100689: Fix crash in :mod:`pyexpat` by statically allocating
  3317. ``PyExpat_CAPI`` capsule.
  3318. - gh-issue-100740: Fix ``unittest.mock.Mock`` not respecting the spec for
  3319. attribute names prefixed with ``assert``.
  3320. - gh-issue-91219: Change ``SimpleHTTPRequestHandler`` to support subclassing
  3321. to provide a different set of index file names instead of using
  3322. ``__init__`` parameters.
  3323. - gh-issue-100690: ``Mock`` objects which are not unsafe will now raise an
  3324. ``AttributeError`` when accessing an attribute that matches the name of an
  3325. assertion but without the prefix ``assert_``, e.g. accessing
  3326. ``called_once`` instead of ``assert_called_once``. This is in addition to
  3327. this already happening for accessing attributes with prefixes ``assert``,
  3328. ``assret``, ``asert``, ``aseert``, and ``assrt``.
  3329. - gh-issue-89727: Simplify and optimize :func:`os.walk` by using
  3330. :func:`isinstance` checks to check the top of the stack.
  3331. - gh-issue-100485: Add math.sumprod() to compute the sum of products.
  3332. - gh-issue-86508: Fix :func:`asyncio.open_connection` to skip binding to
  3333. local addresses of different family. Patch by Kumar Aditya.
  3334. - gh-issue-97930: ``importlib.resources.files`` now accepts a module as an
  3335. anchor instead of only accepting packages. If a module is passed,
  3336. resources are resolved adjacent to that module (in the same package or at
  3337. the package root). The parameter was renamed from ``package`` to
  3338. ``anchor`` with a compatibility shim for those passing by keyword.
  3339. Additionally, the new ``anchor`` parameter is now optional and will
  3340. default to the caller's module.
  3341. - gh-issue-100585: Fixed a bug where importlib.resources.as_file was leaving
  3342. file pointers open
  3343. - gh-issue-100562: Improve performance of :meth:`pathlib.Path.absolute` by
  3344. nearly 2x. This comes at the cost of a performance regression in
  3345. :meth:`pathlib.Path.cwd`, which is generally used less frequently in user
  3346. code.
  3347. - gh-issue-100519: Small simplification of
  3348. :func:`http.cookiejar.eff_request_host` that improves readability and
  3349. better matches the RFC wording.
  3350. - gh-issue-100287: Fix the interaction of :func:`unittest.mock.seal` with
  3351. :class:`unittest.mock.AsyncMock`.
  3352. - gh-issue-100488: Add :meth:`Fraction.is_integer` to check whether a
  3353. :class:`fractions.Fraction` is an integer. This improves duck type
  3354. compatibility with :class:`float` and :class:`int`.
  3355. - gh-issue-100474: :mod:`http.server` now checks that an index page is
  3356. actually a regular file before trying to serve it. This avoids issues
  3357. with directories named ``index.html``.
  3358. - gh-issue-100363: Speed up :func:`asyncio.get_running_loop` by removing
  3359. redundant ``getpid`` checks. Patch by Kumar Aditya.
  3360. - gh-issue-78878: Fix crash when creating an instance of
  3361. :class:`!_ctypes.CField`.
  3362. - gh-issue-100348: Fix ref cycle in
  3363. :class:`!asyncio._SelectorSocketTransport` by removing ``_read_ready_cb``
  3364. in ``close``.
  3365. - gh-issue-100344: Provide C implementation for :func:`asyncio.current_task`
  3366. for a 4x-6x speedup.
  3367. - gh-issue-100272: Fix JSON serialization of OrderedDict. It now preserves
  3368. the order of keys.
  3369. - gh-issue-83076: Instantiation of ``Mock()`` and ``AsyncMock()`` is now
  3370. 3.8x faster.
  3371. - gh-issue-100234: Set a default value of 1.0 for the ``lambd`` parameter in
  3372. random.expovariate().
  3373. - gh-issue-100228: A :exc:`DeprecationWarning` may be raised when
  3374. :func:`os.fork()` or :func:`os.forkpty()` is called from multi-threaded
  3375. processes. Forking with threads is unsafe and can cause deadlocks,
  3376. crashes and subtle problems. Lack of a warning does not indicate that the
  3377. fork call was actually safe, as Python may not be aware of all threads.
  3378. - gh-issue-100039: Improve signatures for enums and flags.
  3379. - gh-issue-100133: Fix regression in :mod:`asyncio` where a subprocess would
  3380. sometimes lose data received from pipe.
  3381. - bpo-44592: Fixes inconsistent handling of case sensitivity of
  3382. *extrasaction* arg in :class:`csv.DictWriter`.
  3383. - gh-issue-100098: Fix ``tuple`` subclasses being cast to ``tuple`` when
  3384. used as enum values.
  3385. - gh-issue-85432: Rename the *fmt* parameter of the pure-Python
  3386. implementation of :meth:`datetime.time.strftime` to *format*. Rename the
  3387. *t* parameter of :meth:`datetime.datetime.fromtimestamp` to *timestamp*.
  3388. These changes mean the parameter names in the pure-Python implementation
  3389. now match the parameter names in the C implementation. Patch by Alex
  3390. Waygood.
  3391. - gh-issue-98778: Update :exc:`~urllib.error.HTTPError` to be initialized
  3392. properly, even if the ``fp`` is ``None``. Patch by Donghee Na.
  3393. - gh-issue-99925: Unify error messages in JSON serialization between
  3394. ``json.dumps(float('nan'), allow_nan=False)`` and
  3395. ``json.dumps(float('nan'), allow_nan=False, indent=<SOMETHING>)``. Now
  3396. both include the representation of the value that could not be serialized.
  3397. - gh-issue-89727: Fix issue with :func:`os.walk` where a
  3398. :exc:`RecursionError` would occur on deep directory structures by
  3399. adjusting the implementation of :func:`os.walk` to be iterative instead of
  3400. recursive.
  3401. - gh-issue-94943: Add :ref:`enum-dataclass-support` to the
  3402. :class:`~enum.Enum` :meth:`~enum.Enum.__repr__`. When inheriting from a
  3403. :class:`~dataclasses.dataclass`, only show the field names in the value
  3404. section of the member :func:`repr`, and not the dataclass' class name.
  3405. - gh-issue-83035: Fix :func:`inspect.getsource` handling of decorator calls
  3406. with nested parentheses.
  3407. - gh-issue-99576: Fix ``.save()`` method for ``LWPCookieJar`` and
  3408. ``MozillaCookieJar``: saved file was not truncated on repeated save.
  3409. - gh-issue-94912: Add :func:`inspect.markcoroutinefunction` decorator which
  3410. manually marks a function as a coroutine for the benefit of
  3411. :func:`iscoroutinefunction`.
  3412. - gh-issue-99509: Add :pep:`585` support for
  3413. :class:`multiprocessing.queues.Queue`.
  3414. - gh-issue-99482: Remove ``Jython`` partial compatibility code from several
  3415. stdlib modules.
  3416. - gh-issue-99433: Fix :mod:`doctest` failure on
  3417. :class:`types.MethodWrapperType` in modules.
  3418. - gh-issue-85267: Several improvements to :func:`inspect.signature`'s
  3419. handling of ``__text_signature``. - Fixes a case where
  3420. :func:`inspect.signature` dropped parameters - Fixes a case where
  3421. :func:`inspect.signature` raised :exc:`tokenize.TokenError` - Allows
  3422. :func:`inspect.signature` to understand defaults involving binary
  3423. operations of constants - :func:`inspect.signature` is documented as only
  3424. raising :exc:`TypeError` or :exc:`ValueError`, but sometimes raised
  3425. :exc:`RuntimeError`. These cases now raise :exc:`ValueError` - Removed a
  3426. dead code path
  3427. - gh-issue-91166: :mod:`asyncio` is optimized to avoid excessive copying
  3428. when writing to socket and use :meth:`~socket.socket.sendmsg` if the
  3429. platform supports it. Patch by Kumar Aditya.
  3430. - gh-issue-98030: Add missing TCP socket options from Linux: ``TCP_MD5SIG``,
  3431. ``TCP_THIN_LINEAR_TIMEOUTS``, ``TCP_THIN_DUPACK``, ``TCP_REPAIR``,
  3432. ``TCP_REPAIR_QUEUE``, ``TCP_QUEUE_SEQ``, ``TCP_REPAIR_OPTIONS``,
  3433. ``TCP_TIMESTAMP``, ``TCP_CC_INFO``, ``TCP_SAVE_SYN``, ``TCP_SAVED_SYN``,
  3434. ``TCP_REPAIR_WINDOW``, ``TCP_FASTOPEN_CONNECT``, ``TCP_ULP``,
  3435. ``TCP_MD5SIG_EXT``, ``TCP_FASTOPEN_KEY``, ``TCP_FASTOPEN_NO_COOKIE``,
  3436. ``TCP_ZEROCOPY_RECEIVE``, ``TCP_INQ``, ``TCP_TX_DELAY``.
  3437. - gh-issue-88500: Reduced the memory usage of :func:`urllib.parse.unquote`
  3438. and :func:`urllib.parse.unquote_to_bytes` on large values.
  3439. - gh-issue-96127: ``inspect.signature`` was raising ``TypeError`` on call
  3440. with mock objects. Now it correctly returns ``(*args, **kwargs)`` as
  3441. infered signature.
  3442. - gh-issue-95882: Fix a 3.11 regression in
  3443. :func:`~contextlib.asynccontextmanager`, which caused it to propagate
  3444. exceptions with incorrect tracebacks and fix a 3.11 regression in
  3445. :func:`~contextlib.contextmanager`, which caused it to propagate
  3446. exceptions with incorrect tracebacks for :exc:`StopIteration`.
  3447. - gh-issue-78707: Deprecate passing more than one positional argument to
  3448. :meth:`pathlib.PurePath.relative_to` and
  3449. :meth:`~pathlib.PurePath.is_relative_to`.
  3450. - gh-issue-92122: Fix reStructuredText syntax errors in docstrings in the
  3451. :mod:`enum` module.
  3452. - gh-issue-91851: Optimize the :class:`~fractions.Fraction` arithmetics for
  3453. small components.
  3454. - bpo-24132: Make :class:`pathlib.PurePath` and :class:`~pathlib.Path`
  3455. subclassable (private to start). Previously, attempting to instantiate a
  3456. subclass resulted in an :exc:`AttributeError` being raised. Patch by
  3457. Barney Gale.
  3458. - bpo-40447: Accept :class:`os.PathLike` (such as :class:`pathlib.Path`) in
  3459. the ``stripdir`` arguments of :meth:`compileall.compile_file` and
  3460. :meth:`compileall.compile_dir`.
  3461. - bpo-36880: Fix a reference counting issue when a :mod:`ctypes` callback
  3462. with return type :class:`~ctypes.py_object` returns ``None``, which could
  3463. cause crashes.
  3464. Documentation
  3465. -------------
  3466. - gh-issue-100616: Document existing ``attr`` parameter to
  3467. :func:`curses.window.vline` function in :mod:`curses`.
  3468. - gh-issue-100472: Remove claim in documentation that the ``stripdir``,
  3469. ``prependdir`` and ``limit_sl_dest`` parameters of
  3470. :func:`compileall.compile_dir` and :func:`compileall.compile_file` could
  3471. be :class:`bytes`.
  3472. - bpo-25377: Clarify use of octal format of mode argument in help(os.chmod)
  3473. as well as help(os.fchmod)
  3474. Tests
  3475. -----
  3476. - gh-issue-100454: Start running SSL tests with OpenSSL 3.1.0-beta1.
  3477. - gh-issue-100086: The Python test runner (libregrtest) now logs Python
  3478. build information like "debug" vs "release" build, or LTO and PGO
  3479. optimizations. Patch by Victor Stinner.
  3480. - gh-issue-93018: Make two tests forgiving towards host system libexpat with
  3481. backported security fixes applied.
  3482. Build
  3483. -----
  3484. - gh-issue-100540: Removed the ``--with-system-ffi`` ``configure`` option;
  3485. ``libffi`` must now always be supplied by the system on all non-Windows
  3486. platforms. The option has had no effect on non-Darwin platforms for
  3487. several releases, and in 3.11 only had the non-obvious effect of invoking
  3488. ``pkg-config`` to find ``libffi`` and never setting
  3489. ``-DUSING_APPLE_OS_LIBFFI``. Now on Darwin platforms ``configure`` will
  3490. first check for the OS ``libffi`` and then fall back to the same
  3491. processing as other platforms if it is not found.
  3492. - gh-issue-88267: Avoid exporting Python symbols in linked Windows
  3493. applications when the core is built as static.
  3494. - bpo-41916: Allow override of ac_cv_cxx_thread so that cross compiled
  3495. python can set -pthread for CXX.
  3496. Windows
  3497. -------
  3498. - gh-issue-100180: Update Windows installer to OpenSSL 1.1.1s
  3499. - gh-issue-99191: Use ``_MSVC_LANG >= 202002L`` instead of less-precise
  3500. ``_MSC_VER >=1929`` to more accurately test for C++20 support in
  3501. :file:`PC/_wmimodule.cpp`.
  3502. - gh-issue-79218: Define ``MS_WIN64`` for Mingw-w64 64bit, fix cython
  3503. compilation failure.
  3504. - gh-issue-99941: Ensure that :func:`asyncio.Protocol.data_received`
  3505. receives an immutable :class:`bytes` object (as documented), instead of
  3506. :class:`bytearray`.
  3507. - bpo-43984: :meth:`winreg.SetValueEx` now leaves the target value untouched
  3508. in the case of conversion errors. Previously, ``-1`` would be written in
  3509. case of such errors.
  3510. - bpo-34816: ``hasattr(ctypes.windll, 'nonexistant')`` now returns ``False``
  3511. instead of raising :exc:`OSError`.
  3512. macOS
  3513. -----
  3514. - gh-issue-100180: Update macOS installer to OpenSSL 1.1.1s
  3515. - gh-issue-100540: Removed obsolete ``dlfcn.h`` shim from the ``_ctypes``
  3516. extension module, which has not been necessary since Mac OS X 10.2.
  3517. Tools/Demos
  3518. -----------
  3519. - bpo-45256: Fix a bug that caused an :exc:`AttributeError` to be raised in
  3520. ``python-gdb.py`` when ``py-locals`` is used without a frame.
  3521. - gh-issue-100342: Add missing ``NULL`` check for possible allocation
  3522. failure in ``*args`` parsing in Argument Clinic.
  3523. C API
  3524. -----
  3525. - gh-issue-99947: Raising SystemError on import will now have its cause be
  3526. set to the original unexpected exception.
  3527. - gh-issue-99240: In argument parsing, after deallocating newly allocated
  3528. memory, reset its pointer to NULL.
  3529. - gh-issue-98724: The :c:macro:`Py_CLEAR`, :c:macro:`Py_SETREF` and
  3530. :c:macro:`Py_XSETREF` macros now only evaluate their arguments once. If an
  3531. argument has side effects, these side effects are no longer duplicated.
  3532. Patch by Victor Stinner.
  3533. What's New in Python 3.12.0 alpha 3?
  3534. ====================================
  3535. *Release date: 2022-12-06*
  3536. Security
  3537. --------
  3538. - gh-issue-100001: ``python -m http.server`` no longer allows terminal
  3539. control characters sent within a garbage request to be printed to the
  3540. stderr server log.
  3541. This is done by changing the :mod:`http.server`
  3542. :class:`BaseHTTPRequestHandler` ``.log_message`` method to replace control
  3543. characters with a :samp:`\\x{HH}` hex escape before printing.
  3544. - gh-issue-87604: Avoid publishing list of active per-interpreter audit
  3545. hooks via the :mod:`gc` module
  3546. Core and Builtins
  3547. -----------------
  3548. - gh-issue-99891: Fix a bug in the tokenizer that could cause infinite
  3549. recursion when showing syntax warnings that happen in the first line of
  3550. the source. Patch by Pablo Galindo
  3551. - gh-issue-91054: Add :c:func:`PyCode_AddWatcher` and
  3552. :c:func:`PyCode_ClearWatcher` APIs to register callbacks to receive
  3553. notification on creation and destruction of code objects.
  3554. - gh-issue-99729: Fix an issue that could cause frames to be visible to
  3555. Python code as they are being torn down, possibly leading to memory
  3556. corruption or hard crashes of the interpreter.
  3557. - gh-issue-99708: Fix bug where compiler crashes on an if expression with an
  3558. empty body block.
  3559. - gh-issue-99578: Fix a reference bug in :func:`_imp.create_builtin()` after
  3560. the creation of the first sub-interpreter for modules ``builtins`` and
  3561. ``sys``. Patch by Victor Stinner.
  3562. - gh-issue-99581: Fixed a bug that was causing a buffer overflow if the
  3563. tokenizer copies a line missing the newline caracter from a file that is
  3564. as long as the available tokenizer buffer. Patch by Pablo galindo
  3565. - gh-issue-99553: Fix bug where an :exc:`ExceptionGroup` subclass can wrap a
  3566. :exc:`BaseException`.
  3567. - gh-issue-99547: Add a function to os.path to check if a path is a
  3568. junction: isjunction. Add similar functionality to pathlib.Path as
  3569. is_junction.
  3570. - gh-issue-99370: Fix zip path for venv created from a non-installed python
  3571. on POSIX platforms.
  3572. - gh-issue-99377: Add audit events for thread creation and clear operations.
  3573. - gh-issue-98686: Remove the ``BINARY_OP_GENERIC`` and
  3574. ``COMPARE_OP_GENERIC`` "specializations".
  3575. - gh-issue-99298: Remove the remaining error paths for attribute
  3576. specializations, and refuse to specialize attribute accesses on types that
  3577. haven't had :c:func:`PyType_Ready` called on them yet.
  3578. - gh-issue-99127: Allow some features of :mod:`syslog` to the main
  3579. interpreter only. Patch by Donghee Na.
  3580. - gh-issue-91053: Optimizing interpreters and JIT compilers may need to
  3581. invalidate internal metadata when functions are modified. This change adds
  3582. the ability to provide a callback that will be invoked each time a
  3583. function is created, modified, or destroyed.
  3584. - gh-issue-90994: Improve error messages when there's a syntax error with
  3585. call arguments. The following three cases are covered: - No value is
  3586. assigned to a named argument, eg ``foo(a=)``. - A value is assigned to a
  3587. star argument, eg ``foo(*args=[0])``. - A value is assigned to a
  3588. double-star keyword argument, eg ``foo(**kwarg={'a': 0})``.
  3589. - bpo-45026: Optimize the :class:`range` object iterator. It is now smaller,
  3590. faster iteration of ranges containing large numbers. Smaller pickles,
  3591. faster unpickling.
  3592. - bpo-31718: Raise :exc:`ValueError` instead of :exc:`SystemError` when
  3593. methods of uninitialized :class:`io.IncrementalNewlineDecoder` objects are
  3594. called. Patch by Oren Milman.
  3595. - bpo-38031: Fix a possible assertion failure in :class:`io.FileIO` when the
  3596. opener returns an invalid file descriptor.
  3597. Library
  3598. -------
  3599. - gh-issue-100001: Also \ escape \s in the http.server
  3600. BaseHTTPRequestHandler.log_message so that it is technically possible to
  3601. parse the line and reconstruct what the original data was. Without this a
  3602. \xHH is ambiguious as to if it is a hex replacement we put in or the
  3603. characters r"\x" came through in the original request line.
  3604. - gh-issue-99957: Add ``frozen_default`` parameter to
  3605. :func:`typing.dataclass_transform`.
  3606. - gh-issue-79033: Fix :func:`asyncio.Server.wait_closed` to actually do what
  3607. the docs promise -- wait for all existing connections to complete, after
  3608. closing the server.
  3609. - gh-issue-51524: Fix bug when calling trace.CoverageResults with valid
  3610. infile.
  3611. - gh-issue-99645: Fix a bug in handling class cleanups in
  3612. :class:`unittest.TestCase`. Now ``addClassCleanup()`` uses separate lists
  3613. for different ``TestCase`` subclasses, and ``doClassCleanups()`` only
  3614. cleans up the particular class.
  3615. - gh-issue-99508: Fix ``TypeError`` in
  3616. ``Lib/importlib/_bootstrap_external.py`` while calling
  3617. ``_imp.source_hash()``.
  3618. - gh-issue-66285: Fix :mod:`asyncio` to not share event loop and signal
  3619. wakeupfd in forked processes. Patch by Kumar Aditya.
  3620. - gh-issue-97001: Release the GIL when calling termios APIs to avoid
  3621. blocking threads.
  3622. - gh-issue-92647: Use final status of an enum to determine lookup or
  3623. creation branch of functional API.
  3624. - gh-issue-99388: Add *loop_factory* parameter to :func:`asyncio.run` to
  3625. allow specifying a custom event loop factory. Patch by Kumar Aditya.
  3626. - gh-issue-99341: Fix :func:`ast.increment_lineno` to also cover
  3627. :class:`ast.TypeIgnore` when changing line numbers.
  3628. - gh-issue-99382: Check the number of arguments in substitution in user
  3629. generics containing a :class:`~typing.TypeVarTuple` and one or more
  3630. :class:`~typing.TypeVar`.
  3631. - gh-issue-99379: Fix substitution of :class:`~typing.ParamSpec` followed by
  3632. :class:`~typing.TypeVarTuple` in generic aliases.
  3633. - gh-issue-99344: Fix substitution of :class:`~typing.TypeVarTuple` and
  3634. :class:`~typing.ParamSpec` together in user generics.
  3635. - gh-issue-99284: Remove ``_use_broken_old_ctypes_structure_semantics_`` old
  3636. untested and undocumented hack from :mod:`ctypes`.
  3637. - gh-issue-99201: Fix :exc:`IndexError` when initializing the config
  3638. variables on Windows if ``HAVE_DYNAMIC_LOADING`` is not set.
  3639. - gh-issue-99240: Fix double-free bug in Argument Clinic ``str_converter``
  3640. by extracting memory clean up to a new ``post_parsing`` section.
  3641. - gh-issue-64490: Fix refcount error when arguments are packed to tuple in
  3642. Argument Clinic.
  3643. - gh-issue-99029: :meth:`pathlib.PurePath.relative_to()` now treats naked
  3644. Windows drive paths as relative. This brings its behaviour in line with
  3645. other parts of pathlib.
  3646. - gh-issue-98253: The implementation of the typing module is now more
  3647. resilient to reference leaks in binary extension modules.
  3648. Previously, a reference leak in a typed C API-based extension module could
  3649. leak internals of the typing module, which could in turn introduce leaks
  3650. in essentially any other package with typed function signatures. Although
  3651. the typing package is not the original source of the problem, such
  3652. non-local dependences exacerbate debugging of large-scale projects, and
  3653. the implementation was therefore changed to reduce harm by providing
  3654. better isolation.
  3655. - gh-issue-98458: Fix infinite loop in unittest when a self-referencing
  3656. chained exception is raised
  3657. - gh-issue-93453: :func:`asyncio.get_event_loop` and many other
  3658. :mod:`asyncio` functions like :func:`asyncio.ensure_future`,
  3659. :func:`asyncio.shield` or :func:`asyncio.gather`, and also the
  3660. :meth:`~asyncio.BaseDefaultEventLoopPolicy.get_event_loop` method of
  3661. :class:`asyncio.BaseDefaultEventLoopPolicy` now raise a
  3662. :exc:`RuntimeError` if called when there is no running event loop and the
  3663. current event loop was not set. Previously they implicitly created and set
  3664. a new current event loop. :exc:`DeprecationWarning` is no longer emitted
  3665. if there is no running event loop but the current event loop was set.
  3666. - gh-issue-97966: On ``uname_result``, restored expectation that ``_fields``
  3667. and ``_asdict`` would include all six properties including ``processor``.
  3668. - gh-issue-98248: Provide informative error messages in :func:`struct.pack`
  3669. when its integral arguments are not in range.
  3670. - gh-issue-98108: ``zipfile.Path`` is now pickleable if its initialization
  3671. parameters were pickleable (e.g. for file system paths).
  3672. - gh-issue-98098: Created packages from zipfile and test_zipfile modules,
  3673. separating ``zipfile.Path`` functionality.
  3674. - gh-issue-82836: Fix :attr:`~ipaddress.IPv4Address.is_private` properties
  3675. in the :mod:`ipaddress` module. Previously non-private networks
  3676. (0.0.0.0/0) would return True from this method; now they correctly return
  3677. False.
  3678. - gh-issue-96828: Add an :const:`~ssl.OP_ENABLE_KTLS` option for enabling
  3679. the use of the kernel TLS (kTLS). Patch by Illia Volochii.
  3680. - gh-issue-88863: To avoid apparent memory leaks when
  3681. :func:`asyncio.open_connection` raises, break reference cycles generated
  3682. by local exception and future instances (which has exception instance as
  3683. its member var). Patch by Dong Uk, Kang.
  3684. - gh-issue-91078: :meth:`TarFile.next` now returns ``None`` when called on
  3685. an empty tarfile.
  3686. - bpo-47220: Document the optional *callback* parameter of
  3687. :class:`WeakMethod`. Patch by Géry Ogam.
  3688. - bpo-44817: Ignore WinError 53 (ERROR_BAD_NETPATH), 65
  3689. (ERROR_NETWORK_ACCESS_DENIED) and 161 (ERROR_BAD_PATHNAME) when using
  3690. ntpath.realpath().
  3691. - bpo-41260: Rename the *fmt* parameter of the pure Python implementation of
  3692. :meth:`datetime.date.strftime` to *format*.
  3693. - bpo-15999: All built-in functions now accept arguments of any type instead
  3694. of just ``bool`` and ``int`` for boolean parameters.
  3695. Documentation
  3696. -------------
  3697. - gh-issue-99931: Use `sphinxext-opengraph
  3698. <https://sphinxext-opengraph.readthedocs.io/>`__ to generate `OpenGraph
  3699. metadata <https://ogp.me/>`__.
  3700. - gh-issue-89682: Reworded docstring of the default ``__contains__`` to
  3701. clarify that it returns a :class:`bool`.
  3702. - gh-issue-88330: Improved the description of what a resource is in
  3703. importlib.resources docs.
  3704. - gh-issue-92892: Document that calling variadic functions with ctypes
  3705. requires special care on macOS/arm64 (and possibly other platforms).
  3706. - bpo-41825: Restructured the documentation for the :func:`os.wait*
  3707. <os.wait>` family of functions, and improved the docs for
  3708. :func:`os.waitid` with more explanation of the possible argument
  3709. constants.
  3710. Tests
  3711. -----
  3712. - gh-issue-99892: Skip test_normalization() of test_unicodedata if it fails
  3713. to download NormalizationTest.txt file from pythontest.net. Patch by
  3714. Victor Stinner.
  3715. - gh-issue-99934: Correct test_marsh on (32 bit) x86: test_deterministic
  3716. sets was failing.
  3717. - gh-issue-99741: We've implemented multi-phase init (PEP 489/630/687) for
  3718. the internal (for testing) _xxsubinterpreters module.
  3719. - gh-issue-99659: Optional big memory tests in ``test_sqlite3`` now catch
  3720. the correct :exc:`sqlite.DataError` exception type in case of too large
  3721. strings and/or blobs passed.
  3722. - gh-issue-99593: Cover the Unicode C API with tests.
  3723. - gh-issue-96002: Add functional test for Argument Clinic.
  3724. Build
  3725. -----
  3726. - gh-issue-99086: Fix ``-Wimplicit-int``, ``-Wstrict-prototypes``, and
  3727. ``-Wimplicit-function-declaration`` compiler warnings in
  3728. :program:`configure` checks.
  3729. - gh-issue-99337: Fix a compilation issue with GCC 12 on macOS.
  3730. - gh-issue-99289: Add a ``COMPILEALL_OPTS`` variable in Makefile to override
  3731. :mod:`compileall` options (default: ``-j0``) in ``make install``. Also
  3732. merged the ``compileall`` commands into a single command building .pyc
  3733. files for the all optimization levels (0, 1, 2) at once. Patch by Victor
  3734. Stinner.
  3735. - gh-issue-98872: Fix a possible fd leak in ``Programs/_freeze_module.c``
  3736. introduced in Python 3.11.
  3737. - gh-issue-88226: Always define ``TARGET_*`` labels in ``Python/ceval.c``,
  3738. even if ``USE_COMPUTED_GOTOS`` is disabled. This allows breakpoints to be
  3739. set at those labels in (for instance) ``gdb``.
  3740. Windows
  3741. -------
  3742. - gh-issue-99345: Use faster initialization functions to detect install
  3743. location for Windows Store package
  3744. - gh-issue-98629: Fix initialization of :data:`sys.version` and ``sys._git``
  3745. on Windows
  3746. - gh-issue-99442: Fix handling in :ref:`launcher` when ``argv[0]`` does not
  3747. include a file extension.
  3748. - bpo-40882: Fix a memory leak in
  3749. :class:`multiprocessing.shared_memory.SharedMemory` on Windows.
  3750. macOS
  3751. -----
  3752. - gh-issue-87235: On macOS ``python3 /dev/fd/9 9</path/to/script.py`` failed
  3753. for any script longer than a couple of bytes.
  3754. - gh-issue-98940: Fix ``Mac/Extras.install.py`` file filter bug.
  3755. Tools/Demos
  3756. -----------
  3757. - gh-issue-64490: Argument Clinic varargs bugfixes
  3758. * Fix out-of-bounds error in :c:func:`!_PyArg_UnpackKeywordsWithVararg`.
  3759. * Fix incorrect check which allowed more than one varargs in clinic.py.
  3760. * Fix miscalculation of ``noptargs`` in generated code.
  3761. * Do not generate ``noptargs`` when there is a vararg argument and no optional argument.
  3762. C API
  3763. -----
  3764. - gh-issue-98680: ``PyBUF_*`` constants were marked as part of Limited API
  3765. of Python 3.11+. These were available in 3.11.0 with
  3766. :c:macro:`Py_LIMITED_API` defined for 3.11, and are necessary to use the
  3767. buffer API.
  3768. - gh-issue-99612: Fix :c:func:`PyUnicode_DecodeUTF8Stateful` for ASCII-only
  3769. data: ``*consumed`` was not set.
  3770. - gh-issue-47146: The ``structmember.h`` header is deprecated. Its
  3771. non-deprecated contents are now available just by including ``Python.h``,
  3772. with a ``Py_`` prefix added if it was missing. (Deprecated contents are
  3773. :c:macro:`T_OBJECT`, :c:macro:`T_NONE`, and no-op flags.) Patch by Petr
  3774. Viktorin, based on earlier work by Alexander Belopolsky and Matthias
  3775. Braun.
  3776. What's New in Python 3.12.0 alpha 2?
  3777. ====================================
  3778. *Release date: 2022-11-14*
  3779. Security
  3780. --------
  3781. - gh-issue-98433: The IDNA codec decoder used on DNS hostnames by
  3782. :mod:`socket` or :mod:`asyncio` related name resolution functions no
  3783. longer involves a quadratic algorithm. This prevents a potential CPU
  3784. denial of service if an out-of-spec excessive length hostname involving
  3785. bidirectional characters were decoded. Some protocols such as
  3786. :mod:`urllib` http :samp:`3{xx}` redirects potentially allow for an
  3787. attacker to supply such a name.
  3788. Individual labels within an IDNA encoded DNS name will now raise an error
  3789. early during IDNA decoding if they are longer than 1024 unicode characters
  3790. given that each decoded DNS label must be 63 or fewer characters and the
  3791. entire decoded DNS name is limited to 255. Only an application presenting
  3792. a hostname or label consisting primarily of :rfc:`3454` section 3.1
  3793. "Nothing" characters to be removed would run into of this new limit. See
  3794. also :rfc:`5894` section 6 and :rfc:`3491`.
  3795. - gh-issue-98739: Update bundled libexpat to 2.5.0
  3796. Core and Builtins
  3797. -----------------
  3798. - gh-issue-81057: The docs clearly say that ``PyImport_Inittab``,
  3799. :c:func:`PyImport_AppendInittab`, and :c:func:`PyImport_ExtendInittab`
  3800. should not be used after :c:func:`Py_Initialize` has been called. We now
  3801. enforce this for the two functions. Additionally, the runtime now uses an
  3802. internal copy of ``PyImport_Inittab``, to guard against modification.
  3803. - gh-issue-99298: Fix an issue that could potentially cause incorrect error
  3804. handling for some bytecode instructions.
  3805. - gh-issue-99254: The compiler now removes all unused constants from code
  3806. objects (except the first one, which may be a docstring).
  3807. - gh-issue-99205: Fix an issue that prevented :c:type:`PyThreadState` and
  3808. :c:type:`PyInterpreterState` memory from being freed properly.
  3809. - gh-issue-81057: The 18 global C variables holding the state of the
  3810. allocators have been moved to ``_PyRuntimeState``. This is a strictly
  3811. internal change with no change in behavior.
  3812. - gh-issue-99181: Fix failure in :keyword:`except* <except_star>` with
  3813. unhashable exceptions.
  3814. - gh-issue-99204: Fix calculation of :data:`sys._base_executable` when
  3815. inside a POSIX virtual environment using copies of the python binary when
  3816. the base installation does not provide the executable name used by the
  3817. venv. Calculation will fall back to alternative names ("python<MAJOR>",
  3818. "python<MAJOR>.<MINOR>").
  3819. - gh-issue-96055: Update :mod:`faulthandler` to emit an error message with
  3820. the proper unexpected signal number. Patch by Donghee Na.
  3821. - gh-issue-99153: Fix location of :exc:`SyntaxError` for a :keyword:`try`
  3822. block with both :keyword:`except` and :keyword:`except* <except_star>`.
  3823. - gh-issue-98686: Merge the adaptive opcode logic into each instruction's
  3824. unquickened variant, and merge the logic in ``EXTENDED_ARG_QUICK`` into
  3825. :opcode:`EXTENDED_ARG`. With these changes, the quickening that happens at
  3826. code object creation is now only responsible for initializing warmup
  3827. counters and inserting superinstructions.
  3828. - gh-issue-99103: Fix the error reporting positions of specialized traceback
  3829. anchors when the source line contains Unicode characters.
  3830. - gh-issue-99139: Improve the error suggestion for :exc:`NameError`
  3831. exceptions for instances. Now if a :exc:`NameError` is raised in a method
  3832. and the instance has an attribute that's exactly equal to the name in the
  3833. exception, the suggestion will include ``self.<NAME>`` instead of the
  3834. closest match in the method scope. Patch by Pablo Galindo
  3835. - gh-issue-98401: Octal escapes with value larger than ``0o377`` (ex:
  3836. ``"\477"``), deprecated in Python 3.11, now produce a
  3837. :exc:`SyntaxWarning`, instead of :exc:`DeprecationWarning`. In a future
  3838. Python version they will be eventually a :exc:`SyntaxError`. Patch by
  3839. Victor Stinner.
  3840. - gh-issue-98401: A backslash-character pair that is not a valid escape
  3841. sequence now generates a :exc:`SyntaxWarning`, instead of
  3842. :exc:`DeprecationWarning`. For example, ``re.compile("\d+\.\d+")`` now
  3843. emits a :exc:`SyntaxWarning` (``"\d"`` is an invalid escape sequence), use
  3844. raw strings for regular expression: ``re.compile(r"\d+\.\d+")``. In a
  3845. future Python version, :exc:`SyntaxError` will eventually be raised,
  3846. instead of :exc:`SyntaxWarning`. Patch by Victor Stinner.
  3847. - gh-issue-96793: Handle StopIteration and StopAsyncIteration raised in
  3848. generator or coroutines in the bytecode, rather than in wrapping C code.
  3849. - gh-issue-98931: Improve the :exc:`SyntaxError` error message when the user
  3850. types ``import x from y`` instead of ``from y import x``. Patch by Pablo
  3851. Galindo
  3852. - gh-issue-98852: Fix subscription of type aliases containing bare generic
  3853. types or types like :class:`~typing.TypeVar`: for example ``tuple[A,
  3854. T][int]`` and ``tuple[TypeVar, T][int]``, where ``A`` is a generic type,
  3855. and ``T`` is a type variable.
  3856. - gh-issue-98925: Lower the recursion depth for marshal on WASI to support
  3857. (in-development) wasmtime 2.0.
  3858. - gh-issue-98783: Fix multiple crashes in debug mode when ``str`` subclasses
  3859. are used instead of ``str`` itself.
  3860. - gh-issue-98811: Use complete source locations to simplify detection of
  3861. ``__future__`` imports which are not at the beginning of the file. Also
  3862. corrects the offset in the exception raised in one case, which was off by
  3863. one and impeded highlighting.
  3864. - gh-issue-96793: Add specialization of :opcode:`FOR_ITER` for generators.
  3865. Saves multiple layers of dispatch and checking to get from the
  3866. :opcode:`FOR_ITER` instruction in the caller to the :opcode:`RESUME` in
  3867. the generator.
  3868. - gh-issue-98762: Fix source locations of :keyword:`match` sub-patterns.
  3869. - gh-issue-98586: Added the methods :c:func:`PyObject_Vectorcall` and
  3870. :c:func:`PyObject_VectorcallMethod` to the :ref:`Limited API <stable>`
  3871. along with the auxiliary macro constant
  3872. :c:macro:`PY_VECTORCALL_ARGUMENTS_OFFSET`.
  3873. The availability of these functions enables more efficient :PEP:`590`
  3874. vector calls from binary extension modules that avoid argument
  3875. boxing/unboxing overheads.
  3876. - gh-issue-99257: Fix an issue where member descriptors (such as those for
  3877. :attr:`~object.__slots__`) could behave incorrectly or crash instead of
  3878. raising a :exc:`TypeError` when accessed via an instance of an invalid
  3879. type.
  3880. - gh-issue-93143: Rather than changing :attr:`~types.CodeType.co_code`, the
  3881. interpreter will now display a :exc:`RuntimeWarning` and assign
  3882. :const:`None` to any fast locals that are left unbound after jumps or
  3883. :keyword:`del` statements executed while tracing.
  3884. - gh-issue-96421: When calling into Python code from C code, through
  3885. :c:func:`PyEval_EvalFrameEx` or a related C-API function, a shim frame in
  3886. inserted into the call stack. This occurs in the
  3887. ``_PyEval_EvalFrameDefault()`` function. The extra frame should be
  3888. invisible to all Python and most C extensions, but out-of-process
  3889. profilers and debuggers need to be aware of it. These shim frames can be
  3890. detected by checking ``frame->owner == FRAME_OWNED_BY_CSTACK``.
  3891. Extensions implementing their own interpreters using PEP 523 need to be
  3892. aware of this shim frame and the changes to the semantics of
  3893. :opcode:`RETURN_VALUE`, :opcode:`YIELD_VALUE`, and
  3894. :opcode:`RETURN_GENERATOR`, which now clear the frame.
  3895. - gh-issue-98415: Fix detection of MAC addresses for :mod:`uuid` on certain
  3896. OSs. Patch by Chaim Sanders
  3897. - gh-issue-98686: Quicken all code objects, and specialize adaptive bytecode
  3898. instructions more aggressively.
  3899. - gh-issue-92119: Print exception class name instead of its string
  3900. representation when raising errors from :mod:`ctypes` calls.
  3901. - gh-issue-91058: :exc:`ImportError` raised from failed ``from <module>
  3902. import <name>`` now include suggestions for the value of ``<name>`` based
  3903. on the available names in ``<module>``. Patch by Pablo Galindo
  3904. - gh-issue-96793: The :opcode:`FOR_ITER` now leaves the iterator on the
  3905. stack on termination of the loop. This is to assist specialization of
  3906. loops for generators.
  3907. - gh-issue-90716: Add _pylong.py module. It includes asymptotically faster
  3908. algorithms that can be used for operations on integers with many digits.
  3909. It is used by longobject.c to speed up some operations.
  3910. - gh-issue-95389: Expose :const:`~socket.ETH_P_ALL` and some of the
  3911. :ref:`ETHERTYPE_* constants <socket-ethernet-types>` in :mod:`socket`.
  3912. Patch by Noam Cohen.
  3913. - gh-issue-93696: Allow :mod:`pdb` to locate source for frozen modules in
  3914. the standard library.
  3915. Library
  3916. -------
  3917. - gh-issue-99418: Fix bug in :func:`urllib.parse.urlparse` that causes URL
  3918. schemes that begin with a digit, a plus sign, or a minus sign to be parsed
  3919. incorrectly.
  3920. - gh-issue-94597: Deprecate :class:`asyncio.AbstractChildWatcher` to be
  3921. removed in Python 3.14. Patch by Kumar Aditya.
  3922. - gh-issue-99305: Improve performance of :func:`secrets.token_hex`.
  3923. - gh-issue-74044: Fixed bug where :func:`inspect.signature` reported
  3924. incorrect arguments for decorated methods.
  3925. - gh-issue-99275: Fix ``SystemError`` in :mod:`ctypes` when exception was
  3926. not set during ``__initsubclass__``.
  3927. - gh-issue-99277: Remove older version of
  3928. ``_SSLProtocolTransport.get_write_buffer_limits`` in
  3929. :mod:`!asyncio.sslproto`
  3930. - gh-issue-99248: fix negative numbers failing in verify()
  3931. - gh-issue-99155: Fix :class:`statistics.NormalDist` pickle with ``0`` and
  3932. ``1`` protocols.
  3933. - gh-issue-93464: ``enum.auto()`` is now correctly activated when combined
  3934. with other assignment values. E.g. ``ONE = auto(), 'some text'`` will now
  3935. evaluate as ``(1, 'some text')``.
  3936. - gh-issue-99134: Update the bundled copy of pip to version 22.3.1.
  3937. - gh-issue-92584: Remove the ``distutils`` package. It was deprecated in
  3938. Python 3.10 by :pep:`632` "Deprecate distutils module". For projects still
  3939. using ``distutils`` and cannot be updated to something else, the
  3940. ``setuptools`` project can be installed: it still provides ``distutils``.
  3941. Patch by Victor Stinner.
  3942. - gh-issue-98999: Now :mod:`_pyio` is consistent with :mod:`_io` in raising
  3943. ``ValueError`` when executing methods over closed buffers.
  3944. - gh-issue-83004: Clean up refleak on failed module initialisation in
  3945. :mod:`_zoneinfo`
  3946. - gh-issue-83004: Clean up refleaks on failed module initialisation in
  3947. :mod:`_pickle`
  3948. - gh-issue-83004: Clean up refleak on failed module initialisation in
  3949. :mod:`_io`.
  3950. - gh-issue-98897: Fix memory leak in :func:`math.dist` when both points
  3951. don't have the same dimension. Patch by Kumar Aditya.
  3952. - gh-issue-98878: Use the frame bound builtins when offering a name
  3953. suggestion in :mod:`traceback` to prevent crashing when ``__builtins__``
  3954. is not a dict.
  3955. - gh-issue-98139: In :mod:`importlib._bootstrap`, enhance namespace package
  3956. repr to ``<module 'x' (namespace) from ['path']>``.
  3957. - gh-issue-90352: Fix ``_SelectorDatagramTransport`` to inherit from
  3958. :class:`~asyncio.DatagramTransport` in :mod:`asyncio`. Patch by Kumar
  3959. Aditya.
  3960. - gh-issue-98793: Fix argument typechecks in :func:`!_overlapped.WSAConnect`
  3961. and :func:`!_overlapped.Overlapped.WSASendTo` functions.
  3962. - gh-issue-98744: Prevent crashing in :mod:`traceback` when retrieving the
  3963. byte-offset for some source files that contain certain unicode characters.
  3964. - gh-issue-98740: Fix internal error in the :mod:`re` module which in very
  3965. rare circumstances prevented compilation of a regular expression
  3966. containing a :ref:`conditional expression <re-conditional-expression>`
  3967. without the "else" branch.
  3968. - gh-issue-98703: Fix :meth:`asyncio.StreamWriter.drain` to call
  3969. ``protocol.connection_lost`` callback only once on Windows.
  3970. - gh-issue-98624: Add a mutex to unittest.mock.NonCallableMock to protect
  3971. concurrent access to mock attributes.
  3972. - gh-issue-98658: The :class:`array.array` class now supports subscripting,
  3973. making it a :term:`generic type`.
  3974. - gh-issue-98284: Improved :class:`TypeError` message for undefined abstract
  3975. methods of a :class:`abc.ABC` instance. The names of the missing methods
  3976. are surrounded by single-quotes to highlight them.
  3977. - gh-issue-96151: Allow ``BUILTINS`` to be a valid field name for frozen
  3978. dataclasses.
  3979. - gh-issue-98086: Make sure ``patch.dict()`` can be applied on async
  3980. functions.
  3981. - gh-issue-72719: Remove modules :mod:`!asyncore` and :mod:`!asynchat`,
  3982. which were deprecated by :pep:`594`.
  3983. - gh-issue-96192: Fix handling of ``bytes`` :term:`path-like objects
  3984. <path-like object>` in :func:`os.ismount()`.
  3985. - gh-issue-94172: :mod:`ftplib`: Remove the ``FTP_TLS.ssl_version`` class
  3986. attribute: use the *context* parameter instead. Patch by Victor Stinner
  3987. - gh-issue-94172: Remove the *keyfile* and *certfile* parameters from the
  3988. :mod:`ftplib`, :mod:`imaplib`, :mod:`poplib` and :mod:`smtplib` modules,
  3989. and the *key_file*, *cert_file* and *check_hostname* parameters from the
  3990. :mod:`http.client` module, all deprecated since Python 3.6. Use the
  3991. *context* parameter (*ssl_context* in :mod:`imaplib`) instead. Patch by
  3992. Victor Stinner.
  3993. - gh-issue-83638: Add the :attr:`~sqlite3.Connection.autocommit` attribute
  3994. to :class:`sqlite3.Connection` and the *autocommit* parameter to
  3995. :func:`sqlite3.connect` to control :pep:`249`-compliant :ref:`transaction
  3996. handling <sqlite3-transaction-control-autocommit>`. Patch by Erlend E.
  3997. Aasland.
  3998. - gh-issue-92452: Fixed a race condition that could cause
  3999. :func:`sysconfig.get_config_var` to incorrectly return :const:`None` in
  4000. multi-threaded programs.
  4001. - gh-issue-91803: Fix an error when using a method of objects mocked with
  4002. :func:`unittest.mock.create_autospec` after it was sealed with
  4003. :func:`unittest.mock.seal` function.
  4004. - bpo-38523: :func:`shutil.copytree` now applies the
  4005. *ignore_dangling_symlinks* argument recursively.
  4006. - bpo-40358: Add walk_up argument in :meth:`pathlib.PurePath.relative_to`.
  4007. - bpo-36267: Fix IndexError in :class:`argparse.ArgumentParser` when a
  4008. ``store_true`` action is given an explicit argument.
  4009. Documentation
  4010. -------------
  4011. - gh-issue-98832: Changes wording of docstring for
  4012. :func:`pathlib.Path.iterdir`.
  4013. - gh-issue-97966: Update uname docs to clarify the special nature of the
  4014. platform attribute and to indicate when it became late-bound.
  4015. Tests
  4016. -----
  4017. - gh-issue-98903: The Python test suite now fails wit exit code 4 if no
  4018. tests ran. It should help detecting typos in test names and test methods.
  4019. - gh-issue-98713: Fix a bug in the :mod:`typing` tests where a test relying
  4020. on CPython-specific implementation details was not decorated with
  4021. ``@cpython_only`` and was not skipped on other implementations.
  4022. - gh-issue-87390: Add tests for star-unpacking with PEP 646, and some other
  4023. miscellaneous PEP 646 tests.
  4024. - gh-issue-96853: Added explicit coverage of ``Py_Initialize`` (and hence
  4025. ``Py_InitializeEx``) back to the embedding tests (all other embedding
  4026. tests migrated to ``Py_InitializeFromConfig`` in Python 3.11)
  4027. - bpo-34272: Some C API tests were moved into the new Lib/test/test_capi/
  4028. directory.
  4029. Build
  4030. -----
  4031. - gh-issue-99086: Fix ``-Wimplicit-int`` compiler warning in
  4032. :program:`configure` check for ``PTHREAD_SCOPE_SYSTEM``.
  4033. - gh-issue-99016: Fix build with ``PYTHON_FOR_REGEN=python3.8``.
  4034. - gh-issue-97731: Specify the full path to the source location for ``make
  4035. docclean`` (needed for cross-builds).
  4036. - gh-issue-98949: Drop unused build dependency on ``readelf``.
  4037. - gh-issue-98989: Use ``python3.11``, if available, for regeneration and
  4038. freezing.
  4039. - gh-issue-98831: Add new tooling, in ``Tools/cases_generator``, to generate
  4040. the interpreter switch statement from a list of opcode definitions. This
  4041. only affects adding, modifying or removing instruction definitions. The
  4042. instruction definitions now live in ``Python/bytecodes.c``, in the form of
  4043. a `custom DSL (under development)
  4044. <https://github.com/faster-cpython/ideas/blob/main/3.12/interpreter_definition.md>`__.
  4045. The tooling reads this file and writes ``Python/generated_cases.c.h``,
  4046. which is then included by ``Python/ceval.c`` to provide most of the cases
  4047. of the main interpreter switch.
  4048. - gh-issue-98817: Remove PCbuild/lib.pyproj: it's not used for anything, is
  4049. only a minor convenience for Visual Studio users (who probably mostly
  4050. don't even know about it), and it takes a lot of maintenance effort to
  4051. keep updated.
  4052. - gh-issue-98776: Fix ``make regen-test-levenshtein`` for out-of-tree
  4053. builds.
  4054. - gh-issue-98707: Don't use vendored ``libmpdec`` headers if
  4055. :option:`--with-system-libmpdec` is passed to :program:`configure`. Don't
  4056. use vendored ``libexpat`` headers if :option:`--with-system-expat` is
  4057. passed to :program:`configure`.
  4058. Windows
  4059. -------
  4060. - gh-issue-98689: Update Windows builds to zlib v1.2.13. v1.2.12 has
  4061. CVE-2022-37434, but the vulnerable ``inflateGetHeader`` API is not used by
  4062. Python.
  4063. - gh-issue-98790: Assumes that a missing ``DLLs`` directory means that
  4064. standard extension modules are in the executable's directory.
  4065. - gh-issue-98745: Update :file:`py.exe` launcher to install 3.11 by default
  4066. and 3.12 on request.
  4067. - gh-issue-98692: Fix the :ref:`launcher` ignoring unrecognized shebang
  4068. lines instead of treating them as local paths
  4069. - gh-issue-94328: Update Windows installer to use SQLite 3.39.4.
  4070. macOS
  4071. -----
  4072. - gh-issue-94328: Update macOS installer to SQLite 3.39.4.
  4073. C API
  4074. -----
  4075. - gh-issue-98724: The :c:macro:`Py_CLEAR`, :c:macro:`Py_SETREF` and
  4076. :c:macro:`Py_XSETREF` macros now only evaluate their argument once. If the
  4077. argument has side effects, these side effects are no longer duplicated.
  4078. Patch by Victor Stinner.
  4079. - gh-issue-98978: Fix use-after-free in ``Py_SetPythonHome(NULL)``,
  4080. ``Py_SetProgramName(NULL)`` and ``_Py_SetProgramFullPath(NULL)`` function
  4081. calls. Issue reported by Benedikt Reinartz. Patch by Victor Stinner.
  4082. - gh-issue-98410: Add ``getbufferproc`` and ``releasebufferproc`` to the
  4083. stable API.
  4084. - gh-issue-98610: Some configurable capabilities of sub-interpreters have
  4085. changed. They always allow subprocesses (:mod:`subprocess`) now, whereas
  4086. before subprocesses could be optionally disallowed for a sub-interpreter.
  4087. Instead :func:`os.exec` can now be disallowed. Disallowing daemon threads
  4088. is now supported. Disallowing all threads is still allowed, but is never
  4089. done by default. Note that the optional restrictions are only available
  4090. through ``_Py_NewInterpreterFromConfig()``, which isn't a public API. They
  4091. do not affect the main interpreter, nor :c:func:`Py_NewInterpreter`.
  4092. - gh-issue-98608: A ``_PyInterpreterConfig`` has been added and
  4093. ``_Py_NewInterpreter()`` has been renamed to
  4094. ``_Py_NewInterpreterFromConfig()``. The "isolated_subinterpreters"
  4095. argument is now a granular config that captures the previous behavior.
  4096. Note that this is all "private" API.
  4097. - gh-issue-96853: ``Py_InitializeEx`` now correctly calls ``PyConfig_Clear``
  4098. after initializing the interpreter (the omission didn't cause a memory
  4099. leak only because none of the dynamically allocated config fields are
  4100. populated by the wrapper function)
  4101. - gh-issue-91248: Add :c:func:`PyFrame_GetVar` and
  4102. :c:func:`PyFrame_GetVarString` functions to get a frame variable by its
  4103. name. Patch by Victor Stinner.
  4104. What's New in Python 3.12.0 alpha 1?
  4105. ====================================
  4106. *Release date: 2022-10-25*
  4107. Security
  4108. --------
  4109. - gh-issue-97616: Fix multiplying a list by an integer (``list *= int``):
  4110. detect the integer overflow when the new allocated length is close to the
  4111. maximum size. Issue reported by Jordan Limor. Patch by Victor Stinner.
  4112. - gh-issue-97514: On Linux the :mod:`multiprocessing` module returns to
  4113. using filesystem backed unix domain sockets for communication with the
  4114. *forkserver* process instead of the Linux abstract socket namespace. Only
  4115. code that chooses to use the :ref:`"forkserver" start method
  4116. <multiprocessing-start-methods>` is affected.
  4117. Abstract sockets have no permissions and could allow any user on the
  4118. system in the same `network namespace
  4119. <https://man7.org/linux/man-pages/man7/network_namespaces.7.html>`_ (often
  4120. the whole system) to inject code into the multiprocessing *forkserver*
  4121. process. This was a potential privilege escalation. Filesystem based
  4122. socket permissions restrict this to the *forkserver* process user as was
  4123. the default in Python 3.8 and earlier.
  4124. This prevents Linux `CVE-2022-42919
  4125. <https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-42919>`_.
  4126. - gh-issue-87389: :mod:`http.server`: Fix an open redirection vulnerability
  4127. in the HTTP server when an URI path starts with ``//``. Vulnerability
  4128. discovered, and initial fix proposed, by Hamza Avvan.
  4129. - gh-issue-79096: LWPCookieJar and MozillaCookieJar create files with file
  4130. mode 600 instead of 644 (Microsoft Windows is not affected)
  4131. - gh-issue-92888: Fix ``memoryview`` use after free when accessing the
  4132. backing buffer in certain cases.
  4133. - gh-issue-68966: The deprecated mailcap module now refuses to inject unsafe
  4134. text (filenames, MIME types, parameters) into shell commands. Instead of
  4135. using such text, it will warn and act as if a match was not found (or for
  4136. test commands, as if the test failed).
  4137. Core and Builtins
  4138. -----------------
  4139. - gh-issue-98374: Suppress ImportError for invalid query for help() command.
  4140. Patch by Donghee Na.
  4141. - gh-issue-98461: Fix source location in bytecode for list, set and dict
  4142. comprehensions as well as generator expressions.
  4143. - gh-issue-98354: Added unicode check for ``name`` attribute of ``spec``
  4144. argument passed in :func:`_imp.create_builtin` function.
  4145. - gh-issue-98398: Fix source location of 'assert' bytecodes.
  4146. - gh-issue-98390: Fix location of sub-expressions of boolean expressions, by
  4147. reducing their scope to that of the sub-expression.
  4148. - gh-issue-98254: Modules from the standard library are now potentially
  4149. suggested as part of the error messages displayed by the interpreter when
  4150. an :exc:`NameError` is raised to the top level. Patch by Pablo Galindo
  4151. - gh-issue-97997: Add running column offset to the tokenizer state to avoid
  4152. calculating AST column information with pointer arithmetic.
  4153. - gh-issue-97973: Modify the tokenizer to return all necessary information
  4154. the parser needs to set location information in the AST nodes, so that the
  4155. parser does not have to calculate those doing pointer arithmetic.
  4156. - gh-issue-96078: :func:`os.sched_yield` now release the GIL while calling
  4157. sched_yield(2). Patch by Donghee Na.
  4158. - gh-issue-97955: Migrate :mod:`zoneinfo` to Argument Clinic.
  4159. - gh-issue-97912: The compiler now avoids quadratic behavior when finding
  4160. which instructions should use the :opcode:`LOAD_FAST_CHECK` opcode.
  4161. - gh-issue-97002: Fix an issue where several frame objects could be backed
  4162. by the same interpreter frame, possibly leading to corrupted memory and
  4163. hard crashes of the interpreter.
  4164. - gh-issue-97943: Bugfix: :c:func:`PyFunction_GetAnnotations` should return
  4165. a borrowed reference. It was returning a new reference.
  4166. - gh-issue-97922: The Garbage Collector now runs only on the eval breaker
  4167. mechanism of the Python bytecode evaluation loop instead on object
  4168. allocations. The GC can also run when :c:func:`PyErr_CheckSignals` is
  4169. called so C extensions that need to run for a long time without executing
  4170. any Python code also have a chance to execute the GC periodically.
  4171. - gh-issue-65961: When ``__package__`` is different than
  4172. ``__spec__.parent``, raise a ``DeprecationWarning`` instead of
  4173. ``ImportWarning``.
  4174. Also remove ``importlib.util.set_package()`` which was scheduled for
  4175. removal.
  4176. - gh-issue-97850: Long deprecated, ``module_repr()`` should now be
  4177. completely eradicated.
  4178. - gh-issue-86298: In cases where ``warnings.warn_explicit()`` consults the
  4179. module's loader, an ``DeprecationWarning`` is issued when ``m.__loader__``
  4180. differs from ``m.__spec__.loader``.
  4181. - gh-issue-97779: Ensure that all Python frame objects are backed by
  4182. "complete" frames.
  4183. - gh-issue-91052: Add API for subscribing to modification events on selected
  4184. dictionaries.
  4185. - gh-issue-97752: Fix possible data corruption or crashes when accessing the
  4186. ``f_back`` member of newly-created generator or coroutine frames.
  4187. - gh-issue-97591: Fixed a missing incref/decref pair in
  4188. ``Exception.__setstate__()``. Patch by Ofey Chan.
  4189. - gh-issue-97670: Remove the :func:`sys.getdxp` function and the
  4190. ``Tools/scripts/analyze_dxp.py`` script. DXP stands for "dynamic execution
  4191. pairs". They were related to ``DYNAMIC_EXECUTION_PROFILE`` and ``DXPAIRS``
  4192. macros which have been removed in Python 3.11. Python can now be built
  4193. with :option:`./configure --enable-pystats <--enable-pystats>` to gather
  4194. statistics on Python opcodes. Patch by Victor Stinner.
  4195. - gh-issue-94526: Fix the Python path configuration used to initialized
  4196. :data:`sys.path` at Python startup. Paths are no longer encoded to
  4197. UTF-8/strict to avoid encoding errors if it contains surrogate characters
  4198. (bytes paths are decoded with the surrogateescape error handler). Patch by
  4199. Victor Stinner.
  4200. - gh-issue-96670: The parser now raises :exc:`SyntaxError` when parsing
  4201. source code containing null bytes. Patch by Pablo Galindo
  4202. - gh-issue-96975: Fix a crash occurring when :c:func:`PyEval_GetFrame` is
  4203. called while the topmost Python frame is in a partially-initialized state.
  4204. - gh-issue-96848: Fix command line parsing: reject :option:`-X
  4205. int_max_str_digits <-X>` option with no value (invalid) when the
  4206. :envvar:`PYTHONINTMAXSTRDIGITS` environment variable is set to a valid
  4207. limit. Patch by Victor Stinner.
  4208. - gh-issue-95921: Fix overly-broad source position information for chained
  4209. comparisons used as branching conditions.
  4210. - gh-issue-96821: Fix undefined behaviour in ``audioop.c``.
  4211. - gh-issue-96821: Fix undefined behaviour in ``_testcapimodule.c``.
  4212. - gh-issue-95778: When :exc:`ValueError` is raised if an integer is larger
  4213. than the limit, mention the :func:`sys.set_int_max_str_digits` function in
  4214. the error message. Patch by Victor Stinner.
  4215. - gh-issue-96387: At Python exit, sometimes a thread holding the GIL can
  4216. wait forever for a thread (usually a daemon thread) which requested to
  4217. drop the GIL, whereas the thread already exited. To fix the race
  4218. condition, the thread which requested the GIL drop now resets its request
  4219. before exiting. Issue discovered and analyzed by Mingliang ZHAO. Patch by
  4220. Victor Stinner.
  4221. - gh-issue-96864: Fix a possible assertion failure, fatal error, or
  4222. :exc:`SystemError` if a line tracing event raises an exception while
  4223. opcode tracing is enabled.
  4224. - gh-issue-95778: The ``PyLong_FromString`` function was refactored to make
  4225. it more maintainable and extensible.
  4226. - gh-issue-96678: Fix undefined behaviour in C code of null pointer
  4227. arithmetic.
  4228. - gh-issue-96754: Make sure that all frame objects created are created from
  4229. valid interpreter frames. Prevents the possibility of invalid frames in
  4230. backtraces and signal handlers.
  4231. - gh-issue-90997: Improve the performance of reading and writing inline
  4232. bytecode caches on some platforms.
  4233. - gh-issue-96751: Remove dead code from ``CALL_FUNCTION_EX`` opcode.
  4234. - gh-issue-90751: :class:`memoryview` now supports half-floats. Patch by
  4235. Donghee Na and Antoine Pitrou.
  4236. - gh-issue-96678: Fix case of undefined behavior in ceval.c
  4237. - gh-issue-64373: Convert :mod:`_functools` to argument clinic.
  4238. - gh-issue-96641: Do not expose ``KeyWrapper`` in :mod:`_functools`.
  4239. - gh-issue-96636: Ensure that tracing, ``sys.setrace()``, is turned on
  4240. immediately. In pre-release versions of 3.11, some tracing events might
  4241. have been lost when turning on tracing in a ``__del__`` method or
  4242. interrupt.
  4243. - gh-issue-96572: Fix use after free in trace refs build mode. Patch by
  4244. Kumar Aditya.
  4245. - gh-issue-96611: When loading a file with invalid UTF-8 inside a multi-line
  4246. string, a correct SyntaxError is emitted.
  4247. - gh-issue-96612: Make sure that incomplete frames do not show up in
  4248. tracemalloc traces.
  4249. - gh-issue-90230: Fix compiler warnings and test failures when building with
  4250. ``--enable-pystats``.
  4251. - gh-issue-96587: Correctly raise ``SyntaxError`` on exception groups
  4252. (:pep:`654`) on python versions prior to 3.11
  4253. - gh-issue-96569: Remove two cases of undefined behavoir, by adding NULL
  4254. checks.
  4255. - gh-issue-96582: Fix possible ``NULL`` pointer dereference in
  4256. ``_PyThread_CurrentFrames``. Patch by Kumar Aditya.
  4257. - gh-issue-91079: Separate Python recursion checking from C recursion
  4258. checking which reduces the chance of C stack overflow and allows the
  4259. recursion limit to be increased safely.
  4260. - gh-issue-93911: Fix an issue that could prevent :opcode:`LOAD_ATTR` from
  4261. specializing properly when accessing properties.
  4262. - gh-issue-96348: Emit a DeprecationWarning when :meth:`~generator.throw`,
  4263. :meth:`~coroutine.throw` or :meth:`~agen.athrow` are called with more than
  4264. one argument.
  4265. - gh-issue-95196: Disable incorrect pickling of the C implemented
  4266. classmethod descriptors.
  4267. - gh-issue-96364: Fix text signatures of ``list.__getitem__`` and
  4268. ``dict.__getitem__``.
  4269. - gh-issue-96352: Fix :exc:`AttributeError` missing ``name`` and ``obj``
  4270. attributes in :meth:`object.__getattribute__`. Patch by Philip Georgi.
  4271. - gh-issue-93554: Change the jump opcodes so that all conditional jumps are
  4272. forward jumps. Backward jumps are converted by the assembler into a
  4273. conditional forward jump whose target is the fallthrough block (and with a
  4274. reversed condition), followed by an unconditional backward jump. For
  4275. example:
  4276. ``POP_JUMP_IF_TRUE BACKWARD_TARGET`` becomes ``POP_JUMP_IF_FALSE
  4277. NEXT_BLOCK; JUMP BACKWARD_TARGET``.
  4278. All the directed conditional jump opcodes were removed:
  4279. ``POP_JUMP_FORWARD_IF_TRUE``, ``POP_JUMP_BACKWARD_IF_TRUE``,
  4280. ``POP_JUMP_FORWARD_IF_FALSE``, ``POP_JUMP_BACKWARD_IF_FALSE``,
  4281. ``POP_JUMP_FORWARD_IF_NONE``, ``POP_JUMP_BACKWARD_IF_NONE``,
  4282. ``POP_JUMP_FORWARD_IF_NOT_NONE``, ``POP_JUMP_BACKWARD_IF_NOT_NONE``.
  4283. The corresponding opcodes without direction are no longer
  4284. pseudo-instructions, and they implement the forward conditional jumps.
  4285. - gh-issue-96268: Loading a file with invalid UTF-8 will now report the
  4286. broken character at the correct location.
  4287. - gh-issue-96237: The internal field ``_PyInterpreterFrame.f_func`` is
  4288. renamed to ``_PyInterpreterFrame.f_funcobj`` and may be any object. The
  4289. ``f_globals`` and ``f_builtin`` fields may hold junk values.
  4290. It is safest to treat the ``_PyInterpreterFrame`` struct as opaque.
  4291. - gh-issue-96187: Fixed a bug that caused ``_PyCode_GetExtra`` to return
  4292. garbage for negative indexes. Patch by Pablo Galindo
  4293. - gh-issue-96143: Add a new ``-X perf`` Python command line option as well
  4294. as :func:`sys.activate_stack_trampoline` and
  4295. :func:`sys.deactivate_stack_trampoline` function in the :mod:`sys` module
  4296. that allows to set/unset the interpreter in a way that the Linux ``perf``
  4297. profiler can detect Python calls. The new
  4298. :func:`sys.is_stack_trampoline_active` function allows to query the state
  4299. of the perf trampoline. Design by Pablo Galindo. Patch by Pablo Galindo
  4300. and Christian Heimes with contributions from Gregory P. Smith [Google] and
  4301. Mark Shannon.
  4302. - gh-issue-96071: Fix a deadlock in :c:func:`PyGILState_Ensure` when
  4303. allocating new thread state. Patch by Kumar Aditya.
  4304. - gh-issue-96046: :c:func:`PyType_Ready` now initializes ``ht_cached_keys``
  4305. and performs additional checks to ensure that type objects are properly
  4306. configured. This avoids crashes in 3rd party packages that don't use
  4307. regular API to create new types.
  4308. - gh-issue-96005: On WASI :const:`~errno.ENOTCAPABLE` is now mapped to
  4309. :exc:`PermissionError`. The :mod:`errno` modules exposes the new error
  4310. number. ``getpath.py`` now ignores :exc:`PermissionError` when it cannot
  4311. open landmark files ``pybuilddir.txt`` and ``pyenv.cfg``.
  4312. - gh-issue-93678: Added test a harness for direct unit tests of the
  4313. compiler's optimization stage. The ``_testinternalcapi.optimize_cfg()``
  4314. function runs the optimiser on a sequence of instructions. The
  4315. ``CfgOptimizationTestCase`` class in ``test.support`` has utilities for
  4316. invoking the optimizer and checking the output.
  4317. - gh-issue-95245: Reduces the size of a "simple" Python object from 8 to 6
  4318. words by moving the weakreflist pointer into the pre-header directly
  4319. before the object's dict/values pointer.
  4320. - gh-issue-90997: Compile virtual :keyword:`try`/:keyword:`except` blocks to
  4321. handle exceptions raised during :meth:`~generator.close` or
  4322. :meth:`~generator.throw` calls through a suspended frame.
  4323. - gh-issue-95977: Optimized calling :meth:`~object.__get__` with vectorcall.
  4324. Patch by Kumar Aditya.
  4325. - gh-issue-91210: Improve error message when a parameter without a default
  4326. value follows one with a default value, and show the same message, even
  4327. when the non-default/default sequence is preceded by positional-only
  4328. parameters.
  4329. - gh-issue-95922: Fixed bug where the compiler's
  4330. ``eliminate_empty_basic_blocks`` function ignores the last block of the
  4331. code unit.
  4332. - gh-issue-95818: Skip over incomplete frames in
  4333. :c:func:`PyThreadState_GetFrame`.
  4334. - gh-issue-95876: Fix format string in
  4335. ``_PyPegen_raise_error_known_location`` that can lead to memory corruption
  4336. on some 64bit systems. The function was building a tuple with ``i`` (int)
  4337. instead of ``n`` (Py_ssize_t) for Py_ssize_t arguments.
  4338. - gh-issue-95605: Fix misleading contents of error message when converting
  4339. an all-whitespace string to :class:`float`.
  4340. - gh-issue-95150: Update code object hashing and equality to consider all
  4341. debugging and exception handling tables. This fixes an issue where certain
  4342. non-identical code objects could be "deduplicated" during compilation.
  4343. - gh-issue-91146: Reduce allocation size of :class:`list` from
  4344. :meth:`str.split` and :meth:`str.rsplit`. Patch by Donghee Na and Inada
  4345. Naoki.
  4346. - gh-issue-87092: Create a 'jump target label' abstraction in the compiler
  4347. so that the compiler's codegen stage does not work directly with basic
  4348. blocks. This prepares the code for changes to the underlying CFG
  4349. generation mechanism.
  4350. - gh-issue-95355: ``_PyPegen_Parser_New`` now properly detects token memory
  4351. allocation errors. Patch by Honglin Zhu.
  4352. - gh-issue-90081: Run Python code in tracer/profiler function at full speed.
  4353. Fixes slowdown in earlier versions of 3.11.
  4354. - gh-issue-95324: Emit a warning in debug mode if an object does not call
  4355. :c:func:`PyObject_GC_UnTrack` before deallocation. Patch by Pablo Galindo.
  4356. - gh-issue-95245: Merge managed dict and values pointer into a single tagged
  4357. pointer to save one word in the pre-header.
  4358. - gh-issue-93678: Add cfg_builder struct and refactor the relevant code so
  4359. that a cfg can be constructed without an instance of the compiler struct.
  4360. - gh-issue-95185: Prevented crashes in the AST constructor when compiling
  4361. some absurdly long expressions like ``"+0"*1000000``.
  4362. :exc:`RecursionError` is now raised instead. Patch by Pablo Galindo
  4363. - gh-issue-93351: :class:`ast.AST` node positions are now validated when
  4364. provided to :func:`compile` and other related functions. If invalid
  4365. positions are detected, a :exc:`ValueError` will be raised.
  4366. - gh-issue-94438: Fix an issue that caused extended opcode arguments and
  4367. some conditional pops to be ignored when calculating valid jump targets
  4368. for assignments to the ``f_lineno`` attribute of frame objects. In some
  4369. cases, this could cause inconsistent internal state, resulting in a hard
  4370. crash of the interpreter.
  4371. - gh-issue-95060: Undocumented ``PyCode_Addr2Location`` function now
  4372. properly returns when ``addrq`` argument is less than zero.
  4373. - gh-issue-95113: Replace all ``EXTENDED_ARG_QUICK`` instructions with basic
  4374. :opcode:`EXTENDED_ARG` instructions in unquickened code. Consumers of
  4375. non-adaptive bytecode should be able to handle extended arguments the same
  4376. way they were handled in CPython 3.10 and older.
  4377. - gh-issue-91409: Fix incorrect source location info caused by certain
  4378. optimizations in the bytecode compiler.
  4379. - gh-issue-95023: Implement :func:`os.setns` and :func:`os.unshare` for
  4380. Linux. Patch by Noam Cohen.
  4381. - gh-issue-94036: Fix incorrect source location info for some multi-line
  4382. attribute accesses and method calls.
  4383. - gh-issue-94938: Fix error detection in some builtin functions when keyword
  4384. argument name is an instance of a str subclass with overloaded ``__eq__``
  4385. and ``__hash__``. Previously it could cause SystemError or other undesired
  4386. behavior.
  4387. - gh-issue-94996: :func:`ast.parse` will no longer parse function
  4388. definitions with positional-only params when passed ``feature_version``
  4389. less than ``(3, 8)``. Patch by Shantanu Jain.
  4390. - gh-issue-94739: Allow jumping within, out of, and across exception
  4391. handlers in the debugger.
  4392. - gh-issue-94949: :func:`ast.parse` will no longer parse parenthesized
  4393. context managers when passed ``feature_version`` less than ``(3, 9)``.
  4394. Patch by Shantanu Jain.
  4395. - gh-issue-94947: :func:`ast.parse` will no longer parse assignment
  4396. expressions when passed ``feature_version`` less than ``(3, 8)``. Patch by
  4397. Shantanu Jain.
  4398. - gh-issue-91256: Ensures the program name is known for help text during
  4399. interpreter startup.
  4400. - gh-issue-94869: Fix the column offsets for some expressions in multi-line
  4401. f-strings :mod:`ast` nodes. Patch by Pablo Galindo.
  4402. - gh-issue-94893: Fix an issue where frame object manipulations could
  4403. corrupt inline bytecode caches.
  4404. - gh-issue-94822: Fix an issue where lookups of metaclass descriptors may be
  4405. ignored when an identically-named attribute also exists on the class
  4406. itself.
  4407. - gh-issue-91153: Fix an issue where a :class:`bytearray` item assignment
  4408. could crash if it's resized by the new value's :meth:`__index__` method.
  4409. - gh-issue-90699: Fix reference counting bug in :meth:`bool.__repr__`. Patch
  4410. by Kumar Aditya.
  4411. - gh-issue-94694: Fix an issue that could cause code with multi-line method
  4412. lookups to have misleading or incorrect column offset information. In some
  4413. cases (when compiling a hand-built AST) this could have resulted in a hard
  4414. crash of the interpreter.
  4415. - gh-issue-93252: Fix an issue that caused internal frames to outlive failed
  4416. Python function calls, possibly resulting in memory leaks or hard
  4417. interpreter crashes.
  4418. - gh-issue-94215: Fix an issue where exceptions raised by line-tracing
  4419. events would cause frames to be left in an invalid state, possibly
  4420. resulting in a hard crash of the interpreter.
  4421. - gh-issue-92228: Disable the compiler's inline-small-exit-blocks
  4422. optimization for exit blocks that are associated with source code lines.
  4423. This fixes a bug where the debugger cannot tell where an exception handler
  4424. ends and the following code block begins.
  4425. - gh-issue-94485: Line number of a module's ``RESUME`` instruction is set to
  4426. 0 as specified in :pep:`626`.
  4427. - gh-issue-94438: Account for instructions that can push NULL to the stack
  4428. when setting line number in a frame. Prevents some (unlikely) crashes.
  4429. - gh-issue-91719: Reload ``opcode`` when raising ``unknown opcode error`` in
  4430. the interpreter main loop, for C compilers to generate dispatching code
  4431. independently.
  4432. - gh-issue-94329: Compile and run code with unpacking of extremely large
  4433. sequences (1000s of elements). Such code failed to compile. It now
  4434. compiles and runs correctly.
  4435. - gh-issue-94360: Fixed a tokenizer crash when reading encoded files with
  4436. syntax errors from ``stdin`` with non utf-8 encoded text. Patch by Pablo
  4437. Galindo
  4438. - gh-issue-88116: Fix an issue when reading line numbers from code objects
  4439. if the encoded line numbers are close to ``INT_MIN``. Patch by Pablo
  4440. Galindo
  4441. - gh-issue-94262: Don't create frame objects for incomplete frames. Prevents
  4442. the creation of generators and closures from being observable to Python
  4443. and C extensions, restoring the behavior of 3.10 and earlier.
  4444. - gh-issue-94192: Fix error for dictionary literals with invalid expression
  4445. as value.
  4446. - gh-issue-87995: :class:`types.MappingProxyType` instances are now hashable
  4447. if the underlying mapping is hashable.
  4448. - gh-issue-93883: Revise the display strategy of traceback enhanced error
  4449. locations. The indicators are only shown when the location doesn't span
  4450. the whole line.
  4451. - gh-issue-94163: Add :opcode:`BINARY_SLICE` and :opcode:`STORE_SLICE`
  4452. instructions for more efficient handling and better specialization of
  4453. slicing operations, where the slice is explicit in the source code.
  4454. - gh-issue-94021: Fix unreachable code warning in ``Python/specialize.c``.
  4455. - gh-issue-93911: Specialize ``LOAD_ATTR`` for objects with custom
  4456. ``__getattribute__``.
  4457. - gh-issue-93955: Improve performance of attribute lookups on objects with
  4458. custom ``__getattribute__`` and ``__getattr__``. Patch by Ken Jin.
  4459. - gh-issue-93911: Specialize ``LOAD_ATTR`` for ``property()`` attributes.
  4460. - gh-issue-93678: Refactor compiler optimisation code so that it no longer
  4461. needs the ``struct assembler`` and ``struct compiler`` passed around.
  4462. Instead, each function takes the CFG and other data that it actually
  4463. needs. This will make it possible to test this code directly.
  4464. - gh-issue-93841: When built with ``-enable-pystats``, ``sys._stats_on()``,
  4465. ``sys._stats_off()``, ``sys._stats_clear()`` and ``sys._stats_dump()``
  4466. functions have been added to enable gathering stats for parts of programs.
  4467. - gh-issue-93516: Store offset of first traceable instruction in code object
  4468. to avoid having to recompute it for each instruction when tracing.
  4469. - gh-issue-93516: Lazily create a table mapping bytecode offsets to line
  4470. numbers to speed up calculation of line numbers when tracing.
  4471. - gh-issue-89828: :class:`types.GenericAlias` no longer relays the
  4472. ``__class__`` attribute. For example, ``isinstance(list[int], type)`` no
  4473. longer returns ``True``.
  4474. - gh-issue-93678: Refactor the compiler to reduce boilerplate and
  4475. repetition.
  4476. - gh-issue-93671: Fix some exponential backtrace case happening with deeply
  4477. nested sequence patterns in match statements. Patch by Pablo Galindo
  4478. - gh-issue-93662: Make sure that the end column offsets are correct in
  4479. multi-line method calls. Previously, the end column could precede the
  4480. column offset.
  4481. - gh-issue-93461: :func:`importlib.invalidate_caches` now drops entries from
  4482. :data:`sys.path_importer_cache` with a relative path as name. This solves
  4483. a caching issue when a process changes its current working directory.
  4484. ``FileFinder`` no longer inserts a dot in the path, e.g. ``/egg/./spam``
  4485. is now ``/egg/spam``.
  4486. - gh-issue-93621: Change order of bytecode instructions emitted for
  4487. :keyword:`with` and :keyword:`async with` to reduce the number of entries
  4488. in the exception table.
  4489. - gh-issue-93533: Reduce the size of the inline cache for ``LOAD_METHOD`` by
  4490. 2 bytes.
  4491. - gh-issue-93444: Removed redundant fields from the compiler's basicblock
  4492. struct: ``b_nofallthrough``, ``b_exit``, ``b_return``. They can be easily
  4493. calculated from the opcode of the last instruction of the block.
  4494. - gh-issue-93429: ``LOAD_METHOD`` instruction has been removed. It was
  4495. merged back into ``LOAD_ATTR``.
  4496. - gh-issue-93418: Fixed an assert where an f-string has an equal sign '='
  4497. following an expression, but there's no trailing brace. For example,
  4498. f"{i=".
  4499. - gh-issue-93382: Cache the result of :c:func:`PyCode_GetCode` function to
  4500. restore the *O*\ (1) lookup of the :attr:`~types.CodeType.co_code`
  4501. attribute.
  4502. - gh-issue-93359: Ensure that custom :mod:`ast` nodes without explicit end
  4503. positions can be compiled. Patch by Pablo Galindo.
  4504. - gh-issue-93356: Code for exception handlers is emitted at the end of the
  4505. code unit's bytecode. This avoids one jump when no exception is raised.
  4506. - gh-issue-93354: Use exponential backoff for specialization counters in the
  4507. interpreter. Can reduce the number of failed specializations significantly
  4508. and avoid slowdown for those parts of a program that are not suitable for
  4509. specialization.
  4510. - gh-issue-93283: Improve error message for invalid syntax of conversion
  4511. character in f-string expressions.
  4512. - gh-issue-93345: Fix a crash in substitution of a ``TypeVar`` in nested
  4513. generic alias after ``TypeVarTuple``.
  4514. - gh-issue-93223: When a bytecode instruction jumps to an unconditional jump
  4515. instruction, the first instruction can often be optimized to target the
  4516. unconditional jump's target directly. For tracing reasons, this would
  4517. previously only occur if both instructions have the same line number. This
  4518. also now occurs if the unconditional jump is artificial, i.e., if it has
  4519. no associated line number.
  4520. - gh-issue-84694: The ``--experimental-isolated-subinterpreters`` configure
  4521. option and ``EXPERIMENTAL_ISOLATED_SUBINTERPRETERS`` macro have been
  4522. removed.
  4523. - gh-issue-91924: Fix ``__lltrace__`` debug feature if the stdout encoding
  4524. is not UTF-8. Patch by Victor Stinner.
  4525. - gh-issue-93040: Wraps unused parameters in ``Objects/obmalloc.c`` with
  4526. ``Py_UNUSED``.
  4527. - gh-issue-93143: Avoid ``NULL`` checks for uninitialized local variables by
  4528. determining at compile time which variables must be initialized.
  4529. - gh-issue-93061: Backward jumps after ``async for`` loops are no longer
  4530. given dubious line numbers.
  4531. - gh-issue-93065: Fix contextvars HAMT implementation to handle iteration
  4532. over deep trees.
  4533. The bug was discovered and fixed by Eli Libman. See
  4534. `MagicStack/immutables#84
  4535. <https://github.com/MagicStack/immutables/issues/84>`_ for more details.
  4536. - gh-issue-93012: Added the new function :c:func:`PyType_FromMetaclass`,
  4537. which generalizes the existing :c:func:`PyType_FromModuleAndSpec` using an
  4538. additional metaclass argument. This is useful for language binding tools,
  4539. where it can be used to intercept type-related operations like subclassing
  4540. or static attribute access by specifying a metaclass with custom slots.
  4541. Importantly, :c:func:`PyType_FromMetaclass` is available in the Limited
  4542. API, which provides a path towards migrating more binding tools onto the
  4543. Stable ABI.
  4544. - gh-issue-93021: Fix the :attr:`__text_signature__` for :meth:`__get__`
  4545. methods implemented in C. Patch by Jelle Zijlstra.
  4546. - gh-issue-89914: The operand of the ``YIELD_VALUE`` instruction is set to
  4547. the stack depth. This is done to help frame handling on ``yield`` and may
  4548. assist debuggers.
  4549. - gh-issue-92955: Fix memory leak in code object's lines and positions
  4550. iterators as they were not finalized at exit. Patch by Kumar Aditya.
  4551. - gh-issue-92930: Fixed a crash in ``_pickle.c`` from mutating collections
  4552. during ``__reduce__`` or ``persistent_id``.
  4553. - gh-issue-90690: The PRECALL instruction has been removed. It offered only
  4554. a small advantage for specialization and is not needed in the vast
  4555. majority of cases.
  4556. - gh-issue-92914: Always round the allocated size for lists up to the
  4557. nearest even number.
  4558. - gh-issue-92858: Improve error message for some suites with syntax error
  4559. before ':'
  4560. - gh-issue-90473: Decrease default recursion limit on WASI to address
  4561. limited call stack size.
  4562. - gh-issue-92804: Fix memory leak in ``memoryview`` iterator as it was not
  4563. finalized at exit. Patch by Kumar Aditya.
  4564. - gh-issue-92777: Specialize ``LOAD_METHOD`` for objects with lazy
  4565. dictionaries. Patch by Ken Jin.
  4566. - gh-issue-92658: Add support for connecting and binding to Hyper-V sockets
  4567. on Windows Hyper-V hosts and guests.
  4568. - gh-issue-92236: Remove spurious "LINE" event when starting a generator or
  4569. coroutine, visible tracing functions implemented in C.
  4570. - gh-issue-91102: :meth:`_warnings.warn_explicit` is ported to Argument
  4571. Clinic.
  4572. - gh-issue-92619: Make the compiler duplicate an exit block only if none of
  4573. its instructions have a lineno (previously only the first instruction in
  4574. the block was checked, leading to unnecessarily duplicated blocks).
  4575. - gh-issue-88750: The deprecated debug build only ``PYTHONTHREADDEBUG``
  4576. environment variable no longer does anything.
  4577. - gh-issue-92261: Fix hang when trying to iterate over a ``typing.Union``.
  4578. - gh-issue-91432: Specialized the :opcode:`FOR_ITER` opcode using the PEP
  4579. 659 machinery
  4580. - gh-issue-91399: Removed duplicate '{0, 0, 0, 0, 0, 0}' entry in
  4581. 'Objects/unicodetype_db.h'.
  4582. - gh-issue-91578: Updates the error message for abstract class.
  4583. - bpo-47091: Improve performance of repetition of :class:`list` and
  4584. :class:`tuple` by using ``memcpy`` to copy data and performing the
  4585. reference increments in one step.
  4586. - bpo-46142: Make ``--help`` output shorter by moving some info to the new
  4587. ``--help-env`` and ``--help-xoptions`` command-line options. Also add
  4588. ``--help-all`` option to print complete usage.
  4589. - bpo-42316: Document some places where an assignment expression needs
  4590. parentheses.
  4591. Library
  4592. -------
  4593. - gh-issue-89237: Fix hang on Windows in ``subprocess.wait_closed()`` in
  4594. :mod:`asyncio` with :class:`~asyncio.ProactorEventLoop`. Patch by Kumar
  4595. Aditya.
  4596. - gh-issue-97928: :meth:`tkinter.Text.count` raises now an exception for
  4597. options starting with "-" instead of silently ignoring them.
  4598. - gh-issue-98393: The :mod:`os` module no longer accepts bytes-like paths,
  4599. like :class:`bytearray` and :class:`memoryview` types: only the exact
  4600. :class:`bytes` type is accepted for bytes strings. Patch by Victor
  4601. Stinner.
  4602. - gh-issue-98363: Added itertools.batched() to batch data into lists of a
  4603. given length with the last list possibly being shorter than the others.
  4604. - gh-issue-98331: Update the bundled copies of pip and setuptools to
  4605. versions 22.3 and 65.5.0 respectively.
  4606. - gh-issue-98307: A :meth:`~logging.handlers.SysLogHandler.createSocket`
  4607. method was added to :class:`~logging.handlers.SysLogHandler`.
  4608. - gh-issue-96035: Fix bug in :func:`urllib.parse.urlparse` that causes
  4609. certain port numbers containing whitespace, underscores, plus and minus
  4610. signs, or non-ASCII digits to be incorrectly accepted.
  4611. - gh-issue-98257: Make :func:`sys.setprofile` and :func:`sys.settrace`
  4612. functions reentrant. They can no long fail with: ``RuntimeError("Cannot
  4613. install a trace function while another trace function is being
  4614. installed")``. Patch by Victor Stinner.
  4615. - gh-issue-98251: Allow :mod:`venv` to pass along :envvar:`!PYTHON*`
  4616. variables to ``ensurepip`` and ``pip`` when they do not impact path
  4617. resolution
  4618. - gh-issue-94597: Deprecated
  4619. :meth:`asyncio.AbstractEventLoopPolicy.get_child_watcher` and
  4620. :meth:`asyncio.AbstractEventLoopPolicy.set_child_watcher` methods to be
  4621. removed in Python 3.14. Patch by Kumar Aditya.
  4622. - gh-issue-98178: On macOS, fix a crash in :func:`syslog.syslog` in
  4623. multi-threaded applications. On macOS, the libc ``syslog()`` function is
  4624. not thread-safe, so :func:`syslog.syslog` no longer releases the GIL to
  4625. call it. Patch by Victor Stinner.
  4626. - gh-issue-44098: Release the GIL when creating :class:`mmap.mmap` objects
  4627. on Unix.
  4628. - gh-issue-87730: Wrap network errors consistently in urllib FTP support, so
  4629. the test suite doesn't fail when a network is available but the public
  4630. internet is not reachable.
  4631. - gh-issue-94597: The child watcher classes
  4632. :class:`~asyncio.MultiLoopChildWatcher`,
  4633. :class:`~asyncio.FastChildWatcher` and :class:`~asyncio.SafeChildWatcher`
  4634. are deprecated and will be removed in Python 3.14. Patch by Kumar Aditya.
  4635. - gh-issue-98023: Change default child watcher to
  4636. :class:`~asyncio.PidfdChildWatcher` on Linux systems which supports it.
  4637. Patch by Kumar Aditya.
  4638. - gh-issue-90985: Earlier in 3.11 we deprecated
  4639. ``asyncio.Task.cancel("message")``. We realized we were too harsh, and
  4640. have undeprecated it.
  4641. - gh-issue-65961: Do not rely solely on ``__cached__`` on modules; code will
  4642. also support ``__spec__.cached``.
  4643. - gh-issue-97646: Replace deprecated ``application/javascript`` with
  4644. ``text/javascript`` in :mod:`mimetypes`. See :rfc:`9239`. Patch by Noam
  4645. Cohen.
  4646. - gh-issue-97930: Apply changes from importlib_resources 5.8 and 5.9:
  4647. ``Traversable.joinpath`` provides a concrete implementation. ``as_file``
  4648. now supports directories of resources.
  4649. - gh-issue-97850: Remove deprecated :func:`!importlib.util.set_loader` and
  4650. :func:`!importlib.util.module_for_loader` from :mod:`importlib.util`.
  4651. - gh-issue-97837: Change deprecate warning message in :mod:`unittest` from
  4652. ``It is deprecated to return a value!=None``
  4653. to
  4654. ``It is deprecated to return a value that is not None from a test case``
  4655. - gh-issue-97825: Fixes :exc:`AttributeError` when
  4656. :meth:`subprocess.check_output` is used with argument ``input=None`` and
  4657. either of the arguments *encoding* or *errors* are used.
  4658. - gh-issue-97008: :exc:`NameError` and :exc:`AttributeError` spelling
  4659. suggestions provided since :gh:`82711` are now also emitted by the pure
  4660. Python :mod:`traceback` module. Tests for those suggestions now exercise
  4661. both implementations to ensure they are equivalent. Patch by Carl
  4662. Friedrich Bolz-Tereick and Łukasz Langa.
  4663. - gh-issue-97799: :mod:`dataclass` now uses :func:`inspect.get_annotations`
  4664. to examine the annotations on class objects.
  4665. - gh-issue-97781: Removed deprecated interfaces in ``importlib.metadata``
  4666. (entry points accessed as dictionary, implicit dictionary construction of
  4667. sequence of ``EntryPoint`` objects, mutablility of ``EntryPoints`` result,
  4668. access of entry point by index). ``entry_points`` now has a simpler, more
  4669. straightforward API (returning ``EntryPoints``).
  4670. - gh-issue-96827: Avoid spurious tracebacks from :mod:`asyncio` when default
  4671. executor cleanup is delayed until after the event loop is closed (e.g. as
  4672. the result of a keyboard interrupt).
  4673. - gh-issue-95534: :meth:`gzip.GzipFile.read` reads 10% faster.
  4674. - gh-issue-97592: Avoid a crash in the C version of
  4675. :meth:`asyncio.Future.remove_done_callback` when an evil argument is
  4676. passed.
  4677. - gh-issue-97639: Remove ``tokenize.NL`` check from :mod:`tabnanny`.
  4678. - gh-issue-97545: Make Semaphore run faster.
  4679. - gh-issue-73588: Fix generation of the default name of
  4680. :class:`tkinter.Checkbutton`. Previously, checkbuttons in different parent
  4681. widgets could have the same short name and share the same state if
  4682. arguments "name" and "variable" are not specified. Now they are globally
  4683. unique.
  4684. - gh-issue-96865: fix Flag to use boundary CONFORM
  4685. This restores previous Flag behavior of allowing flags with non-sequential
  4686. values to be combined; e.g.
  4687. class Skip(Flag): TWO = 2 EIGHT = 8
  4688. Skip.TWO | Skip.EIGHT -> <Skip.TWO|EIGHT: 10>
  4689. - gh-issue-97005: Update bundled libexpat to 2.4.9
  4690. - gh-issue-85760: Fix race condition in :mod:`asyncio` where
  4691. :meth:`~asyncio.SubprocessProtocol.process_exited` called before the
  4692. :meth:`~asyncio.SubprocessProtocol.pipe_data_received` leading to
  4693. inconsistent output. Patch by Kumar Aditya.
  4694. - gh-issue-96704: Pass the correct ``contextvars.Context`` when a
  4695. ``asyncio`` exception handler is called on behalf of a task or callback
  4696. handle. This adds a new ``Task`` method, ``get_context``, and also a new
  4697. ``Handle`` method with the same name. If this method is not found on a
  4698. task object (perhaps because it is a third-party library that does not yet
  4699. provide this method), the context prevailing at the time the exception
  4700. handler is called is used.
  4701. - gh-issue-96819: Fixed check in :mod:`multiprocessing.resource_tracker`
  4702. that guarantees that the length of a write to a pipe is not greater than
  4703. ``PIPE_BUF``.
  4704. - gh-issue-95865: Reduce :func:`urllib.parse.quote_from_bytes` memory use on
  4705. large values.
  4706. Contributed by Dennis Sweeney.
  4707. - gh-issue-96741: Corrected type annotation for dataclass attribute
  4708. ``pstats.FunctionProfile.ncalls`` to be ``str``.
  4709. - gh-issue-96734: Update :mod:`unicodedata` database to Unicode 15.0.0.
  4710. - gh-issue-96735: Fix undefined behaviour in :func:`struct.unpack`.
  4711. - gh-issue-46412: Improve performance of ``bool(db)`` for large ndb/gdb
  4712. databases. Previously this would call ``len(db)`` which would iterate over
  4713. all keys -- the answer (empty or not) is known after the first key.
  4714. - gh-issue-96652: Fix the faulthandler implementation of
  4715. ``faulthandler.register(signal, chain=True)`` if the ``sigaction()``
  4716. function is not available: don't call the previous signal handler if it's
  4717. NULL. Patch by Victor Stinner.
  4718. - gh-issue-68163: Correct conversion of :class:`numbers.Rational`'s to
  4719. :class:`float`.
  4720. - gh-issue-96538: Speed up ``bisect.bisect()`` functions by taking advantage
  4721. of type-stability.
  4722. - gh-issue-96465: Fraction hashes are now cached.
  4723. - gh-issue-96079: In :mod:`typing`, fix missing field ``name`` and incorrect
  4724. ``__module__`` in _AnnotatedAlias.
  4725. - gh-issue-96415: Remove ``types._cell_factory`` from module namespace.
  4726. - gh-issue-95987: Fix ``repr`` of ``Any`` subclasses.
  4727. - gh-issue-96388: Work around missing socket functions in
  4728. :class:`~socket.socket`'s ``__repr__``.
  4729. - gh-issue-96385: Fix ``TypeVarTuple.__typing_prepare_subst__``.
  4730. ``TypeError`` was not raised when using more than one ``TypeVarTuple``,
  4731. like ``[*T, *V]`` in type alias substitutions.
  4732. - gh-issue-96142: Add ``match_args``, ``kw_only``, ``slots``, and
  4733. ``weakref_slot`` to ``_DataclassParams``.
  4734. - gh-issue-96073: In :mod:`inspect`, fix overeager replacement of
  4735. "``typing.``" in formatting annotations.
  4736. - gh-issue-89258: Added a :meth:`~logging.Logger.getChildren` method to
  4737. :class:`logging.Logger`, to get the immediate child loggers of a logger.
  4738. - gh-issue-96346: Use double caching for compiled RE patterns.
  4739. - gh-issue-96349: Fixed a minor performance regression in
  4740. :func:`threading.Event.__init__`
  4741. - gh-issue-90467: Fix :class:`asyncio.streams.StreamReaderProtocol` to keep
  4742. a strong reference to the created task, so that it's not garbage collected
  4743. - gh-issue-96172: Fix a bug in ``unicodedata``: ``east_asian_width`` used to
  4744. return the wrong value for unassigned characters; and for yet unassigned,
  4745. but reserved characters.
  4746. - gh-issue-96159: Fix a performance regression in logging
  4747. TimedRotatingFileHandler. Only check for special files when the rollover
  4748. time has passed.
  4749. - gh-issue-96175: Fix unused ``localName`` parameter in the ``Attr`` class
  4750. in :mod:`xml.dom.minidom`.
  4751. - gh-issue-96145: Add AttrDict to JSON module for use with object_hook.
  4752. - gh-issue-96052: Fix handling compiler warnings (SyntaxWarning and
  4753. DeprecationWarning) in :func:`codeop.compile_command` when checking for
  4754. incomplete input. Previously it emitted warnings and raised a SyntaxError.
  4755. Now it always returns ``None`` for incomplete input without emitting any
  4756. warnings.
  4757. - gh-issue-96125: Fix incorrect condition that causes
  4758. ``sys.thread_info.name`` to be wrong on pthread platforms.
  4759. - gh-issue-96019: Fix a bug in the ``makeunicodedata.py`` script leading to
  4760. about 13 KiB of space saving in the ``unicodedata`` module, specifically
  4761. the character decomposition data.
  4762. - gh-issue-95463: Remove an incompatible change from :issue:`28080` that
  4763. caused a regression that ignored the utf8 in ``ZipInfo.flag_bits``. Patch
  4764. by Pablo Galindo.
  4765. - gh-issue-69142: Add ``%:z`` strftime format code (generates tzoffset with
  4766. colons as separator), see :ref:`strftime-strptime-behavior`.
  4767. - gh-issue-95899: Fix :class:`asyncio.Runner` to call
  4768. :func:`asyncio.set_event_loop` only once to avoid calling
  4769. :meth:`~asyncio.AbstractChildWatcher.attach_loop` multiple times on child
  4770. watchers. Patch by Kumar Aditya.
  4771. - gh-issue-95736: Fix :class:`unittest.IsolatedAsyncioTestCase` to set event
  4772. loop before calling setup functions. Patch by Kumar Aditya.
  4773. - gh-issue-95865: Speed up :func:`urllib.parse.quote_from_bytes` by
  4774. replacing a list comprehension with ``map()``.
  4775. - gh-issue-95861: Add support for computing Spearman's correlation
  4776. coefficient to the existing statistics.correlation() function.
  4777. - gh-issue-95804: Fix ``logging`` shutdown handler so it respects
  4778. ``MemoryHandler.flushOnClose``.
  4779. - gh-issue-95704: When a task catches :exc:`asyncio.CancelledError` and
  4780. raises some other error, the other error should generally not silently be
  4781. suppressed.
  4782. - gh-issue-95149: The :class:`HTTPStatus <http.HTTPStatus>` enum offers a
  4783. couple of properties to indicate the HTTP status category e.g.
  4784. ``HTTPStatus.OK.is_success``.
  4785. - gh-issue-95609: Update bundled pip to 22.2.2.
  4786. - gh-issue-95289: Fix :class:`asyncio.TaskGroup` to propagate exception when
  4787. :exc:`asyncio.CancelledError` was replaced with another exception by a
  4788. context manger. Patch by Kumar Aditya and Guido van Rossum.
  4789. - gh-issue-94909: Fix incorrect joining of relative Windows paths with
  4790. drives in :class:`pathlib.PurePath` initializer.
  4791. - gh-issue-95385: Faster ``json.dumps()`` when sorting of keys is not
  4792. requested (default).
  4793. - gh-issue-83901: Improve :meth:`Signature.bind <inspect.Signature.bind>`
  4794. error message for missing keyword-only arguments.
  4795. - gh-issue-95339: Update bundled pip to 22.2.1.
  4796. - gh-issue-95045: Fix GC crash when deallocating ``_lsprof.Profiler`` by
  4797. untracking it before calling any callbacks. Patch by Kumar Aditya.
  4798. - gh-issue-95231: Fail gracefully if :const:`~errno.EPERM` or
  4799. :const:`~errno.ENOSYS` is raised when loading :mod:`crypt` methods. This
  4800. may happen when trying to load ``MD5`` on a Linux kernel with :abbr:`FIPS
  4801. (Federal Information Processing Standard)` enabled.
  4802. - gh-issue-95097: Fix :func:`asyncio.run` for :class:`asyncio.Task`
  4803. implementations without :meth:`~asyncio.Task.uncancel` method. Patch by
  4804. Kumar Aditya.
  4805. - gh-issue-95087: Fix IndexError in parsing invalid date in the :mod:`email`
  4806. module.
  4807. - gh-issue-95199: Upgrade bundled setuptools to 63.2.0.
  4808. - gh-issue-95194: Upgrade bundled pip to 22.2.
  4809. - gh-issue-93899: Fix check for existence of :const:`os.EFD_CLOEXEC`,
  4810. :const:`os.EFD_NONBLOCK` and :const:`os.EFD_SEMAPHORE` flags on older
  4811. kernel versions where these flags are not present. Patch by Kumar Aditya.
  4812. - gh-issue-95166: Fix :meth:`concurrent.futures.Executor.map` to cancel the
  4813. currently waiting on future on an error - e.g. TimeoutError or
  4814. KeyboardInterrupt.
  4815. - gh-issue-95132: Fix a :mod:`sqlite3` regression where ``*args`` and
  4816. ``**kwds`` were incorrectly relayed from :py:func:`~sqlite3.connect` to
  4817. the :class:`~sqlite3.Connection` factory. The regression was introduced in
  4818. 3.11a1 with PR 24421 (:gh:`85128`). Patch by Erlend E. Aasland.
  4819. - gh-issue-93157: Fix :mod:`fileinput` module didn't support ``errors``
  4820. option when ``inplace`` is true.
  4821. - gh-issue-91212: Fixed flickering of the turtle window when the tracer is
  4822. turned off. Patch by Shin-myoung-serp.
  4823. - gh-issue-95077: Add deprecation warning for enum ``member.member`` access
  4824. (e.g. ``Color.RED.BLUE``). Remove ``EnumMeta.__getattr__``.
  4825. - gh-issue-95109: Ensure that timeouts scheduled with
  4826. :class:`asyncio.Timeout` that have already expired are delivered promptly.
  4827. - gh-issue-95105: :meth:`wsgiref.types.InputStream.__iter__` should return
  4828. ``Iterator[bytes]``, not ``Iterable[bytes]``. Patch by Shantanu Jain.
  4829. - gh-issue-95066: Replaced assert with exception in :func:`ast.parse`, when
  4830. ``feature_version`` has an invalid major version. Patch by Shantanu Jain.
  4831. - gh-issue-77617: Add :mod:`sqlite3` :ref:`command-line interface
  4832. <sqlite3-cli>`. Patch by Erlend Aasland.
  4833. - gh-issue-95005: Replace :c:expr:`_PyAccu` with :c:expr:`_PyUnicodeWriter`
  4834. in JSON encoder and StringIO and remove the :c:expr:`_PyAccu`
  4835. implementation.
  4836. - gh-issue-90085: Remove ``-c/--clock`` and ``-t/--time`` CLI options of
  4837. :mod:`timeit`. The options had been deprecated since Python 3.3 and the
  4838. functionality was removed in Python 3.7. Patch by Shantanu Jain.
  4839. - gh-issue-94857: Fix refleak in ``_io.TextIOWrapper.reconfigure``. Patch by
  4840. Kumar Aditya.
  4841. - gh-issue-94821: Fix binding of unix socket to empty address on Linux to
  4842. use an available address from the abstract namespace, instead of "\0".
  4843. - gh-issue-94736: Fix crash when deallocating an instance of a subclass of
  4844. ``_multiprocessing.SemLock``. Patch by Kumar Aditya.
  4845. - gh-issue-81620: Add random.binomialvariate().
  4846. - gh-issue-74116: Allow :meth:`asyncio.StreamWriter.drain` to be awaited
  4847. concurrently by multiple tasks. Patch by Kumar Aditya.
  4848. - gh-issue-87822: When called with ``capture_locals=True``, the
  4849. :mod:`traceback` module functions swallow exceptions raised from calls to
  4850. ``repr()`` on local variables of frames. This is in order to prioritize
  4851. the original exception over rendering errors. An indication of the
  4852. failure is printed in place of the missing value. (Patch by Simon-Martin
  4853. Schroeder).
  4854. - gh-issue-88050: Fix :mod:`asyncio` subprocess transport to kill process
  4855. cleanly when process is blocked and avoid ``RuntimeError`` when loop is
  4856. closed. Patch by Kumar Aditya.
  4857. - gh-issue-94637: :meth:`SSLContext.set_default_verify_paths` now releases
  4858. the GIL around ``SSL_CTX_set_default_verify_paths`` call. The function
  4859. call performs I/O and CPU intensive work.
  4860. - gh-issue-94309: Deprecate aliases :class:`typing.Hashable` and
  4861. :class:`typing.Sized`
  4862. - gh-issue-92546: An undocumented ``python -m pprint`` benchmark is moved
  4863. into ``pprint`` suite of pyperformance. Patch by Oleg Iarygin.
  4864. - gh-issue-94607: Fix subclassing complex generics with type variables in
  4865. :mod:`typing`. Previously an error message saying ``Some type variables
  4866. ... are not listed in Generic[...]`` was shown. :mod:`typing` no longer
  4867. populates ``__parameters__`` with the ``__parameters__`` of a Python
  4868. class.
  4869. - gh-issue-94619: Remove the long-deprecated ``module_repr()`` from
  4870. :mod:`importlib`.
  4871. - gh-issue-93910: The ability to access the other values of an enum on an
  4872. enum (e.g. ``Color.RED.BLUE``) has been restored in order to fix a
  4873. performance regression.
  4874. - gh-issue-93896: Fix :func:`asyncio.run` and
  4875. :class:`unittest.IsolatedAsyncioTestCase` to always the set event loop as
  4876. it was done in Python 3.10 and earlier. Patch by Kumar Aditya.
  4877. - gh-issue-94343: Allow setting the attributes of ``reprlib.Repr`` during
  4878. object initialization
  4879. - gh-issue-94382: Port static types of ``_multiprocessing`` module to heap
  4880. types. Patch by Kumar Aditya.
  4881. - gh-issue-78724: Fix crash in :class:`struct.Struct` when it was not
  4882. completely initialized by initializing it in :meth:`~object.__new__`.
  4883. Patch by Kumar Aditya.
  4884. - gh-issue-94510: Re-entrant calls to :func:`sys.setprofile` and
  4885. :func:`sys.settrace` now raise :exc:`RuntimeError`. Patch by Pablo
  4886. Galindo.
  4887. - gh-issue-92336: Fix bug where :meth:`linecache.getline` fails on bad files
  4888. with :exc:`UnicodeDecodeError` or :exc:`SyntaxError`. It now returns an
  4889. empty string as per the documentation.
  4890. - gh-issue-94398: Once a :class:`asyncio.TaskGroup` has started shutting
  4891. down (i.e., at least one task has failed and the task group has started
  4892. cancelling the remaining tasks), it should not be possible to add new
  4893. tasks to the task group.
  4894. - gh-issue-94383: :mod:`xml.etree`: Remove the
  4895. ``ElementTree.Element.copy()`` method of the pure Python implementation,
  4896. deprecated in Python 3.10, use the :func:`copy.copy` function instead. The
  4897. C implementation of :mod:`xml.etree` has no ``copy()`` method, only a
  4898. ``__copy__()`` method. Patch by Victor Stinner.
  4899. - gh-issue-94379: :mod:`zipimport`: Remove ``find_loader()`` and
  4900. ``find_module()`` methods, deprecated in Python 3.10: use the
  4901. ``find_spec()`` method instead. See :pep:`451` for the rationale. Patch by
  4902. Victor Stinner.
  4903. - gh-issue-94352: :func:`shlex.split`: Passing ``None`` for *s* argument now
  4904. raises an exception, rather than reading :data:`sys.stdin`. The feature
  4905. was deprecated in Python 3.9. Patch by Victor Stinner.
  4906. - gh-issue-94318: Strip trailing spaces in :mod:`pydoc` text output.
  4907. - gh-issue-89988: Fix memory leak in :class:`pickle.Pickler` when looking up
  4908. :attr:`dispatch_table`. Patch by Kumar Aditya.
  4909. - gh-issue-90016: Deprecate :mod:`sqlite3` :ref:`default adapters and
  4910. converters <sqlite3-default-converters>`. Patch by Erlend E. Aasland.
  4911. - gh-issue-94254: Fixed types of :mod:`struct` module to be immutable. Patch
  4912. by Kumar Aditya.
  4913. - gh-issue-93259: Now raise ``ValueError`` when ``None`` or an empty string
  4914. are passed to ``Distribution.from_name`` (and other callers).
  4915. - gh-issue-74696: :func:`shutil.make_archive` now passes the *root_dir*
  4916. argument to custom archivers which support it.
  4917. - gh-issue-94216: The :mod:`dis` module now has the opcodes for pseudo
  4918. instructions (those which are used by the compiler during code generation
  4919. but then removed or replaced by real opcodes before the final bytecode is
  4920. emitted).
  4921. - gh-issue-93096: Removed undocumented ``python -m codecs``. Use ``python -m
  4922. unittest test.test_codecs.EncodedFileTest`` instead.
  4923. - gh-issue-94207: Made :class:`_struct.Struct` GC-tracked in order to fix a
  4924. reference leak in the :mod:`_struct` module.
  4925. - gh-issue-93096: Removed undocumented ``-t`` argument of ``python -m
  4926. base64``. Use ``python -m unittest
  4927. test.test_base64.LegacyBase64TestCase.test_encodebytes`` instead.
  4928. - gh-issue-94226: Remove the :func:`locale.format` function, deprecated in
  4929. Python 3.7: use :func:`locale.format_string` instead. Patch by Victor
  4930. Stinner.
  4931. - gh-issue-94199: Remove the :func:`ssl.match_hostname` function. The
  4932. :func:`ssl.match_hostname` was deprecated in Python 3.7. OpenSSL performs
  4933. hostname matching since Python 3.7, Python no longer uses the
  4934. :func:`ssl.match_hostname` function. Patch by Victor Stinner.
  4935. - gh-issue-94214: Document the ``context`` object used in the
  4936. ``venv.EnvBuilder`` class, and add the new environment's library path to
  4937. it.
  4938. - gh-issue-94199: Remove the :func:`ssl.wrap_socket` function, deprecated in
  4939. Python 3.7: instead, create a :class:`ssl.SSLContext` object and call its
  4940. :class:`ssl.SSLContext.wrap_socket` method. Any package that still uses
  4941. :func:`ssl.wrap_socket` is broken and insecure. The function neither sends
  4942. a SNI TLS extension nor validates server hostname. Code is subject to
  4943. `CWE-295 <https://cwe.mitre.org/data/definitions/295.html>`_: Improper
  4944. Certificate Validation. Patch by Victor Stinner.
  4945. - gh-issue-94199: Remove the :func:`ssl.RAND_pseudo_bytes` function,
  4946. deprecated in Python 3.6: use :func:`os.urandom` or :func:`ssl.RAND_bytes`
  4947. instead. Patch by Victor Stinner.
  4948. - gh-issue-94199: :mod:`hashlib`: Remove the pure Python implementation of
  4949. :func:`hashlib.pbkdf2_hmac()`, deprecated in Python 3.10. Python 3.10 and
  4950. newer requires OpenSSL 1.1.1 (:pep:`644`): this OpenSSL version provides a
  4951. C implementation of :func:`~hashlib.pbkdf2_hmac()` which is faster. Patch
  4952. by Victor Stinner.
  4953. - gh-issue-94196: :mod:`gzip`: Remove the ``filename`` attribute of
  4954. :class:`gzip.GzipFile`, deprecated since Python 2.6, use the
  4955. :attr:`~gzip.GzipFile.name` attribute instead. In write mode, the
  4956. ``filename`` attribute added ``'.gz'`` file extension if it was not
  4957. present. Patch by Victor Stinner.
  4958. - gh-issue-94182: run the :class:`asyncio.PidfdChildWatcher` on the running
  4959. loop, this allows event loops to run subprocesses when there is no default
  4960. event loop running on the main thread
  4961. - gh-issue-94169: Remove ``io.OpenWrapper`` and ``_pyio.OpenWrapper``,
  4962. deprecated in Python 3.10: just use :func:`open` instead. The :func:`open`
  4963. (:func:`io.open`) function is a built-in function. Since Python 3.10,
  4964. :func:`_pyio.open` is also a static method. Patch by Victor Stinner.
  4965. - gh-issue-91742: Fix :mod:`pdb` crash after jump caused by a null pointer
  4966. dereference. Patch by Kumar Aditya.
  4967. - gh-issue-94101: Manual instantiation of :class:`ssl.SSLSession` objects is
  4968. no longer allowed as it lead to misconfigured instances that crashed the
  4969. interpreter when attributes where accessed on them.
  4970. - gh-issue-84753: :func:`inspect.iscoroutinefunction`,
  4971. :func:`inspect.isgeneratorfunction`, and
  4972. :func:`inspect.isasyncgenfunction` now properly return ``True`` for
  4973. duck-typed function-like objects like instances of
  4974. :class:`unittest.mock.AsyncMock`.
  4975. This makes :func:`inspect.iscoroutinefunction` consistent with the
  4976. behavior of :func:`asyncio.iscoroutinefunction`. Patch by Mehdi ABAAKOUK.
  4977. - gh-issue-94028: Fix a regression in the :mod:`sqlite3` where statement
  4978. objects were not properly cleared and reset after use in cursor iters. The
  4979. regression was introduced by PR 27884 in Python 3.11a1. Patch by Erlend E.
  4980. Aasland.
  4981. - gh-issue-93973: Add keyword argument ``all_errors`` to
  4982. ``asyncio.create_connection`` so that multiple connection errors can be
  4983. raised as an ``ExceptionGroup``.
  4984. - gh-issue-93963: Officially deprecate from ``importlib.abc`` classes moved
  4985. to ``importlib.resources.abc``.
  4986. - gh-issue-93858: Prevent error when activating venv in nested fish
  4987. instances.
  4988. - gh-issue-93820: Pickle :class:`enum.Flag` by name.
  4989. - gh-issue-93847: Fix repr of enum of generic aliases.
  4990. - gh-issue-91404: Revert the :mod:`re` memory leak when a match is
  4991. terminated by a signal or memory allocation failure as the implemented fix
  4992. caused a major performance regression.
  4993. - gh-issue-83499: Fix double closing of file description in :mod:`tempfile`.
  4994. - gh-issue-93820: Fixed a regression when :func:`copy.copy`-ing
  4995. :class:`enum.Flag` with multiple flag members.
  4996. - gh-issue-79512: Fixed names and ``__module__`` value of :mod:`weakref`
  4997. classes :class:`~weakref.ReferenceType`, :class:`~weakref.ProxyType`,
  4998. :class:`~weakref.CallableProxyType`. It makes them pickleable.
  4999. - gh-issue-91389: Fix an issue where :mod:`dis` utilities could report
  5000. missing or incorrect position information in the presence of ``CACHE``
  5001. entries.
  5002. - gh-issue-93626: Set ``__future__.annotations`` to have a ``None``
  5003. mandatoryRelease to indicate that it is currently 'TBD'.
  5004. - gh-issue-90473: Emscripten and WASI have no home directory and cannot
  5005. provide :pep:`370` user site directory.
  5006. - gh-issue-90494: :func:`copy.copy` and :func:`copy.deepcopy` now always
  5007. raise a TypeError if ``__reduce__()`` returns a tuple with length 6
  5008. instead of silently ignore the 6th item or produce incorrect result.
  5009. - gh-issue-90549: Fix a multiprocessing bug where a global named resource
  5010. (such as a semaphore) could leak when a child process is spawned (as
  5011. opposed to forked).
  5012. - gh-issue-93521: Fixed a case where dataclasses would try to add
  5013. ``__weakref__`` into the ``__slots__`` for a dataclass that specified
  5014. ``weakref_slot=True`` when it was already defined in one of its bases.
  5015. This resulted in a ``TypeError`` upon the new class being created.
  5016. - gh-issue-79579: :mod:`sqlite3` now correctly detects DML queries with
  5017. leading comments. Patch by Erlend E. Aasland.
  5018. - gh-issue-93421: Update :data:`sqlite3.Cursor.rowcount` when a DML
  5019. statement has run to completion. This fixes the row count for SQL queries
  5020. like ``UPDATE ... RETURNING``. Patch by Erlend E. Aasland.
  5021. - gh-issue-93475: Expose ``FICLONE`` and ``FICLONERANGE`` constants in
  5022. :mod:`fcntl`. Patch by Illia Volochii.
  5023. - gh-issue-93370: Deprecate :data:`sqlite3.version` and
  5024. :data:`sqlite3.version_info`.
  5025. - gh-issue-91810: Suppress writing an XML declaration in open files in
  5026. ``ElementTree.write()`` with ``encoding='unicode'`` and
  5027. ``xml_declaration=None``.
  5028. - gh-issue-91162: Support splitting of unpacked arbitrary-length tuple over
  5029. ``TypeVar`` and ``TypeVarTuple`` parameters. For example:
  5030. * ``A[T, *Ts][*tuple[int, ...]]`` -> ``A[int, *tuple[int, ...]]``
  5031. * ``A[*Ts, T][*tuple[int, ...]]`` -> ``A[*tuple[int, ...], int]``
  5032. - gh-issue-93353: Fix the :func:`importlib.resources.as_file` context
  5033. manager to remove the temporary file if destroyed late during Python
  5034. finalization: keep a local reference to the :func:`os.remove` function.
  5035. Patch by Victor Stinner.
  5036. - gh-issue-83658: Make :class:`multiprocessing.Pool` raise an exception if
  5037. ``maxtasksperchild`` is not ``None`` or a positive int.
  5038. - gh-issue-93312: Add :const:`os.PIDFD_NONBLOCK` flag to open a file
  5039. descriptor for a process with :func:`os.pidfd_open` in non-blocking mode.
  5040. Patch by Kumar Aditya.
  5041. - gh-issue-88123: Implement Enum __contains__ that returns True or False to
  5042. replace the deprecated behaviour that would sometimes raise a TypeError.
  5043. - gh-issue-93297: Make asyncio task groups prevent child tasks from being
  5044. GCed
  5045. - gh-issue-85308: Changed :class:`argparse.ArgumentParser` to use
  5046. :term:`filesystem encoding and error handler` instead of default text
  5047. encoding to read arguments from file (e.g. ``fromfile_prefix_chars``
  5048. option). This change affects Windows; argument file should be encoded with
  5049. UTF-8 instead of ANSI Codepage.
  5050. - gh-issue-93156: Accessing the :attr:`pathlib.PurePath.parents` sequence of
  5051. an absolute path using negative index values produced incorrect results.
  5052. - gh-issue-93162: Add the ability for :func:`logging.config.dictConfig` to
  5053. usefully configure :class:`~logging.handlers.QueueHandler` and
  5054. :class:`~logging.handlers.QueueListener` as a pair, and add
  5055. :func:`logging.getHandlerByName` and :func:`logging.getHandlerNames` APIs
  5056. to allow access to handlers by name.
  5057. - gh-issue-93243: The :mod:`!smtpd` module was removed per the schedule in
  5058. :pep:`594`.
  5059. - gh-issue-92886: Replace ``assert`` statements with ``raise
  5060. AssertionError()`` in :class:`~wsgiref.BaseHandler` so that the tested
  5061. behaviour is maintained running with optimizations ``(-O)``.
  5062. - gh-issue-90155: Fix broken :class:`asyncio.Semaphore` when acquire is
  5063. cancelled.
  5064. - gh-issue-90817: The :func:`locale.resetlocale` function is deprecated and
  5065. will be removed in Python 3.13. Use ``locale.setlocale(locale.LC_ALL,
  5066. "")`` instead. Patch by Victor Stinner.
  5067. - gh-issue-91513: Added ``taskName`` attribute to :mod:`logging` module for
  5068. use with :mod:`asyncio` tasks.
  5069. - gh-issue-74696: :func:`shutil.make_archive` no longer temporarily changes
  5070. the current working directory during creation of standard ``.zip`` or tar
  5071. archives.
  5072. - gh-issue-92728: The :func:`re.template` function and the corresponding
  5073. :const:`re.TEMPLATE` and :const:`re.T` flags are restored after they were
  5074. removed in 3.11.0b1, but they are now deprecated, so they might be removed
  5075. from Python 3.13.
  5076. - gh-issue-93033: Search in some strings (platform dependent i.e [U+0xFFFF,
  5077. U+0x0100] on Windows or [U+0xFFFFFFFF, U+0x00010000] on Linux 64-bit) are
  5078. now up to 10 times faster.
  5079. - gh-issue-89973: Fix :exc:`re.error` raised in :mod:`fnmatch` if the
  5080. pattern contains a character range with upper bound lower than lower bound
  5081. (e.g. ``[c-a]``). Now such ranges are interpreted as empty ranges.
  5082. - gh-issue-93044: No longer convert the database argument of
  5083. :func:`sqlite3.connect` to bytes before passing it to the factory.
  5084. - gh-issue-93010: In a very special case, the email package tried to append
  5085. the nonexistent ``InvalidHeaderError`` to the defect list. It should have
  5086. been ``InvalidHeaderDefect``.
  5087. - gh-issue-92986: Fix :func:`ast.unparse` when ``ImportFrom.level`` is None
  5088. - gh-issue-92932: Now :func:`~dis.dis` and :func:`~dis.get_instructions`
  5089. handle operand values for instructions prefixed by ``EXTENDED_ARG_QUICK``.
  5090. Patch by Sam Gross and Donghee Na.
  5091. - gh-issue-92675: Fix :func:`venv.ensure_directories` to accept
  5092. :class:`pathlib.Path` arguments in addition to :class:`str` paths. Patch
  5093. by David Foster.
  5094. - gh-issue-87901: Removed the ``encoding`` argument from :func:`os.popen`
  5095. that was added in 3.11b1.
  5096. - gh-issue-91922: Fix function :func:`sqlite.connect` and the
  5097. :class:`sqlite.Connection` constructor on non-UTF-8 locales. Also, they
  5098. now support bytes paths non-decodable with the current FS encoding.
  5099. - gh-issue-92869: Added :class:`~ctypes.c_time_t` to :mod:`ctypes`, which
  5100. has the same size as the :c:type:`time_t` type in C.
  5101. - gh-issue-92839: Fixed crash resulting from calling bisect.insort() or
  5102. bisect.insort_left() with the key argument not equal to None.
  5103. - gh-issue-90473: :mod:`subprocess` now fails early on Emscripten and WASI
  5104. platforms to work around missing :func:`os.pipe` on WASI.
  5105. - gh-issue-89325: Removed many old deprecated :mod:`unittest` features:
  5106. :class:`~unittest.TestCase` method aliases, undocumented and broken
  5107. :class:`~unittest.TestCase` method ``assertDictContainsSubset``,
  5108. undocumented :meth:`TestLoader.loadTestsFromModule
  5109. <unittest.TestLoader.loadTestsFromModule>` parameter *use_load_tests*, and
  5110. an underscored alias of the :class:`~unittest.TextTestResult` class.
  5111. - gh-issue-92734: Allow multi-element reprs emitted by :mod:`reprlib` to be
  5112. pretty-printed using configurable indentation.
  5113. - gh-issue-92671: Fixed :func:`ast.unparse` for empty tuples in the
  5114. assignment target context.
  5115. - gh-issue-91581: :meth:`~datetime.datetime.utcfromtimestamp` no longer
  5116. attempts to resolve ``fold`` in the pure Python implementation, since the
  5117. fold is never 1 in UTC. In addition to being slightly faster in the common
  5118. case, this also prevents some errors when the timestamp is close to
  5119. :attr:`datetime.min <datetime.datetime.min>`. Patch by Paul Ganssle.
  5120. - gh-issue-86388: Removed randrange() functionality deprecated since Python
  5121. 3.10. Formerly, randrange(10.0) losslessly converted to randrange(10).
  5122. Now, it raises a TypeError. Also, the exception raised for non-integral
  5123. values such as randrange(10.5) or randrange('10') has been changed from
  5124. ValueError to TypeError.
  5125. - gh-issue-90385: Add :meth:`pathlib.Path.walk` as an alternative to
  5126. :func:`os.walk`.
  5127. - gh-issue-92550: Fix :meth:`pathlib.Path.rglob` for empty pattern.
  5128. - gh-issue-92591: Allow :mod:`logging` filters to return a
  5129. :class:`logging.LogRecord` instance so that filters attached to
  5130. :class:`logging.Handler`\ s can enrich records without side effects on
  5131. other handlers.
  5132. - gh-issue-92445: Fix a bug in :mod:`argparse` where ``nargs="*"`` would
  5133. raise an error instead of returning an empty list when 0 arguments were
  5134. supplied if choice was also defined in ``parser.add_argument``.
  5135. - gh-issue-92547: Remove undocumented :mod:`sqlite3` features deprecated in
  5136. Python 3.10:
  5137. * ``sqlite3.enable_shared_cache()``
  5138. * ``sqlite3.OptimizedUnicode``
  5139. Patch by Erlend E. Aasland.
  5140. - gh-issue-92530: Fix an issue that occurred after interrupting
  5141. :func:`threading.Condition.notify`.
  5142. - gh-issue-92531: The statistics.median_grouped() function now always return
  5143. a float. Formerly, it did not convert the input type when for sequences of
  5144. length one.
  5145. - gh-issue-84131: The :class:`pathlib.Path` deprecated method ``link_to``
  5146. has been removed. Use 3.10's :meth:`~pathlib.Path.hardlink_to` method
  5147. instead as its semantics are consistent with that of
  5148. :meth:`~pathlib.Path.symlink_to`.
  5149. - gh-issue-89336: Removed :mod:`configparser` module APIs: the
  5150. ``SafeConfigParser`` class alias, the ``ParsingError.filename`` property
  5151. and parameter, and the ``ConfigParser.readfp`` method, all of which were
  5152. deprecated since Python 3.2.
  5153. - gh-issue-92391: Add :meth:`~object.__class_getitem__` to
  5154. :class:`csv.DictReader` and :class:`csv.DictWriter`, allowing them to be
  5155. parameterized at runtime. Patch by Marc Mueller.
  5156. - gh-issue-91968: Add ``SO_RTABLE`` and ``SO_USER_COOKIE`` constants to
  5157. :mod:`socket`.
  5158. - gh-issue-91810: :class:`~xml.etree.ElementTree.ElementTree` method
  5159. :meth:`~xml.etree.ElementTree.ElementTree.write` and function
  5160. :func:`~xml.etree.ElementTree.tostring` now use the text file's encoding
  5161. ("UTF-8" if not available) instead of locale encoding in XML declaration
  5162. when ``encoding="unicode"`` is specified.
  5163. - gh-issue-81790: :func:`os.path.splitdrive` now understands DOS device
  5164. paths with UNC links (beginning ``\\?\UNC\``). Contributed by Barney Gale.
  5165. - gh-issue-91760: Apply more strict rules for numerical group references and
  5166. group names in regular expressions. Only sequence of ASCII digits is now
  5167. accepted as a numerical reference. The group name in bytes patterns and
  5168. replacement strings can now only contain ASCII letters and digits and
  5169. underscore.
  5170. - gh-issue-90622: Worker processes for
  5171. :class:`concurrent.futures.ProcessPoolExecutor` are no longer spawned on
  5172. demand (a feature added in 3.9) when the multiprocessing context start
  5173. method is ``"fork"`` as that can lead to deadlocks in the child processes
  5174. due to a fork happening while threads are running.
  5175. - gh-issue-91577: Move imports in :class:`~multiprocessing.SharedMemory`
  5176. methods to module level so that they can be executed late in python
  5177. finalization.
  5178. - gh-issue-91581: Remove an unhandled error case in the C implementation of
  5179. calls to :meth:`datetime.fromtimestamp <datetime.datetime.fromtimestamp>`
  5180. with no time zone (i.e. getting a local time from an epoch timestamp).
  5181. This should have no user-facing effect other than giving a possibly more
  5182. accurate error message when called with timestamps that fall on
  5183. 10000-01-01 in the local time. Patch by Paul Ganssle.
  5184. - gh-issue-91539: Improve performance of
  5185. ``urllib.request.getproxies_environment`` when there are many environment
  5186. variables
  5187. - gh-issue-91524: Speed up the regular expression substitution (functions
  5188. :func:`re.sub` and :func:`re.subn` and corresponding :class:`re.Pattern`
  5189. methods) for replacement strings containing group references by 2--3
  5190. times.
  5191. - gh-issue-91447: Fix findtext in the xml module to only give an empty
  5192. string when the text attribute is set to None.
  5193. - gh-issue-91456: Deprecate current default auto() behavior: In 3.13 the
  5194. default will be for for auto() to always return the largest member value
  5195. incremented by 1, and to raise if incompatible value types are used.
  5196. - bpo-47231: Fixed an issue with inconsistent trailing slashes in tarfile
  5197. longname directories.
  5198. - bpo-39064: :class:`zipfile.ZipFile` now raises :exc:`zipfile.BadZipFile`
  5199. instead of ``ValueError`` when reading a corrupt zip file in which the
  5200. central directory offset is negative.
  5201. - bpo-41287: Fix handling of the ``doc`` argument in subclasses of
  5202. :func:`property`.
  5203. - gh-issue-90005: :mod:`ctypes` dependency ``libffi`` is now detected with
  5204. ``pkg-config``.
  5205. - bpo-32547: The constructors for :class:`~csv.DictWriter` and
  5206. :class:`~csv.DictReader` now coerce the ``fieldnames`` argument to a
  5207. :class:`list` if it is an iterator.
  5208. - bpo-35540: Fix :func:`dataclasses.asdict` crash when
  5209. :class:`collections.defaultdict` is present in the attributes.
  5210. - bpo-47063: Add an index_pages parameter to support using non-default index
  5211. page names.
  5212. - bpo-47025: Drop support for :class:`bytes` on :data:`sys.path`.
  5213. - bpo-46951: Order the contents of zipapp archives, to make builds more
  5214. reproducible.
  5215. - bpo-42777: Implement :meth:`pathlib.Path.is_mount` for Windows paths.
  5216. - bpo-46755: In :class:`QueueHandler`, clear ``stack_info`` from
  5217. :class:`LogRecord` to prevent stack trace from being written twice.
  5218. - bpo-45393: Fix the formatting for ``await x`` and ``not x`` in the
  5219. operator precedence table when using the :func:`help` system.
  5220. - bpo-46642: Improve error message when trying to subclass an instance of
  5221. :data:`typing.TypeVar`, :data:`typing.ParamSpec`,
  5222. :data:`typing.TypeVarTuple`, etc. Based on patch by Gregory Beauregard.
  5223. - bpo-46364: Restrict use of sockets instead of pipes for stdin of
  5224. subprocesses created by :mod:`asyncio` to AIX platform only.
  5225. - bpo-28249: Set :attr:`doctest.DocTest.lineno` to ``None`` when object does
  5226. not have :attr:`__doc__`.
  5227. - bpo-46197: Fix :mod:`ensurepip` environment isolation for subprocess
  5228. running ``pip``.
  5229. - bpo-45924: Fix :mod:`asyncio` incorrect traceback when future's exception
  5230. is raised multiple times. Patch by Kumar Aditya.
  5231. - bpo-45046: Add support of context managers in :mod:`unittest`: methods
  5232. :meth:`~unittest.TestCase.enterContext` and
  5233. :meth:`~unittest.TestCase.enterClassContext` of class
  5234. :class:`~unittest.TestCase`, method
  5235. :meth:`~unittest.IsolatedAsyncioTestCase.enterAsyncContext` of class
  5236. :class:`~unittest.IsolatedAsyncioTestCase` and function
  5237. :func:`unittest.enterModuleContext`.
  5238. - bpo-44173: Enable fast seeking of uncompressed unencrypted
  5239. :class:`zipfile.ZipExtFile`
  5240. - bpo-42627: Fix incorrect parsing of Windows registry proxy settings
  5241. - bpo-42047: Add :func:`threading.get_native_id` support for DragonFly BSD.
  5242. Patch by David Carlier.
  5243. - bpo-14243: The :class:`tempfile.NamedTemporaryFile` function has a new
  5244. optional parameter *delete_on_close*
  5245. - bpo-41246: Give the same callback function for when the overlapped
  5246. operation is done to the functions ``recv``, ``recv_into``, ``recvfrom``,
  5247. ``sendto``, ``send`` and ``sendfile`` inside ``IocpProactor``.
  5248. - bpo-39264: Fixed :meth:`collections.UserDict.get` to not call
  5249. :meth:`__missing__` when a value is not found. This matches the behavior
  5250. of :class:`dict`. Patch by Bar Harel.
  5251. - bpo-38693: :mod:`importlib` now uses f-strings internally instead of
  5252. ``str.format``.
  5253. - bpo-38267: Add *timeout* parameter to
  5254. :meth:`asyncio.loop.shutdown_default_executor`. The default value is
  5255. ``None``, which means the executor will be given an unlimited amount of
  5256. time. When called from :class:`asyncio.Runner` or :func:`asyncio.run`, the
  5257. default timeout is 5 minutes.
  5258. - bpo-34828: :meth:`sqlite3.Connection.iterdump` now handles databases that
  5259. use ``AUTOINCREMENT`` in one or more tables.
  5260. - bpo-32990: Support reading wave files with the ``WAVE_FORMAT_EXTENSIBLE``
  5261. format in the :mod:`wave` module.
  5262. - bpo-26253: Allow adjustable compression level for tarfile streams in
  5263. :func:`tarfile.open`.
  5264. Documentation
  5265. -------------
  5266. - gh-issue-85525: Remove extra row
  5267. - gh-issue-86404: Deprecated tools ``make suspicious`` and ``rstlint.py``
  5268. are now removed. They have been replaced by `spinx-lint
  5269. <https://pypi.org/project/sphinx-lint/>`_.
  5270. - gh-issue-97741: Fix ``!`` in c domain ref target syntax via a ``conf.py``
  5271. patch, so it works as intended to disable ref target resolution.
  5272. - gh-issue-96432: Fraction literals now support whitespace around the
  5273. forward slash, ``Fraction('2 / 3')``.
  5274. - gh-issue-96098: Improve discoverability of the higher level
  5275. concurrent.futures module by providing clearer links from the lower level
  5276. threading and multiprocessing modules.
  5277. - gh-issue-95957: What's New 3.11 now has instructions for how to provide
  5278. compiler and linker flags for Tcl/Tk and OpenSSL on RHEL 7 and CentOS 7.
  5279. - gh-issue-95588: Clarified the conflicting advice given in the :mod:`ast`
  5280. documentation about :func:`ast.literal_eval` being "safe" for use on
  5281. untrusted input while at the same time warning that it can crash the
  5282. process. The latter statement is true and is deemed unfixable without a
  5283. large amount of work unsuitable for a bugfix. So we keep the warning and
  5284. no longer claim that ``literal_eval`` is safe.
  5285. - gh-issue-91207: Fix stylesheet not working in Windows CHM htmlhelp docs
  5286. and add warning that they are deprecated. Contributed by C.A.M. Gerlach.
  5287. - gh-issue-95454: Replaced incorrectly written true/false values in
  5288. documentiation. Patch by Robert O'Shea
  5289. - gh-issue-95451: Update library documentation with :ref:`availability
  5290. information <wasm-availability>` on WebAssembly platforms
  5291. ``wasm32-emscripten`` and ``wasm32-wasi``.
  5292. - gh-issue-95415: Use consistent syntax for platform availability. The
  5293. directive now supports a content body and emits a warning when it
  5294. encounters an unknown platform.
  5295. - gh-issue-94321: Document the :pep:`246` style protocol type
  5296. :class:`sqlite3.PrepareProtocol`.
  5297. - gh-issue-86128: Document a limitation in ThreadPoolExecutor where its exit
  5298. handler is executed before any handlers in atexit.
  5299. - gh-issue-61162: Clarify :mod:`sqlite3` behavior when
  5300. :ref:`sqlite3-connection-context-manager`.
  5301. - gh-issue-87260: Align :mod:`sqlite3` argument specs with the actual
  5302. implementation.
  5303. - gh-issue-86986: The minimum Sphinx version required to build the
  5304. documentation is now 3.2.
  5305. - gh-issue-88831: Augmented documentation of asyncio.create_task().
  5306. Clarified the need to keep strong references to tasks and added a code
  5307. snippet detailing how to do this.
  5308. - gh-issue-86438: Clarify that :option:`-W` and :envvar:`PYTHONWARNINGS` are
  5309. matched literally and case-insensitively, rather than as regular
  5310. expressions, in :mod:`warnings`.
  5311. - gh-issue-93031: Update tutorial introduction output to use 3.10+
  5312. SyntaxError invalid range.
  5313. - gh-issue-92240: Added release dates for "What's New in Python 3.X" for
  5314. 3.0, 3.1, 3.2, 3.8 and 3.10
  5315. - bpo-47161: Document that :class:`pathlib.PurePath` does not collapse
  5316. initial double slashes because they denote UNC paths.
  5317. - bpo-40838: Document that :func:`inspect.getdoc`,
  5318. :func:`inspect.getmodule`, and :func:`inspect.getsourcefile` might return
  5319. ``None``.
  5320. - bpo-43689: The ``Differ`` documentation now also mentions other whitespace
  5321. characters, which make it harder to understand the diff output.
  5322. - bpo-38056: Overhaul the :ref:`error-handlers` documentation in
  5323. :mod:`codecs`.
  5324. - bpo-13553: Document tkinter.Tk args.
  5325. Tests
  5326. -----
  5327. - gh-issue-95027: On Windows, when the Python test suite is run with the
  5328. ``-jN`` option, the ANSI code page is now used as the encoding for the
  5329. stdout temporary file, rather than using UTF-8 which can lead to decoding
  5330. errors. Patch by Victor Stinner.
  5331. - gh-issue-96624: Fixed the failure of repeated runs of
  5332. ``test.test_unittest`` caused by side effects in
  5333. ``test_dotted_but_module_not_loaded``.
  5334. - gh-issue-95243: Mitigate the inherent race condition from using
  5335. find_unused_port() in testSockName() by trying to find an unused port a
  5336. few times before failing. Patch by Ross Burton.
  5337. - gh-issue-95573: :source:`Lib/test/test_asyncio/test_ssl.py` exposed a bug
  5338. in the macOS kernel where intense concurrent load on non-blocking sockets
  5339. occasionally causes :const:`errno.ENOBUFS` ("No buffer space available")
  5340. to be emitted. FB11063974 filed with Apple, in the mean time as a
  5341. workaround buffer size used in tests on macOS is decreased to avoid
  5342. intermittent failures. Patch by Fantix King.
  5343. - gh-issue-95280: Fix problem with ``test_ssl`` ``test_get_ciphers`` on
  5344. systems that require perfect forward secrecy (PFS) ciphers.
  5345. - gh-issue-95212: Make multiprocessing test case
  5346. ``test_shared_memory_recreate`` parallel-safe.
  5347. - gh-issue-95218: Move tests for importlib.resources into
  5348. test_importlib.resources.
  5349. - gh-issue-93963: Updated tests to use preferred location for
  5350. ``importlib.resources`` ABCs.
  5351. - gh-issue-94675: Add a regression test for :mod:`re` exponentional slowdown
  5352. when using rjsmin.
  5353. - gh-issue-91330: Added more tests for :mod:`dataclasses` to cover behavior
  5354. with data descriptor-based fields.
  5355. - gh-issue-94208: ``test_ssl`` is now checking for supported TLS version and
  5356. protocols in more tests.
  5357. - gh-issue-94315: Tests now check for DAC override capability instead of
  5358. relying on :func:`os.geteuid`.
  5359. - gh-issue-54781: Rename test_tk to test_tkinter, and rename
  5360. test_ttk_guionly to test_ttk. Patch by Victor Stinner.
  5361. - gh-issue-93839: Move ``Lib/ctypes/test/`` to ``Lib/test/test_ctypes/``.
  5362. Patch by Victor Stinner.
  5363. - gh-issue-93951: In test_bdb.StateTestCase.test_skip, avoid including
  5364. auxiliary importers.
  5365. - gh-issue-93957: Provide nicer error reporting from subprocesses in
  5366. test_venv.EnsurePipTest.test_with_pip.
  5367. - gh-issue-93884: Add test cases for :c:func:`PyNumber_ToBase` that take a
  5368. large number or a non-int object as parameter.
  5369. - gh-issue-93852: test_asyncio, test_logging, test_socket and
  5370. test_socketserver now create AF_UNIX domains in the current directory to
  5371. no longer fail with ``OSError("AF_UNIX path too long")`` if the temporary
  5372. directory (the :envvar:`TMPDIR` environment variable) is too long. Patch
  5373. by Victor Stinner.
  5374. - gh-issue-93353: regrtest now checks if a test leaks temporary files or
  5375. directories if run with -jN option. Patch by Victor Stinner.
  5376. - gh-issue-84461: ``run_tests.py`` now handles cross compiling env vars
  5377. correctly and pass ``HOSTRUNNER`` to regression tests.
  5378. - gh-issue-93616: ``test_modulefinder`` now creates a temporary directory in
  5379. ``ModuleFinderTest.setUp()`` instead of module scope.
  5380. - gh-issue-93575: Fix issue with test_unicode test_raiseMemError. The test
  5381. case now use ``test.support.calcobjsize`` to calculate size of PyUnicode
  5382. structs. :func:`sys.getsizeof` may return different size when string has
  5383. UTF-8 memory.
  5384. - gh-issue-90473: WASI does not have a ``chmod(2)`` syscall.
  5385. :func:`os.chmod` is now a dummy function on WASI. Skip all tests that
  5386. depend on working :func:`os.chmod`.
  5387. - gh-issue-90473: Skip tests on WASI that require symlinks with absolute
  5388. paths.
  5389. - gh-issue-57539: Increase calendar test coverage for
  5390. :meth:`calendar.LocaleTextCalendar.formatweekday`.
  5391. - gh-issue-90473: Skip symlink tests on WASI. wasmtime uses ``openat2(2)``
  5392. with ``RESOLVE_BENEATH`` flag, which prevents symlinks with absolute
  5393. paths.
  5394. - gh-issue-89858: Fix ``test_embed`` for out-of-tree builds. Patch by Kumar
  5395. Aditya.
  5396. - gh-issue-92886: Fixing tests that fail when running with optimizations
  5397. (``-O``) in ``test_imaplib.py``.
  5398. - gh-issue-92886: Fixing tests that fail when running with optimizations
  5399. (``-O``) in ``test_zipimport.py``
  5400. - gh-issue-92886: Fixing tests that fail when running with optimizations
  5401. (``-O``) in ``test_py_compile.py``
  5402. - gh-issue-92886: Fixing tests that fail when running with optimizations
  5403. (``-O``) in ``test_sys_settrace.py``.
  5404. - gh-issue-92886: Fixing tests that fail when running with optimizations
  5405. (``-O``) in ``_test_multiprocessing.py``
  5406. - gh-issue-92670: Skip
  5407. ``test_shutil.TestCopy.test_copyfile_nonexistent_dir`` test on AIX as the
  5408. test uses a trailing slash to force the OS consider the path as a
  5409. directory, but on AIX the trailing slash has no effect and is considered
  5410. as a file.
  5411. - gh-issue-92514: Remove unused ``test.support.BasicTestRunner``. Patch by
  5412. Jelle Zijlstra.
  5413. - bpo-47016: Create a GitHub Actions workflow for verifying bundled pip and
  5414. setuptools. Patch by Illia Volochii and Adam Turner.
  5415. Build
  5416. -----
  5417. - gh-issue-96761: Fix the build process of clang compiler for
  5418. :program:`_bootstrap_python` if LTO optimization is applied. Patch by
  5419. Matthias Görgens and Donghee Na.
  5420. - gh-issue-96883: ``wasm32-emscripten`` builds for browsers now include
  5421. :mod:`concurrent.futures` for :mod:`asyncio` and :mod:`unittest.mock`.
  5422. - gh-issue-85936: CPython now uses the ThinLTO option as the default policy
  5423. if the Clang compiler accepts the flag. Patch by Donghee Na.
  5424. - gh-issue-96729: Ensure that Windows releases built with
  5425. ``Tools\msi\buildrelease.bat`` are upgradable to and from official Python
  5426. releases.
  5427. - gh-issue-96269: Shared module targets now depend on new ``MODULE_DEPS``
  5428. variable, which includes ``EXPORTSYMS``. This fixes a build order issue on
  5429. unsupported AIX platform.
  5430. - gh-issue-84461: ``wasm32-emscripten`` platform no longer builds
  5431. :mod:`resource` module, :func:`~os.getresuid`, :func:`~os.getresgid`, and
  5432. their setters. The APIs are stubs and not functional.
  5433. - gh-issue-95973: Add a new ``--with-dsymutil`` configure option to link
  5434. debug information in macOS. Patch by Pablo Galindo.
  5435. - gh-issue-90536: Use the BOLT post-link optimizer to improve performance,
  5436. particularly on medium-to-large applications.
  5437. - gh-issue-93744: Remove the ``configure --with-cxx-main`` build option: it
  5438. didn't work for many years. Remove the ``MAINCC`` variable from
  5439. ``configure`` and ``Makefile``. Patch by Victor Stinner.
  5440. - gh-issue-94801: Fix a regression in ``configure`` script that caused some
  5441. header checks to ignore custom ``CPPFLAGS``. The regression was introduced
  5442. in :gh:`94802`.
  5443. - gh-issue-95145: wasm32-wasi builds no longer depend on WASIX's pthread
  5444. stubs. Python now has its own stubbed pthread API.
  5445. - gh-issue-95174: Python now detects missing ``dup`` function in WASI and
  5446. works around some missing :mod:`errno`, :mod:`select`, and :mod:`socket`
  5447. constants.
  5448. - gh-issue-95174: Python now skips missing :mod:`socket` functions and
  5449. methods on WASI. WASI can only create sockets from existing fd / accept
  5450. and has no netdb.
  5451. - gh-issue-95085: Platforms ``wasm32-unknown-emscripten`` and
  5452. ``wasm32-unknown-wasi`` have been promoted to :pep:`11` tier 3 platform
  5453. support.
  5454. - gh-issue-94847: Fixed ``_decimal`` module build issue on GCC when
  5455. compiling with LTO and pydebug. Debug builds no longer force inlining of
  5456. functions.
  5457. - gh-issue-94841: Fix the possible performance regression of
  5458. :c:func:`PyObject_Free` compiled with MSVC version 1932.
  5459. - gh-issue-94801: ``configure`` now uses custom flags like ``ZLIB_CFLAGS``
  5460. and ``ZLIB_LIBS`` when searching for headers and libraries.
  5461. - gh-issue-94773: ``deepfreeze.py`` now supports code object with frozensets
  5462. that contain incompatible, unsortable types.
  5463. - gh-issue-94682: Build and test with OpenSSL 1.1.1q
  5464. - gh-issue-90005: Dependencies of :mod:`readline` and :mod:`curses` module
  5465. are now detected in ``configure`` script with ``pkg-config``. Only
  5466. ``ncurses`` / ``ncursesw`` are detected automatically. The old ``curses``
  5467. library is not configured automatically. Workaround for missing
  5468. ``termcap`` or ``tinfo`` library has been removed.
  5469. - gh-issue-90005: Fix building ``_ctypes`` extension without ``pkg-config``.
  5470. - gh-issue-90005: ``_dbm`` module dependencies are now detected by
  5471. configure.
  5472. - gh-issue-94404: ``makesetup`` now works around an issue with sed on macOS
  5473. and uses correct CFLAGS for object files that end up in a shared
  5474. extension. Module CFLAGS are used before PY_STDMODULE_CFLAGS to avoid
  5475. clashes with system headers.
  5476. - gh-issue-93939: C extension modules are now built by ``configure`` and
  5477. ``make`` instead of ``distutils`` and ``setup.py``.
  5478. - gh-issue-93939: The ``2to3``, ``idle``, and ``pydoc`` scripts are now
  5479. generated and installed by ``Makefile`` instead of ``setup.py``.
  5480. - gh-issue-94280: Updated pegen regeneration script on Windows to find and
  5481. use Python 3.9 or higher. Prior to this, pegen regeneration already
  5482. required 3.9 or higher, but the script may have used lower versions of
  5483. Python.
  5484. - gh-issue-93584: Address race condition in ``Makefile`` when installing a
  5485. PGO build. All ``test`` and ``install`` targets now depend on ``all``
  5486. target.
  5487. - gh-issue-93491: ``configure`` now detects and reports :pep:`11` support
  5488. tiers.
  5489. - gh-issue-69093: Fix ``Modules/Setup.stdlib.in`` rule for ``_sqlite3``
  5490. extension.
  5491. - gh-issue-93207: ``va_start()`` with two parameters, like ``va_start(args,
  5492. format),`` is now required to build Python. ``va_start()`` is no longer
  5493. called with a single parameter. Patch by Kumar Aditya.
  5494. - gh-issue-93202: Python now always use the ``%zu`` and ``%zd`` printf
  5495. formats to format a :c:type:`size_t` or ``Py_ssize_t`` number. Building
  5496. Python 3.12 requires a C11 compiler, so these printf formats are now
  5497. always supported. Patch by Victor Stinner.
  5498. - gh-issue-90473: Disable pymalloc and increase stack size on
  5499. ``wasm32-wasi``.
  5500. - bpo-34449: Drop invalid compiler switch ``-fPIC`` for HP aCC on HP-UX.
  5501. Patch by Michael Osipov.
  5502. Windows
  5503. -------
  5504. - gh-issue-98360: Fixes :mod:`multiprocessing` spawning child processes on
  5505. Windows from a virtual environment to ensure that child processes that
  5506. also use :mod:`multiprocessing` to spawn more children will recognize that
  5507. they are in a virtual environment.
  5508. - gh-issue-98414: Fix :file:`py.exe` launcher handling of
  5509. :samp:`-V:{<company>}/` option when default preferences have been set in
  5510. environment variables or configuration files.
  5511. - gh-issue-97728: Fix possible crashes caused by the use of uninitialized
  5512. variables when pass invalid arguments in :func:`os.system` on Windows and
  5513. in Windows-specific modules (like ``winreg``).
  5514. - gh-issue-90989: Made :ref:`launcher` install per-user by default (unless
  5515. an all users install already exists), and clarify some text in the
  5516. installer.
  5517. - gh-issue-97649: The ``Tools`` directory is no longer installed on Windows
  5518. - gh-issue-96965: Update libffi to 3.4.3
  5519. - gh-issue-96577: Fixes a potential buffer overrun in :mod:`msilib`.
  5520. - gh-issue-96559: Fixes the Windows launcher not using the compatible
  5521. interpretation of default tags found in configuration files when no tag
  5522. was passed to the command.
  5523. - gh-issue-94781: Fix :file:`pcbuild.proj` to clean previous instances of
  5524. output files in ``Python\deepfreeze`` and ``Python\frozen_modules``
  5525. directories on Windows. Patch by Charlie Zhao.
  5526. - gh-issue-89545: Updates :mod:`platform` code getting the Windows version
  5527. to use native Windows Management Instrumentation (WMI) queries to
  5528. determine OS version, type, and architecture.
  5529. - gh-issue-95733: Make certain requirements of the Windows Store package
  5530. optional to allow installing on earlier updates of Windows.
  5531. - gh-issue-95656: Enable the
  5532. :meth:`~sqlite3.Connection.enable_load_extension` :mod:`sqlite3` API.
  5533. - gh-issue-95587: Fixes some issues where the Windows installer would
  5534. incorrectly detect certain features of an existing install when upgrading.
  5535. - gh-issue-94399: Restores the behaviour of :ref:`launcher` for
  5536. ``/usr/bin/env`` shebang lines, which will now search :envvar:`PATH` for
  5537. an executable matching the given command. If none is found, the usual
  5538. search process is used.
  5539. - gh-issue-95445: Fixes the unsuccessful removal of the HTML document
  5540. directory when uninstalling with Windows msi.
  5541. - gh-issue-95359: Fix :ref:`launcher` handling of :file:`py.ini` commands
  5542. (it was incorrectly expecting a ``py_`` prefix on keys) and crashes when
  5543. reading per-user configuration file.
  5544. - gh-issue-95285: Fix :ref:`launcher` handling of command lines where it is
  5545. only passed a short executable name.
  5546. - gh-issue-90844: Allow virtual environments to correctly launch when they
  5547. have spaces in the path.
  5548. - gh-issue-94772: Fix incorrect handling of shebang lines in py.exe launcher
  5549. - gh-issue-94018: :mod:`zipfile` will now remove trailing spaces from path
  5550. components when extracting files on Windows.
  5551. - gh-issue-93824: Drag and drop of files onto Python files in Windows
  5552. Explorer has been enabled for Windows ARM64.
  5553. - gh-issue-43414: :func:`os.get_terminal_size` now attempts to read the size
  5554. from any provided handle, rather than only supporting file descriptors 0,
  5555. 1 and 2.
  5556. - gh-issue-92817: Ensures that :file:`py.exe` will prefer an active virtual
  5557. environment over default tags specified with environment variables or
  5558. through a :file:`py.ini` file.
  5559. - gh-issue-92984: Explicitly disable incremental linking for non-Debug
  5560. builds
  5561. - gh-issue-92841: :mod:`asyncio` no longer throws ``RuntimeError: Event loop
  5562. is closed`` on interpreter exit after asynchronous socket activity. Patch
  5563. by Oleg Iarygin.
  5564. - bpo-46907: Update Windows installer to use SQLite 3.38.4.
  5565. - gh-issue-91061: Accept os.PathLike for the argument to winsound.PlaySound
  5566. - bpo-42658: Support native Windows case-insensitive path comparisons by
  5567. using ``LCMapStringEx`` instead of :func:`str.lower` in
  5568. :func:`ntpath.normcase`. Add ``LCMapStringEx`` to the :mod:`_winapi`
  5569. module.
  5570. - bpo-38704: Prevent installation on unsupported Windows versions.
  5571. macOS
  5572. -----
  5573. - gh-issue-97897: The macOS 13 SDK includes support for the ``mkfifoat`` and
  5574. ``mknodat`` system calls. Using the ``dir_fd`` option with either
  5575. :func:`os.mkfifo` or :func:`os.mknod` could result in a segfault if
  5576. cpython is built with the macOS 13 SDK but run on an earlier version of
  5577. macOS. Prevent this by adding runtime support for detection of these
  5578. system calls ("weaklinking") as is done for other newer syscalls on macOS.
  5579. IDLE
  5580. ----
  5581. - gh-issue-97527: Fix a bug in the previous bugfix that caused IDLE to not
  5582. start when run with 3.10.8, 3.12.0a1, and at least Microsoft Python
  5583. 3.10.2288.0 installed without the Lib/test package. 3.11.0 was never
  5584. affected.
  5585. - gh-issue-65802: Document handling of extensions in Save As dialogs.
  5586. - gh-issue-95191: Include prompts when saving Shell (interactive input and
  5587. output).
  5588. - gh-issue-95511: Fix the Shell context menu copy-with-prompts bug of
  5589. copying an extra line when one selects whole lines.
  5590. - gh-issue-95471: In the Edit menu, move ``Select All`` and add a new
  5591. separator.
  5592. - gh-issue-95411: Enable using IDLE's module browser with .pyw files.
  5593. - gh-issue-89610: Add .pyi as a recognized extension for IDLE on macOS.
  5594. This allows opening stub files by double clicking on them in the Finder.
  5595. Tools/Demos
  5596. -----------
  5597. - gh-issue-68686: Remove ptags and eptags scripts.
  5598. - gh-issue-97681: Remove the ``Tools/demo/`` directory which contained old
  5599. demo scripts. A copy can be found in the `old-demos project
  5600. <https://github.com/gvanrossum/old-demos>`_. Patch by Victor Stinner.
  5601. - gh-issue-97669: Remove outdated example scripts of the ``Tools/scripts/``
  5602. directory. A copy can be found in the `old-demos project
  5603. <https://github.com/gvanrossum/old-demos>`_. Patch by Victor Stinner.
  5604. - gh-issue-95853: The ``wasm_build.py`` script now pre-builds Emscripten
  5605. ports, checks for broken EMSDK versions, and warns about pkg-config env
  5606. vars.
  5607. - gh-issue-95853: The new tool ``Tools/wasm/wasm_builder.py`` automates
  5608. configure, compile, and test steps for building CPython on WebAssembly
  5609. platforms.
  5610. - gh-issue-95731: Fix handling of module docstrings in
  5611. :file:`Tools/i18n/pygettext.py`.
  5612. - gh-issue-93939: Add script ``Tools/scripts/check_modules.py`` to check and
  5613. validate builtin and shared extension modules. The script also handles
  5614. ``Modules/Setup`` and will eventually replace ``setup.py``.
  5615. - gh-issue-94538: Fix Argument Clinic output to custom file destinations.
  5616. Patch by Erlend E. Aasland.
  5617. - gh-issue-94430: Allow parameters named ``module`` and ``self`` with custom
  5618. C names in Argument Clinic. Patch by Erlend E. Aasland
  5619. - gh-issue-86087: The ``Tools/scripts/parseentities.py`` script used to
  5620. parse HTML4 entities has been removed.
  5621. C API
  5622. -----
  5623. - gh-issue-98393: The :c:func:`PyUnicode_FSDecoder` function no longer
  5624. accepts bytes-like paths, like :class:`bytearray` and :class:`memoryview`
  5625. types: only the exact :class:`bytes` type is accepted for bytes strings.
  5626. Patch by Victor Stinner.
  5627. - gh-issue-91051: Add :c:func:`PyType_Watch` and related APIs to allow
  5628. callbacks on :c:func:`PyType_Modified`.
  5629. - gh-issue-95756: Lazily create and cache ``co_`` attributes for better
  5630. performance for code getters.
  5631. - gh-issue-96512: Configuration for the :ref:`integer string conversion
  5632. length limitation <int_max_str_digits>` now lives in the PyConfig C API
  5633. struct.
  5634. - gh-issue-95589: Extensions classes that set ``tp_dictoffset`` and
  5635. ``tp_weaklistoffset`` lose the support for multiple inheritance, but are
  5636. now safe. Extension classes should use :c:macro:`Py_TPFLAGS_MANAGED_DICT`
  5637. and :c:macro:`Py_TPFLAGS_MANAGED_WEAKREF` instead.
  5638. - gh-issue-95781: An unrecognized format character in
  5639. :c:func:`PyUnicode_FromFormat` and :c:func:`PyUnicode_FromFormatV` now
  5640. sets a :exc:`SystemError`. In previous versions it caused all the rest of
  5641. the format string to be copied as-is to the result string, and any extra
  5642. arguments discarded.
  5643. - gh-issue-92678: Restore the 3.10 behavior for multiple inheritance of C
  5644. extension classes that store their dictionary at the end of the struct.
  5645. - gh-issue-92678: Support C extensions using managed dictionaries by setting
  5646. the ``Py_TPFLAGS_MANAGED_DICT`` flag.
  5647. - gh-issue-93274: API for implementing vectorcall
  5648. (:c:macro:`Py_TPFLAGS_HAVE_VECTORCALL`, :c:func:`PyVectorcall_NARGS` and
  5649. :c:func:`PyVectorcall_Call`) was added to the limited API and stable ABI.
  5650. - gh-issue-95504: Fix sign placement when specifying width or precision in
  5651. :c:func:`PyUnicode_FromFormat` and :c:func:`PyUnicode_FromFormatV`. Patch
  5652. by Philip Georgi.
  5653. - gh-issue-93012: The :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now
  5654. removed from a class when the class's :py:meth:`~object.__call__` method
  5655. is reassigned. This makes vectorcall safe to use with mutable types (i.e.
  5656. heap types without the :const:`immutable <Py_TPFLAGS_IMMUTABLETYPE>`
  5657. flag). Mutable types that do not override
  5658. :c:member:`~PyTypeObject.tp_call` now inherit the
  5659. :c:macro:`Py_TPFLAGS_HAVE_VECTORCALL` flag.
  5660. - gh-issue-95388: Creating :c:macro:`immutable types
  5661. <Py_TPFLAGS_IMMUTABLETYPE>` with mutable bases is deprecated and is
  5662. planned to be disabled in Python 3.14.
  5663. - gh-issue-92678: Adds unstable C-API functions
  5664. ``_PyObject_VisitManagedDict`` and ``_PyObject_ClearManagedDict`` to allow
  5665. C extensions to allow the VM to manage their object's dictionaries.
  5666. - gh-issue-94936: Added :c:func:`PyCode_GetVarnames`,
  5667. :c:func:`PyCode_GetCellvars` and :c:func:`PyCode_GetFreevars` for
  5668. accessing ``co_varnames``, ``co_cellvars`` and ``co_freevars``
  5669. respectively via the C API.
  5670. - gh-issue-94930: Fix ``SystemError`` raised when
  5671. :c:func:`PyArg_ParseTupleAndKeywords` is used with ``#`` in ``(...)`` but
  5672. without ``PY_SSIZE_T_CLEAN`` defined.
  5673. - gh-issue-94731: Python again uses C-style casts for most casting
  5674. operations when compiled with C++. This may trigger compiler warnings, if
  5675. they are enabled with e.g. ``-Wold-style-cast`` or
  5676. ``-Wzero-as-null-pointer-constant`` options for ``g++``.
  5677. - gh-issue-93937: The following frame functions and type are now directly
  5678. available with ``#include <Python.h>``, it's no longer needed to add
  5679. ``#include <frameobject.h>``:
  5680. * :c:func:`PyFrame_Check`
  5681. * :c:func:`PyFrame_GetBack`
  5682. * :c:func:`PyFrame_GetBuiltins`
  5683. * :c:func:`PyFrame_GetGenerator`
  5684. * :c:func:`PyFrame_GetGlobals`
  5685. * :c:func:`PyFrame_GetLasti`
  5686. * :c:func:`PyFrame_GetLocals`
  5687. * :c:type:`PyFrame_Type`
  5688. Patch by Victor Stinner.
  5689. - gh-issue-91321: Fix the compatibility of the Python C API with C++ older
  5690. than C++11. Patch by Victor Stinner.
  5691. - gh-issue-91731: Avoid defining the ``static_assert`` when compiling with
  5692. C++ 11, where this is a keyword and redefining it can lead to undefined
  5693. behavior. Patch by Pablo Galindo
  5694. - gh-issue-89546: :c:func:`PyType_FromMetaclass` (and other ``PyType_From*``
  5695. functions) now check that offsets and the base class's
  5696. :c:member:`~PyTypeObject.tp_basicsize` fit in the new class's
  5697. ``tp_basicsize``.
  5698. - gh-issue-93503: Add two new public functions to the public C-API,
  5699. :c:func:`PyEval_SetProfileAllThreads` and
  5700. :c:func:`PyEval_SetTraceAllThreads`, that allow to set tracing and
  5701. profiling functions in all running threads in addition to the calling one.
  5702. Also, two analogous functions to the :mod:`threading` module
  5703. (:func:`threading.setprofile_all_threads` and
  5704. :func:`threading.settrace_all_threads`) that allow to do the same from
  5705. Python. Patch by Pablo Galindo
  5706. - gh-issue-93442: Add C++ overloads for _Py_CAST_impl() to handle 0/NULL.
  5707. This will allow C++ extensions that pass 0 or NULL to macros using
  5708. _Py_CAST() to continue to compile.
  5709. - gh-issue-93466: Slot IDs in PyType_Spec may not be repeated. The
  5710. documentation was updated to mention this. For some cases of repeated
  5711. slots, PyType_FromSpec and related functions will now raise an exception.
  5712. - gh-issue-92898: Fix C++ compiler warnings when casting function arguments
  5713. to ``PyObject*``. Patch by Serge Guelton.
  5714. - gh-issue-93103: Deprecate global configuration variables, like
  5715. :c:var:`Py_IgnoreEnvironmentFlag`, in the documentation: the
  5716. :c:func:`Py_InitializeFromConfig` API should be instead. Patch by Victor
  5717. Stinner.
  5718. - gh-issue-77782: Deprecate global configuration variable like
  5719. :c:var:`Py_IgnoreEnvironmentFlag`: the :c:func:`Py_InitializeFromConfig`
  5720. API should be instead. Patch by Victor Stinner.
  5721. - gh-issue-92913: Ensures changes to
  5722. :c:member:`PyConfig.module_search_paths` are ignored unless
  5723. :c:member:`PyConfig.module_search_paths_set` is set
  5724. - gh-issue-92781: Avoid mixing declarations and code in the C API to fix the
  5725. compiler warning: "ISO C90 forbids mixed declarations and code"
  5726. [-Werror=declaration-after-statement]. Patch by Victor Stinner.
  5727. - gh-issue-92651: Remove the ``token.h`` header file. There was never any
  5728. public tokenizer C API. The ``token.h`` header file was only designed to
  5729. be used by Python internals. Patch by Victor Stinner.
  5730. - gh-issue-92536: Remove legacy Unicode APIs based on ``Py_UNICODE*``.
  5731. - gh-issue-85858: Remove the ``PyUnicode_InternImmortal()`` function and the
  5732. ``SSTATE_INTERNED_IMMORTAL`` macro. Patch by Victor Stinner.
  5733. - gh-issue-92193: Add new function :c:func:`PyFunction_SetVectorcall` to the
  5734. C API which sets the vectorcall field of a given
  5735. :c:type:`PyFunctionObject`.
  5736. Warning: extensions using this API must preserve the behavior of the
  5737. unaltered function!
  5738. - gh-issue-59121: Fixed an assert that prevented ``PyRun_InteractiveOne``
  5739. from providing tracebacks when parsing from the provided FD.
  5740. - bpo-45383: The :c:func:`PyType_FromSpec` API will now find and use a
  5741. metaclass based on the provided bases. An error will be raised if there is
  5742. a metaclass conflict.
  5743. What's New in Python 3.11.0 beta 1?
  5744. ===================================
  5745. *Release date: 2022-05-06*
  5746. Security
  5747. --------
  5748. - gh-issue-57684: Add the :option:`-P` command line option and the
  5749. :envvar:`PYTHONSAFEPATH` environment variable to not prepend a potentially
  5750. unsafe path to :data:`sys.path`. Patch by Victor Stinner.
  5751. Core and Builtins
  5752. -----------------
  5753. - gh-issue-89519: Chaining classmethod descriptors (introduced in bpo-19072)
  5754. is deprecated. It can no longer be used to wrap other descriptors such as
  5755. property(). The core design of this feature was flawed, and it caused a
  5756. number of downstream problems.
  5757. - gh-issue-92345: ``pymain_run_python()`` now imports ``readline`` and
  5758. ``rlcompleter`` before sys.path is extended to include the current working
  5759. directory of an interactive interpreter. Non-interactive interpreters are
  5760. not affected.
  5761. - bpo-43857: Improve the :exc:`AttributeError` message when deleting a
  5762. missing attribute. Patch by Géry Ogam.
  5763. - gh-issue-92245: Make sure that PEP 523 is respected in all cases. In
  5764. 3.11a7, specialization may have prevented Python-to-Python calls
  5765. respecting PEP 523.
  5766. - gh-issue-92203: Add a closure keyword-only parameter to exec(). It can
  5767. only be specified when exec-ing a code object that uses free variables.
  5768. When specified, it must be a tuple, with exactly the number of cell
  5769. variables referenced by the code object. closure has a default value of
  5770. None, and it must be None if the code object doesn't refer to any free
  5771. variables.
  5772. - gh-issue-91173: Disable frozen modules in debug builds. Patch by Kumar
  5773. Aditya.
  5774. - gh-issue-92114: Improve error message when subscript a type with
  5775. ``__class_getitem__`` set to ``None``.
  5776. - gh-issue-92112: Fix crash triggered by an evil custom ``mro()`` on a
  5777. metaclass.
  5778. - gh-issue-92063: The ``PRECALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS``
  5779. instruction now ensures methods are called only on objects of the correct
  5780. type.
  5781. - gh-issue-92031: Deoptimize statically allocated code objects during
  5782. ``Py_FINALIZE()`` so that future ``_PyCode_Quicken`` calls always start
  5783. with unquickened code.
  5784. - gh-issue-92036: Fix a crash in subinterpreters related to the garbage
  5785. collector. When a subinterpreter is deleted, untrack all objects tracked
  5786. by its GC. To prevent a crash in deallocator functions expecting objects
  5787. to be tracked by the GC, leak a strong reference to these objects on
  5788. purpose, so they are never deleted and their deallocator functions are not
  5789. called. Patch by Victor Stinner.
  5790. - gh-issue-92032: The interpreter can now autocomplete soft keywords, as of
  5791. now ``match``, ``case``, and ``_`` (wildcard pattern) from :pep:`634`.
  5792. - gh-issue-87999: The warning emitted by the Python parser for a numeric
  5793. literal immediately followed by keyword has been changed from deprecation
  5794. warning to syntax warning.
  5795. - gh-issue-91869: Fix an issue where specialized opcodes with extended
  5796. arguments could produce incorrect tracing output or lead to assertion
  5797. failures.
  5798. - gh-issue-91603: Speed up :class:`types.UnionType` instantiation. Based on
  5799. patch provided by Yurii Karabas.
  5800. - gh-issue-89373: If Python is built in debug mode, Python now ensures that
  5801. deallocator functions leave the current exception unchanged. Patch by
  5802. Victor Stinner.
  5803. - gh-issue-91632: Fix a minor memory leak at exit: release the memory of the
  5804. :class:`generic_alias_iterator` type. Patch by Donghee Na.
  5805. - gh-issue-81548: Octal escapes with value larger than ``0o377`` now produce
  5806. a :exc:`DeprecationWarning`. In a future Python version they will be a
  5807. :exc:`SyntaxWarning` and eventually a :exc:`SyntaxError`.
  5808. - bpo-43950: Use a single compact table for line starts, ends and column
  5809. offsets. Reduces memory consumption for location info by half
  5810. - gh-issue-91102: Use Argument Clinic for :class:`EncodingMap`. Patch by
  5811. Oleg Iarygin.
  5812. - gh-issue-91636: Fixed a crash in a garbage-collection edge-case, in which
  5813. a ``PyFunction_Type.tp_clear`` function could leave a python function
  5814. object in an inconsistent state.
  5815. - gh-issue-91603: Speed up :func:`isinstance` and :func:`issubclass` checks
  5816. for :class:`types.UnionType`. Patch by Yurii Karabas.
  5817. - gh-issue-91625: Fixed a bug in which adaptive opcodes ignored any
  5818. preceding ``EXTENDED_ARG``\ s on specialization failure.
  5819. - gh-issue-78607: The LLTRACE special build now looks for the name
  5820. ``__lltrace__`` defined in module globals, rather than the name
  5821. ``__ltrace__``, which had been introduced as a typo.
  5822. - gh-issue-91576: Speed up iteration of ascii strings by 50%. Patch by Kumar
  5823. Aditya.
  5824. - gh-issue-89279: Improve interpreter performance on Windows by inlining a
  5825. few specific macros.
  5826. - gh-issue-91502: Add a new :c:func:`_PyFrame_IsEntryFrame` API function, to
  5827. check if a :c:type:`PyFrameObject` is an entry frame. Patch by Pablo
  5828. Galindo.
  5829. - gh-issue-91266: Refactor the ``bytearray`` strip methods ``strip``,
  5830. ``lstrip`` and ``rstrip`` to use a common implementation.
  5831. - gh-issue-91479: Replaced the ``__note__`` field of :exc:`BaseException`
  5832. (added in an earlier version of 3.11) with the final design of :pep:`678`.
  5833. Namely, :exc:`BaseException` gets an :meth:`add_note` method, and its
  5834. ``__notes__`` field is created when necessary.
  5835. - gh-issue-46055: Speed up right shift of negative integers, by removing
  5836. unnecessary creation of temporaries. Original patch by Xinhang Xu,
  5837. reworked by Mark Dickinson.
  5838. - gh-issue-91462: Make the interpreter's low-level tracing (lltrace) feature
  5839. output more readable by displaying opcode names (rather than just
  5840. numbers), and by displaying stack contents before each opcode.
  5841. - gh-issue-89455: Fixed an uninitialized bool value in the traceback
  5842. printing code path that was introduced by the initial bpo-45292 exception
  5843. groups work.
  5844. - gh-issue-91421: Fix a potential integer overflow in _Py_DecodeUTF8Ex.
  5845. - gh-issue-91428: Add ``static const char *const _PyOpcode_OpName[256] =
  5846. {...};`` to ``opcode.h`` for debug builds to assist in debugging the
  5847. Python interpreter. It is now more convenient to make various forms of
  5848. debugging output more human-readable by including opcode names rather than
  5849. just the corresponding decimal digits.
  5850. - bpo-47120: Make :opcode:`POP_JUMP_IF_TRUE`, :opcode:`POP_JUMP_IF_FALSE`,
  5851. :opcode:`POP_JUMP_IF_NONE` and :opcode:`POP_JUMP_IF_NOT_NONE` virtual,
  5852. mapping to new relative jump opcodes.
  5853. - bpo-45317: Add internal documentation explaining design of new (for 3.11)
  5854. frame stack.
  5855. - bpo-47197: ctypes used to mishandle ``void`` return types, so that for
  5856. instance a function declared like ``ctypes.CFUNCTYPE(None, ctypes.c_int)``
  5857. would be called with signature ``int f(int)`` instead of ``void f(int)``.
  5858. Wasm targets require function pointers to be called with the correct
  5859. signatures so this led to crashes. The problem is now fixed.
  5860. - bpo-47120: Make opcodes :opcode:`!JUMP_IF_TRUE_OR_POP` and
  5861. :opcode:`!JUMP_IF_FALSE_OR_POP` relative rather than absolute.
  5862. - bpo-47177: Replace the ``f_lasti`` member of the internal
  5863. ``_PyInterpreterFrame`` structure with a ``prev_instr`` pointer, which
  5864. reduces overhead in the main interpreter loop. The ``f_lasti`` attribute
  5865. of Python-layer frame objects is preserved for backward-compatibility.
  5866. - bpo-46961: Integer mod/remainder operations, including the three-argument
  5867. form of :func:`pow`, now consistently return ints from the global small
  5868. integer cache when applicable.
  5869. - bpo-46962: Classes and functions that unconditionally declared their
  5870. docstrings ignoring the ``--without-doc-strings`` compilation flag no
  5871. longer do so.
  5872. The classes affected are :class:`ctypes.UnionType`,
  5873. :class:`pickle.PickleBuffer`, :class:`testcapi.RecursingInfinitelyError`,
  5874. and :class:`types.GenericAlias`.
  5875. The functions affected are 24 methods in :mod:`ctypes`.
  5876. Patch by Oleg Iarygin.
  5877. - bpo-46942: Use Argument Clinic for the :class:`types.MethodType`
  5878. constructor. Patch by Oleg Iarygin.
  5879. - bpo-46764: Fix wrapping bound methods with @classmethod
  5880. - bpo-43464: Optimize :meth:`set.intersection` for non-set arguments.
  5881. - bpo-46721: Optimize :meth:`set.issuperset` for non-set argument.
  5882. - bpo-46509: Add type-specialized versions of the ``Py_DECREF()``, and use
  5883. them for ``float``, ``int``, ``str``, ``bool``, and ``None`` to avoid
  5884. pointer-chasing at runtime where types are known at C compile time.
  5885. - bpo-46045: Do not use POSIX semaphores on NetBSD
  5886. - bpo-36819: Fix crashes in built-in encoders with error handlers that
  5887. return position less or equal than the starting position of non-encodable
  5888. characters.
  5889. - bpo-34093: ``marshal.dumps()`` uses ``FLAG_REF`` for all interned strings.
  5890. This makes output more deterministic and helps reproducible build.
  5891. - bpo-26579: Added ``object.__getstate__`` which provides the default
  5892. implementation of the ``__getstate__()`` method.
  5893. Copying and pickling instances of subclasses of builtin types bytearray,
  5894. set, frozenset, collections.OrderedDict, collections.deque,
  5895. weakref.WeakSet, and datetime.tzinfo now copies and pickles instance
  5896. attributes implemented as slots.
  5897. Library
  5898. -------
  5899. - gh-issue-87901: Add the *encoding* parameter to :func:`os.popen`.
  5900. - gh-issue-90997: Fix an issue where :mod:`dis` utilities may interpret
  5901. populated inline cache entries as valid instructions.
  5902. - gh-issue-92332: Deprecate :class:`typing.Text` (removal of the class is
  5903. currently not planned). Patch by Alex Waygood.
  5904. - Deprecate nested classes in enum definitions becoming members -- in 3.13
  5905. they will be normal classes; add ``member`` and ``nonmember`` functions to
  5906. allow control over results now.
  5907. - gh-issue-92356: Fixed a performance regression in ctypes function calls.
  5908. - gh-issue-90997: Show the actual named values stored in inline caches when
  5909. ``show_caches=True`` is passed to :mod:`dis` utilities.
  5910. - gh-issue-92301: Prefer ``close_range()`` to iterating over procfs for file
  5911. descriptor closing in :mod:`subprocess` for better performance.
  5912. - gh-issue-67248: Sort the miscellaneous topics in Cmd.do_help()
  5913. - gh-issue-92210: Port ``socket.__init__`` to Argument Clinic. Patch by
  5914. Cinder.
  5915. - gh-issue-80010: Add support for generalized ISO 8601 parsing to
  5916. :meth:`datetime.datetime.fromisoformat`,
  5917. :meth:`datetime.date.fromisoformat` and
  5918. :meth:`datetime.time.fromisoformat`. Patch by Paul Ganssle.
  5919. - gh-issue-92118: Fix a 3.11 regression in
  5920. :func:`~contextlib.contextmanager`, which caused it to propagate
  5921. exceptions with incorrect tracebacks.
  5922. - gh-issue-90887: Adding ``COPYFILE_STAT``, ``COPYFILE_ACL`` and
  5923. ``COPYFILE_XATTR`` constants for :func:`os.fcopyfile` available in macOs.
  5924. - gh-issue-91215: For @dataclass, add weakref_slot. Default is False. If
  5925. True, and if slots=True, add a slot named "__weakref__", which will allow
  5926. instances to be weakref'd. Contributed by Eric V. Smith
  5927. - gh-issue-85984: New function os.login_tty() for Unix.
  5928. - gh-issue-92128: Add :meth:`~object.__class_getitem__` to
  5929. :class:`logging.LoggerAdapter` and :class:`logging.StreamHandler`,
  5930. allowing them to be parameterized at runtime. Patch by Alex Waygood.
  5931. - gh-issue-92049: Forbid pickling constants ``re._constants.SUCCESS`` etc.
  5932. Previously, pickling did not fail, but the result could not be unpickled.
  5933. - gh-issue-92062: :class:`inspect.Parameter` now raises :exc:`ValueError` if
  5934. ``name`` is a keyword, in addition to the existing check that it is an
  5935. identifier.
  5936. - gh-issue-87390: Add an ``__unpacked__`` attribute to
  5937. :class:`types.GenericAlias`. Patch by Jelle Zijlstra.
  5938. - gh-issue-88089: Add support for generic :class:`typing.NamedTuple`.
  5939. - gh-issue-91996: New http.HTTPMethod enum to represent all the available
  5940. HTTP request methods in a convenient way
  5941. - gh-issue-91984: Modified test strings in test_argparse.py to not contain
  5942. trailing spaces before end of line.
  5943. - gh-issue-91952: Add ``encoding="locale"`` support to
  5944. :meth:`TextIOWrapper.reconfigure`.
  5945. - gh-issue-91954: Add *encoding* and *errors* arguments to
  5946. :func:`subprocess.getoutput` and :func:`subprocess.getstatusoutput`.
  5947. - bpo-47029: Always close the read end of the pipe used by
  5948. :class:`multiprocessing.Queue` *after* the last write of buffered data to
  5949. the write end of the pipe to avoid :exc:`BrokenPipeError` at garbage
  5950. collection and at :meth:`multiprocessing.Queue.close` calls. Patch by Géry
  5951. Ogam.
  5952. - gh-issue-91928: Add ``datetime.UTC`` alias for ``datetime.timezone.utc``.
  5953. Patch by Kabir Kwatra.
  5954. - gh-issue-68966: The :mod:`mailcap` module is now deprecated and will be
  5955. removed in Python 3.13. See :pep:`594` for the rationale and the
  5956. :mod:`mimetypes` module for an alternative. Patch by Victor Stinner.
  5957. - gh-issue-91401: Provide a way to disable :mod:`subprocess` use of
  5958. ``vfork()`` just in case it is ever needed and document the existing
  5959. mechanism for ``posix_spawn()``.
  5960. - gh-issue-64783: Fix :const:`signal.NSIG` value on FreeBSD to accept signal
  5961. numbers greater than 32, like :const:`signal.SIGRTMIN` and
  5962. :const:`signal.SIGRTMAX`. Patch by Victor Stinner.
  5963. - gh-issue-91910: Add missing f prefix to f-strings in error messages from
  5964. the :mod:`multiprocessing` and :mod:`asyncio` modules.
  5965. - gh-issue-91860: Add :func:`typing.dataclass_transform`, implementing
  5966. :pep:`681`. Patch by Jelle Zijlstra.
  5967. - gh-issue-91832: Add ``required`` attribute to :class:`argparse.Action`
  5968. repr output.
  5969. - gh-issue-91827: In the :mod:`tkinter` module add method
  5970. ``info_patchlevel()`` which returns the exact version of the Tcl library
  5971. as a named tuple similar to :data:`sys.version_info`.
  5972. - gh-issue-84461: Add :option:`--enable-wasm-pthreads` to enable pthreads
  5973. support for WASM builds. ``Emscripten/node`` no longer has threading
  5974. enabled by default. Include additional file systems.
  5975. - gh-issue-91821: Fix unstable ``test_from_tuple`` test in
  5976. ``test_decimal.py``.
  5977. - gh-issue-91217: Deprecate the xdrlib module.
  5978. - gh-issue-91217: Deprecate the uu module.
  5979. - gh-issue-91760: More strict rules will be applied for numerical group
  5980. references and group names in regular expressions. For now, a deprecation
  5981. warning is emitted for group references and group names which will be
  5982. errors in future Python versions.
  5983. - gh-issue-84461: Add provisional :data:`sys._emscripten_info` named tuple
  5984. with build-time and run-time information about Emscripten platform.
  5985. - gh-issue-90623: :func:`signal.raise_signal` and :func:`os.kill` now check
  5986. immediately for pending signals. Patch by Victor Stinner.
  5987. - gh-issue-91734: Fix OSS audio support on Solaris.
  5988. - gh-issue-90633: Include the passed value in the exception thrown by
  5989. :func:`typing.assert_never`. Patch by Jelle Zijlstra.
  5990. - gh-issue-91700: Compilation of regular expression containing a conditional
  5991. expression ``(?(group)...)`` now raises an appropriate :exc:`re.error` if
  5992. the group number refers to not defined group. Previously an internal
  5993. RuntimeError was raised.
  5994. - gh-issue-91231: Add an optional keyword *shutdown_timeout* parameter to
  5995. the :class:`multiprocessing.BaseManager` constructor. Kill the process if
  5996. terminate() takes longer than the timeout. Patch by Victor Stinner.
  5997. - gh-issue-91621: Fix :func:`typing.get_type_hints` for
  5998. :class:`collections.abc.Callable`. Patch by Shantanu Jain.
  5999. - gh-issue-90568: Parsing ``\N`` escapes of Unicode Named Character
  6000. Sequences in a :mod:`regular expression <re>` raises now :exc:`re.error`
  6001. instead of ``TypeError``.
  6002. - gh-issue-91670: Remove deprecated ``SO`` config variable in
  6003. :mod:`sysconfig`.
  6004. - gh-issue-91217: Deprecate the telnetlib module.
  6005. - gh-issue-91217: Deprecate the sunau module.
  6006. - gh-issue-91217: Deprecate the spwd module.
  6007. - gh-issue-91217: Deprecate the sndhdr module, as well as inline needed
  6008. functionality for ``email.mime.MIMEAudio``.
  6009. - gh-issue-91616: :mod:`re` module, fix :meth:`~re.Pattern.fullmatch`
  6010. mismatch when using Atomic Grouping or Possessive Quantifiers.
  6011. - gh-issue-91217: Deprecate the 'pipes' module.
  6012. - gh-issue-91217: Deprecate the ossaudiodev module.
  6013. - bpo-47256: :mod:`re` module, limit the maximum capturing group to
  6014. 1,073,741,823 in 64-bit build, this increases the depth of backtracking.
  6015. - gh-issue-91217: Deprecate the nis module.
  6016. - gh-issue-91595: Fix the comparison of character and integer inside
  6017. :func:`Tools.gdb.libpython.write_repr`. Patch by Yu Liu.
  6018. - gh-issue-74166: Add option to raise all errors from
  6019. :meth:`~socket.create_connection` in an :exc:`ExceptionGroup` when it
  6020. fails to create a connection. The default remains to raise only the last
  6021. error that had occurred when multiple addresses were tried.
  6022. - gh-issue-91487: Optimize asyncio UDP speed, over 100 times faster when
  6023. transferring a large file.
  6024. - gh-issue-91575: Update case-insensitive matching in the :mod:`re` module
  6025. to the latest Unicode version.
  6026. - gh-issue-90622: In ``concurrent.futures.process.ProcessPoolExecutor``
  6027. disallow the "fork" multiprocessing start method when the new
  6028. ``max_tasks_per_child`` feature is used as the mix of threads+fork can
  6029. hang the child processes. Default to using the safe "spawn" start method
  6030. in that circumstance if no ``mp_context`` was supplied.
  6031. - gh-issue-89022: In :mod:`sqlite3`, ``SQLITE_MISUSE`` result codes are now
  6032. mapped to :exc:`~sqlite3.InterfaceError` instead of
  6033. :exc:`~sqlite3.ProgrammingError`. Also, more accurate exceptions are
  6034. raised when binding parameters fail. Patch by Erlend E. Aasland.
  6035. - gh-issue-91526: Stop calling ``os.device_encoding(file.fileno())`` in
  6036. :class:`TextIOWrapper`. It was complex, never documented, and didn't work
  6037. for most cases. (Patch by Inada Naoki.)
  6038. - gh-issue-88116: Change the frame-related functions in the :mod:`inspect`
  6039. module to return a regular object (that is backwards compatible with the
  6040. old tuple-like interface) that include the extended :pep:`657` position
  6041. information (end line number, column and end column). The affected
  6042. functions are: :func:`inspect.getframeinfo`,
  6043. :func:`inspect.getouterframes`, :func:`inspect.getinnerframes`,
  6044. :func:`inspect.stack` and :func:`inspect.trace`. Patch by Pablo Galindo.
  6045. - gh-issue-69093: Add indexing and slicing support to :class:`sqlite3.Blob`.
  6046. Patch by Aviv Palivoda and Erlend E. Aasland.
  6047. - gh-issue-69093: Add :term:`context manager` support to
  6048. :class:`sqlite3.Blob`. Patch by Aviv Palivoda and Erlend E. Aasland.
  6049. - gh-issue-91217: Deprecate nntplib.
  6050. - gh-issue-91217: Deprecate msilib.
  6051. - gh-issue-91404: Improve the performance of :mod:`re` matching by using
  6052. computed gotos (or "threaded code") on supported platforms and removing
  6053. expensive pointer indirections.
  6054. - gh-issue-91217: Deprecate the imghdr module.
  6055. - gh-issue-91217: Deprecate the crypt module.
  6056. - gh-issue-91276: Make space for longer opcodes in :mod:`dis` output.
  6057. - bpo-47000: Make :class:`TextIOWrapper` uses locale encoding when
  6058. ``encoding="locale"`` is specified even in UTF-8 mode.
  6059. - gh-issue-91230: :func:`warnings.catch_warnings` now accepts arguments for
  6060. :func:`warnings.simplefilter`, providing a more concise way to locally
  6061. ignore warnings or convert them to errors.
  6062. - gh-issue-91217: Deprecate the chunk module.
  6063. - Add the ``TCP_CONNECTION_INFO`` option (available on macOS) to
  6064. :mod:`socket`.
  6065. - bpo-47260: Fix ``os.closerange()`` potentially being a no-op in a Linux
  6066. seccomp sandbox.
  6067. - bpo-47087: Implement ``typing.Required`` and ``typing.NotRequired``
  6068. (:pep:`655`). Patch by David Foster and Jelle Zijlstra.
  6069. - bpo-47061: Deprecate cgi and cgitb.
  6070. - bpo-47061: Deprecate audioop.
  6071. - bpo-47000: Add :func:`locale.getencoding` to get the current locale
  6072. encoding. It is similar to ``locale.getpreferredencoding(False)`` but
  6073. ignores the :ref:`Python UTF-8 Mode <utf8-mode>`.
  6074. - bpo-42012: Add :mod:`wsgiref.types`, containing WSGI-specific types for
  6075. static type checking.
  6076. - bpo-47227: Suppress expression chaining for more :mod:`re` parsing errors.
  6077. - bpo-47211: Remove undocumented and never working function
  6078. ``re.template()`` and flag ``re.TEMPLATE``. This was later reverted in
  6079. 3.11.0b2 and deprecated instead.
  6080. - bpo-47135: :meth:`decimal.localcontext` now accepts context attributes via
  6081. keyword arguments
  6082. - bpo-43323: Fix errors in the :mod:`email` module if the charset itself
  6083. contains undecodable/unencodable characters.
  6084. - bpo-46841: Disassembly of quickened code.
  6085. - bpo-46681: Forward gzip.compress() compresslevel to zlib.
  6086. - bpo-45100: Add :func:`typing.get_overloads` and
  6087. :func:`typing.clear_overloads`. Patch by Jelle Zijlstra.
  6088. - bpo-44807: :class:`typing.Protocol` no longer silently replaces
  6089. :meth:`__init__` methods defined on subclasses. Patch by Adrian Garcia
  6090. Badaracco.
  6091. - bpo-46787: Fix :class:`concurrent.futures.ProcessPoolExecutor` exception
  6092. memory leak
  6093. - bpo-46720: Add support for path-like objects to
  6094. :func:`multiprocessing.set_executable` for Windows to be on a par with
  6095. Unix-like systems. Patch by Géry Ogam.
  6096. - bpo-46696: Add ``SO_INCOMING_CPU`` constant to :mod:`socket`.
  6097. - bpo-46053: Fix OSS audio support on NetBSD.
  6098. - bpo-45639: ``image/avif`` and ``image/webp`` were added to
  6099. :mod:`mimetypes`.
  6100. - bpo-46285: Add command-line option ``-p``/``--protocol`` to module
  6101. :mod:`http.server` which specifies the HTTP version to which the server is
  6102. conformant (HTTP/1.1 conformant servers can now be run from the
  6103. command-line interface of module :mod:`http.server`). Patch by Géry Ogam.
  6104. - bpo-44791: Accept ellipsis as the last argument of
  6105. :data:`typing.Concatenate`.
  6106. - bpo-46547: Remove variables leaking into ``pydoc.Helper`` class namespace.
  6107. - bpo-46415: Fix ipaddress.ip_{address,interface,network} raising TypeError
  6108. instead of ValueError if given invalid tuple as address parameter.
  6109. - bpo-46075: ``CookieJar`` with ``DefaultCookiePolicy`` now can process
  6110. cookies from localhost with domain=localhost explicitly specified in
  6111. Set-Cookie header.
  6112. - bpo-45995: Add a "z" option to the string formatting specification that
  6113. coerces negative zero floating-point values to positive zero after
  6114. rounding to the format precision. Contributed by John Belmonte.
  6115. - bpo-26175: Fully implement the :class:`io.BufferedIOBase` or
  6116. :class:`io.TextIOBase` interface for
  6117. :class:`tempfile.SpooledTemporaryFile` objects. This lets them work
  6118. correctly with higher-level layers (like compression modules). Patch by
  6119. Carey Metcalfe.
  6120. - bpo-45138: Fix a regression in the :mod:`sqlite3` trace callback where
  6121. bound parameters were not expanded in the passed statement string. The
  6122. regression was introduced in Python 3.10 by :issue:`40318`. Patch by
  6123. Erlend E. Aasland.
  6124. - bpo-44863: Allow :class:`~typing.TypedDict` subclasses to also include
  6125. :class:`~typing.Generic` as a base class in class based syntax. Thereby
  6126. allowing the user to define a generic ``TypedDict``, just like a
  6127. user-defined generic but with ``TypedDict`` semantics.
  6128. - bpo-44587: Fix BooleanOptionalAction to not automatically add a default
  6129. string. If a default string is desired, use a formatter to add it.
  6130. - bpo-43827: All positional-or-keyword parameters to ``ABCMeta.__new__`` are
  6131. now positional-only to avoid conflicts with keyword arguments to be passed
  6132. to :meth:`__init_subclass__`.
  6133. - bpo-43218: Prevent creation of a venv whose path contains the PATH
  6134. separator. This could affect the usage of the activate script. Patch by
  6135. Dustin Rodrigues.
  6136. - bpo-38435: Add a ``process_group`` parameter to :class:`subprocess.Popen`
  6137. to help move more things off of the unsafe ``preexec_fn`` parameter.
  6138. - bpo-42066: Fix cookies getting sorted in :func:`CookieJar.__iter__` which
  6139. is an extra behavior and not mentioned in RFC 2965 or Netscape cookie
  6140. protocol. Now the cookies in ``CookieJar`` follows the order of the
  6141. ``Set-Cookie`` header. Patch by Iman Kermani.
  6142. - bpo-40617: Add :meth:`~sqlite3.Connection.create_window_function` to
  6143. :class:`sqlite3.Connection` for creating aggregate window functions. Patch
  6144. by Erlend E. Aasland.
  6145. - bpo-40676: Convert :mod:`csv` to use Argument Clinic for
  6146. :func:`csv.field_size_limit`, :func:`csv.get_dialect`,
  6147. :func:`csv.unregister_dialect` and :func:`csv.list_dialects`.
  6148. - bpo-39716: Raise an ``ArgumentError`` when the same subparser name is
  6149. added twice to an ``argparse.ArgumentParser``. This is consistent with
  6150. the (default) behavior when the same option string is added twice to an
  6151. ``ArgumentParser``.
  6152. - bpo-36073: Raise :exc:`~sqlite3.ProgrammingError` instead of segfaulting
  6153. on recursive usage of cursors in :mod:`sqlite3` converters. Patch by
  6154. Sergey Fedoseev.
  6155. - bpo-34975: Adds a ``start_tls()`` method to
  6156. :class:`~asyncio.streams.StreamWriter`, which upgrades the connection with
  6157. TLS using the given :class:`~ssl.SSLContext`.
  6158. - bpo-22276: :class:`~pathlib.Path` methods :meth:`~pathlib.Path.glob` and
  6159. :meth:`~pathlib.Path.rglob` return only directories if *pattern* ends with
  6160. a pathname components separator (``/`` or :data:`~os.sep`). Patch by
  6161. Eisuke Kawashima.
  6162. - bpo-24905: Add :meth:`~sqlite3.Connection.blobopen` to
  6163. :class:`sqlite3.Connection`. :class:`sqlite3.Blob` allows incremental I/O
  6164. operations on blobs. Patch by Aviv Palivoda and Erlend E. Aasland.
  6165. Documentation
  6166. -------------
  6167. - gh-issue-91888: Add a new ``gh`` role to the documentation to link to
  6168. GitHub issues.
  6169. - gh-issue-91783: Document security issues concerning the use of the
  6170. function :meth:`shutil.unpack_archive`
  6171. - gh-issue-91547: Remove "Undocumented modules" page.
  6172. - gh-issue-91298: In ``importlib.resources.abc``, refined the documentation
  6173. of the Traversable Protocol, applying changes from importlib_resources
  6174. 5.7.1.
  6175. - bpo-44347: Clarify the meaning of *dirs_exist_ok*, a kwarg of
  6176. :func:`shutil.copytree`.
  6177. - bpo-36329: Remove 'make -C Doc serve' in favour of 'make -C Doc htmlview'
  6178. - bpo-47189: Add a What's New in Python 3.11 entry for the Faster CPython
  6179. project. Documentation by Ken Jin and Kumar Aditya.
  6180. - bpo-38668: Update the introduction to documentation for :mod:`os.path` to
  6181. remove warnings that became irrelevant after the implementations of
  6182. :pep:`383` and :pep:`529`.
  6183. - bpo-47115: The documentation now lists which members of C structs are part
  6184. of the :ref:`Limited API/Stable ABI <stable>`.
  6185. - bpo-46962: All docstrings in code snippets are now wrapped into
  6186. :c:macro:`PyDoc_STR` to follow the guideline of `PEP 7's Documentation
  6187. Strings paragraph
  6188. <https://www.python.org/dev/peps/pep-0007/#documentation-strings>`_. Patch
  6189. by Oleg Iarygin.
  6190. - bpo-26792: Improve the docstrings of :func:`runpy.run_module` and
  6191. :func:`runpy.run_path`. Original patch by Andrew Brezovsky.
  6192. Tests
  6193. -----
  6194. - gh-issue-92169: Use ``warnings_helper.import_deprecated()`` to import
  6195. deprecated modules uniformly in tests. Patch by Hugo van Kemenade.
  6196. - gh-issue-84461: When multiprocessing is enabled, libregrtest can now use a
  6197. Python executable other than :code:`sys.executable` via the ``--python``
  6198. flag.
  6199. - gh-issue-91904: Fix initialization of
  6200. :envvar:`PYTHONREGRTEST_UNICODE_GUARD` which prevented running regression
  6201. tests on non-UTF-8 locale.
  6202. - gh-issue-91752: Added @requires_zlib to
  6203. test.test_tools.test_freeze.TestFreeze.
  6204. - gh-issue-91607: Fix ``test_concurrent_futures`` to test the correct
  6205. multiprocessing start method context in several cases where the test logic
  6206. mixed this up.
  6207. - bpo-40280: Threading tests are now skipped on WASM targets without pthread
  6208. support.
  6209. - bpo-47109: Test for :mod:`ctypes.macholib.dyld`,
  6210. :mod:`ctypes.macholib.dylib`, and :mod:`ctypes.macholib.framework` are
  6211. brought from manual pre-:mod:`unittest` times to :mod:`ctypes.test`
  6212. location and structure. Patch by Oleg Iarygin.
  6213. - bpo-29890: Add tests for :class:`ipaddress.IPv4Interface` and
  6214. :class:`ipaddress.IPv6Interface` construction with tuple arguments.
  6215. Original patch and tests by louisom.
  6216. Build
  6217. -----
  6218. - gh-issue-89452: gdbm-compat is now preferred over ndbm if both are
  6219. available on the system. This allows avoiding the problematic ndbm.h on
  6220. macOS.
  6221. - gh-issue-91731: Python is now built with ``-std=c11`` compiler option,
  6222. rather than ``-std=c99``. Patch by Victor Stinner.
  6223. - bpo-47152: Add script and make target for generating ``sre_constants.h``.
  6224. - bpo-47103: Windows ``PGInstrument`` builds now copy a required DLL into
  6225. the output directory, making it easier to run the profile stage of a PGO
  6226. build.
  6227. Windows
  6228. -------
  6229. - bpo-46907: Update Windows installer to use SQLite 3.38.3.
  6230. - bpo-47239: Fixed --list and --list-paths output for :ref:`launcher` when
  6231. used in an active virtual environment.
  6232. - bpo-46907: Update Windows installer to use SQLite 3.38.2.
  6233. - bpo-46785: Fix race condition between :func:`os.stat` and unlinking a file
  6234. on Windows, by using errors codes returned by ``FindFirstFileW()`` when
  6235. appropriate in ``win32_xstat_impl``.
  6236. - bpo-40859: Update Windows build to use xz-5.2.5
  6237. macOS
  6238. -----
  6239. - bpo-46907: Update macOS installer to SQLite 3.38.4.
  6240. Tools/Demos
  6241. -----------
  6242. - gh-issue-91583: Fix regression in the code generated by Argument Clinic
  6243. for functions with the ``defining_class`` parameter.
  6244. - gh-issue-91575: Add script ``Tools/scripts/generate_re_casefix.py`` and
  6245. the make target ``regen-re`` for generating additional data for
  6246. case-insensitive matching according to the current Unicode version.
  6247. - gh-issue-91551: Remove the ancient Pynche color editor. It has moved to
  6248. https://gitlab.com/warsaw/pynche
  6249. C API
  6250. -----
  6251. - gh-issue-88279: Deprecate the C functions: :c:func:`PySys_SetArgv`,
  6252. :c:func:`PySys_SetArgvEx`, :c:func:`PySys_SetPath`. Patch by Victor
  6253. Stinner.
  6254. - gh-issue-92154: Added the :c:func:`PyCode_GetCode` function. This function
  6255. does the equivalent of the Python code ``getattr(code_object,
  6256. 'co_code')``.
  6257. - gh-issue-92173: Fix the ``closure`` argument to
  6258. :c:func:`PyEval_EvalCodeEx`.
  6259. - gh-issue-91320: Fix C++ compiler warnings about "old-style cast" (``g++
  6260. -Wold-style-cast``) in the Python C API. Use C++ ``reinterpret_cast<>``
  6261. and ``static_cast<>`` casts when the Python C API is used in C++. Patch by
  6262. Victor Stinner.
  6263. - gh-issue-80527: Mark functions as deprecated by :pep:`623`:
  6264. :c:func:`!PyUnicode_AS_DATA`, :c:func:`!PyUnicode_AS_UNICODE`,
  6265. :c:func:`!PyUnicode_GET_DATA_SIZE`, :c:func:`!PyUnicode_GET_SIZE`. Patch
  6266. by Victor Stinner.
  6267. - gh-issue-91768: :c:func:`Py_REFCNT`, :c:func:`Py_TYPE`, :c:func:`Py_SIZE`
  6268. and :c:func:`Py_IS_TYPE` functions argument type is now ``PyObject*``,
  6269. rather than ``const PyObject*``. Patch by Victor Stinner.
  6270. - gh-issue-91020: Add ``PyBytes_Type.tp_alloc`` to initialize
  6271. ``PyBytesObject.ob_shash`` for bytes subclasses.
  6272. - bpo-40421: Add ``PyFrame_GetLasti`` C-API function to access frame
  6273. object's ``f_lasti`` attribute safely from C code.
  6274. - bpo-35134: Remove the ``Include/code.h`` header file. C extensions should
  6275. only include the main ``<Python.h>`` header file. Patch by Victor Stinner.
  6276. - bpo-47169: :c:func:`PyOS_CheckStack` is now exported in the Stable ABI on
  6277. Windows.
  6278. - bpo-47169: :c:func:`PyThread_get_thread_native_id` is excluded from the
  6279. stable ABI on platforms where it doesn't exist (like Solaris).
  6280. - bpo-46343: Added :c:func:`PyErr_GetHandledException` and
  6281. :c:func:`PyErr_SetHandledException` as simpler alternatives to
  6282. :c:func:`PyErr_GetExcInfo` and :c:func:`PyErr_SetExcInfo`.
  6283. They are included in the stable ABI.
  6284. What's New in Python 3.11.0 alpha 7?
  6285. ====================================
  6286. *Release date: 2022-04-05*
  6287. Core and Builtins
  6288. -----------------
  6289. - bpo-47212: Raise :exc:`IndentationError` instead of :exc:`SyntaxError` for
  6290. a bare ``except`` with no following indent. Improve :exc:`SyntaxError`
  6291. locations for an un-parenthesized generator used as arguments. Patch by
  6292. Matthieu Dartiailh.
  6293. - bpo-47186: Replace :opcode:`JUMP_IF_NOT_EG_MATCH` by
  6294. :opcode:`CHECK_EG_MATCH` + jump.
  6295. - bpo-47176: Emscripten builds cannot handle signals in the usual way due to
  6296. platform limitations. Python can now handle signals. To use, set
  6297. Module.Py_EmscriptenSignalBuffer to be a single byte SharedArrayBuffer and
  6298. set Py_EMSCRIPTEN_SIGNAL_HANDLING to 1. Writing a number into the
  6299. SharedArrayBuffer will cause the corresponding signal to be raised into
  6300. the Python thread.
  6301. - bpo-47186: Replace :opcode:`JUMP_IF_NOT_EXC_MATCH` by
  6302. :opcode:`CHECK_EXC_MATCH` + jump.
  6303. - bpo-47120: Replace the absolute jump opcode :opcode:`JUMP_NO_INTERRUPT` by
  6304. the relative :opcode:`JUMP_BACKWARD_NO_INTERRUPT`.
  6305. - bpo-46841: Avoid unnecessary allocations when comparing code objects.
  6306. - bpo-47182: Fix a crash when using a named unicode character like
  6307. ``"\N{digit nine}"`` after the main interpreter has been initialized a
  6308. second time.
  6309. - bpo-47162: WebAssembly cannot deal with bad function pointer casts
  6310. (different count or types of arguments). Python can now use call
  6311. trampolines to mitigate the problem. Define :c:macro:`PY_CALL_TRAMPOLINE`
  6312. to enable call trampolines.
  6313. - bpo-46775: Some Windows system error codes(>= 10000) are now mapped into
  6314. the correct errno and may now raise a subclass of :exc:`OSError`. Patch by
  6315. Donghee Na.
  6316. - bpo-47129: Improve error messages in f-string syntax errors concerning
  6317. empty expressions.
  6318. - bpo-47117: Fix a crash if we fail to decode characters in interactive mode
  6319. if the tokenizer buffers are uninitialized. Patch by Pablo Galindo.
  6320. - bpo-47127: Speed up calls to c functions with keyword arguments by 25%
  6321. with specialization. Patch by Kumar Aditya.
  6322. - bpo-47120: Replaced :opcode:`JUMP_ABSOLUTE` by the relative jump
  6323. :opcode:`JUMP_BACKWARD`.
  6324. - bpo-42197: :c:func:`!PyFrame_FastToLocalsWithError` and
  6325. :c:func:`!PyFrame_LocalsToFast` are no longer called during profiling nor
  6326. tracing. C code can access the ``f_locals`` attribute of
  6327. :c:type:`PyFrameObject` by calling :c:func:`PyFrame_GetLocals`.
  6328. - bpo-47070: Improve performance of ``array_inplace_repeat`` by reducing the
  6329. number of invocations of ``memcpy``. Refactor the ``repeat`` and inplace
  6330. ``repeat`` methods of ``array``, ``bytes``, ``bytearray`` and
  6331. ``unicodeobject`` to use the common ``_PyBytes_Repeat``.
  6332. - bpo-47053: Reduce de-optimization in the specialized
  6333. ``BINARY_OP_INPLACE_ADD_UNICODE`` opcode.
  6334. - bpo-47045: Remove the ``f_state`` field from the _PyInterpreterFrame
  6335. struct. Add the ``owner`` field to the _PyInterpreterFrame struct to make
  6336. ownership explicit to simplify clearing and deallocing frames and
  6337. generators.
  6338. - bpo-46968: Check for the existence of the "sys/auxv.h" header in
  6339. :mod:`faulthandler` to avoid compilation problems in systems where this
  6340. header doesn't exist. Patch by Pablo Galindo
  6341. - bpo-46329: Use low bit of ``LOAD_GLOBAL`` to indicate whether to push a
  6342. ``NULL`` before the global. Helps streamline the call sequence a bit.
  6343. - bpo-46841: Quicken bytecode in-place by storing it as part of the
  6344. corresponding ``PyCodeObject``.
  6345. - bpo-47012: Speed up iteration of :class:`bytes` and :class:`bytearray` by
  6346. 30%. Patch by Kumar Aditya.
  6347. - bpo-47009: Improved the performance of :meth:`list.append()` and list
  6348. comprehensions by optimizing for the common case, where no resize is
  6349. needed. Patch by Dennis Sweeney.
  6350. - bpo-47005: Improve performance of ``bytearray_repeat`` and
  6351. ``bytearray_irepeat`` by reducing the number of invocations of ``memcpy``.
  6352. - bpo-46829: Deprecate passing a message into :meth:`asyncio.Future.cancel`
  6353. and :meth:`asyncio.Task.cancel`
  6354. - bpo-46993: Speed up :class:`bytearray` creation from :class:`list` and
  6355. :class:`tuple` by 40%. Patch by Kumar Aditya.
  6356. - bpo-39829: Removed the ``__len__()`` call when initializing a list and
  6357. moved initializing to ``list_extend``. Patch by Jeremiah Pascual.
  6358. - bpo-46944: Speed up throwing exception in generator with
  6359. :c:macro:`METH_FASTCALL` calling convention. Patch by Kumar Aditya.
  6360. - bpo-46841: Modify :opcode:`STORE_SUBSCR` to use an inline cache entry
  6361. (rather than its oparg) as an adaptive counter.
  6362. - bpo-46841: Use inline caching for :opcode:`!PRECALL` and :opcode:`CALL`,
  6363. and remove the internal machinery for managing the (now unused) non-inline
  6364. caches.
  6365. - bpo-46881: Statically allocate and initialize the latin1 characters.
  6366. - bpo-46838: Improve syntax errors for incorrect function definitions. Patch
  6367. by Pablo Galindo
  6368. - bpo-43721: Fix docstrings of :attr:`~property.getter`,
  6369. :attr:`~property.setter`, and :attr:`~property.deleter` to clarify that
  6370. they create a new copy of the property.
  6371. - bpo-43224: Make grammar changes required for PEP 646.
  6372. Library
  6373. -------
  6374. - bpo-47208: Allow vendors to override :const:`CTYPES_MAX_ARGCOUNT`.
  6375. - bpo-23689: :mod:`re` module: fix memory leak when a match is terminated by
  6376. a signal or memory allocation failure. Patch by Ma Lin.
  6377. - bpo-47167: Allow overriding a future compliance check in
  6378. :class:`asyncio.Task`.
  6379. - bpo-47151: When subprocess tries to use vfork, it now falls back to fork
  6380. if vfork returns an error. This allows use in situations where vfork isn't
  6381. allowed by the OS kernel.
  6382. - bpo-47152: Convert the :mod:`re` module into a package. Deprecate modules
  6383. ``sre_compile``, ``sre_constants`` and ``sre_parse``.
  6384. - bpo-4833: Add :meth:`ZipFile.mkdir`
  6385. - bpo-27929: Fix :meth:`asyncio.loop.sock_connect` to only resolve names for
  6386. :const:`socket.AF_INET` or :const:`socket.AF_INET6` families. Resolution
  6387. may not make sense for other families, like :const:`socket.AF_BLUETOOTH`
  6388. and :const:`socket.AF_UNIX`.
  6389. - bpo-14265: Adds the fully qualified test name to unittest output
  6390. - bpo-47061: Deprecate the aifc module.
  6391. - bpo-39622: Handle Ctrl+C in asyncio programs to interrupt the main task.
  6392. - bpo-47101: :const:`hashlib.algorithms_available` now lists only algorithms
  6393. that are provided by activated crypto providers on OpenSSL 3.0. Legacy
  6394. algorithms are not listed unless the legacy provider has been loaded into
  6395. the default OSSL context.
  6396. - bpo-47099: All :exc:`URLError` exception messages raised in
  6397. :class:`urllib.request.URLopener` now contain a colon between ``ftp
  6398. error`` and the rest of the message. Previously,
  6399. :func:`~urllib.request.URLopener.open_ftp` missed the colon. Patch by Oleg
  6400. Iarygin.
  6401. - bpo-47099: Exception chaining is changed from
  6402. :func:`Exception.with_traceback`/:func:`sys.exc_info` to :pep:`3134`.
  6403. Patch by Oleg Iarygin.
  6404. - bpo-47095: :mod:`hashlib`'s internal ``_blake2`` module now prefers
  6405. ``libb2`` from https://www.blake2.net/ over Python's vendored copy of
  6406. blake2.
  6407. - bpo-47098: The Keccak Code Package for :mod:`hashlib`'s internal ``_sha3``
  6408. module has been replaced with tiny_sha3. The module is used as fallback
  6409. when Python is built without OpenSSL.
  6410. - bpo-47088: Implement :data:`typing.LiteralString`, part of :pep:`675`.
  6411. Patch by Jelle Zijlstra.
  6412. - bpo-42885: Optimize :func:`re.search`, :func:`re.split`,
  6413. :func:`re.findall`, :func:`re.finditer` and :func:`re.sub` for regular
  6414. expressions starting with ``\A`` or ``^``.
  6415. - bpo-23691: Protect the :func:`re.finditer` iterator from re-entering.
  6416. - bpo-47067: Optimize calling ``GenericAlias`` objects by using :pep:`590`
  6417. ``vectorcall`` and by replacing ``PyObject_SetAttrString`` with
  6418. ``PyObject_SetAttr``.
  6419. - bpo-28080: Add the *metadata_encoding* parameter in the
  6420. :class:`zipfile.ZipFile` constructor and the ``--metadata-encoding``
  6421. option in the :mod:`zipfile` CLI to allow reading zipfiles using
  6422. non-standard codecs to encode the filenames within the archive.
  6423. - bpo-47000: Make :func:`io.text_encoding` returns "utf-8" when UTF-8 mode
  6424. is enabled.
  6425. - bpo-42369: Fix thread safety of :meth:`zipfile._SharedFile.tell` to avoid
  6426. a "zipfile.BadZipFile: Bad CRC-32 for file" exception when reading a
  6427. :class:`ZipFile` from multiple threads.
  6428. - bpo-38256: Fix :func:`binascii.crc32` when it is compiled to use zlib'c
  6429. crc32 to work properly on inputs 4+GiB in length instead of returning the
  6430. wrong result. The workaround prior to this was to always feed the function
  6431. data in increments smaller than 4GiB or to just call the zlib module
  6432. function.
  6433. We also have :func:`binascii.crc32` release the GIL when computing on
  6434. larger inputs as :func:`zlib.crc32` and :mod:`hashlib` do.
  6435. This also boosts performance on Windows as it now uses the zlib crc32
  6436. implementation for :func:`binascii.crc32` for a 2-3x speedup.
  6437. That the stdlib has a crc32 API in two modules is a known historical
  6438. oddity. This moves us closer to a single implementation behind them.
  6439. - bpo-47066: Global inline flags (e.g. ``(?i)``) can now only be used at the
  6440. start of the regular expressions. Using them not at the start of
  6441. expression was deprecated since Python 3.6.
  6442. - bpo-39394: A warning about inline flags not at the start of the regular
  6443. expression now contains the position of the flag.
  6444. - bpo-433030: Add support of atomic grouping (``(?>...)``) and possessive
  6445. quantifiers (``*+``, ``++``, ``?+``, ``{m,n}+``) in :mod:`regular
  6446. expressions <re>`.
  6447. - bpo-47062: Implement :class:`asyncio.Runner` context manager.
  6448. - bpo-46382: :func:`~dataclasses.dataclass` ``slots=True`` now correctly
  6449. omits slots already defined in base classes. Patch by Arie Bovenberg.
  6450. - bpo-47057: Use FASTCALL convention for ``FutureIter.throw()``
  6451. - bpo-47061: Deprecate the various modules listed by :pep:`594`:
  6452. aifc, asynchat, asyncore, audioop, cgi, cgitb, chunk, crypt, imghdr,
  6453. msilib, nntplib, nis, ossaudiodev, pipes, smtpd, sndhdr, spwd, sunau,
  6454. telnetlib, uu, xdrlib
  6455. - bpo-34790: Remove passing coroutine objects to :func:`asyncio.wait`.
  6456. - bpo-47039: Normalize ``repr()`` of asyncio future and task objects.
  6457. - bpo-2604: Fix bug where doctests using globals would fail when run
  6458. multiple times.
  6459. - bpo-45150: Add :func:`hashlib.file_digest` helper for efficient hashing of
  6460. file object.
  6461. - bpo-34861: Made cumtime the default sorting key for cProfile
  6462. - bpo-45997: Fix :class:`asyncio.Semaphore` re-aquiring FIFO order.
  6463. - bpo-47022: The :mod:`!asynchat`, :mod:`!asyncore` and :mod:`!smtpd`
  6464. modules have been deprecated since at least Python 3.6. Their
  6465. documentation and deprecation warnings and have now been updated to note
  6466. they will removed in Python 3.12 (:pep:`594`).
  6467. - bpo-43253: Fix a crash when closing transports where the underlying socket
  6468. handle is already invalid on the Proactor event loop.
  6469. - bpo-40280: :func:`select.select` now passes ``NULL`` to ``select`` for
  6470. each empty fdset.
  6471. - bpo-47004: Apply bugfixes from importlib_metadata 4.11.3, including bugfix
  6472. for EntryPoint.extras, which was returning match objects and not the
  6473. extras strings.
  6474. - bpo-46998: Allow subclassing of :class:`typing.Any`. Patch by Shantanu
  6475. Jain.
  6476. - bpo-46995: Deprecate missing :meth:`asyncio.Task.set_name` for third-party
  6477. task implementations, schedule making it mandatory in Python 3.13.
  6478. - bpo-46994: Accept explicit contextvars.Context in
  6479. :func:`asyncio.create_task` and :meth:`asyncio.loop.create_task`.
  6480. - bpo-46981: ``typing.get_args(typing.Tuple[()])`` now returns ``()``
  6481. instead of ``((),)``.
  6482. - bpo-46968: Add ``os.sysconf_names['SC_MINSIGSTKSZ']``.
  6483. - bpo-46985: Upgrade pip wheel bundled with ensurepip (pip 22.0.4)
  6484. - bpo-46968: :mod:`faulthandler`: On Linux 5.14 and newer, dynamically
  6485. determine size of signal handler stack size CPython allocates using
  6486. ``getauxval(AT_MINSIGSTKSZ)``. This changes allows for Python extension's
  6487. request to Linux kernel to use AMX_TILE instruction set on Sapphire Rapids
  6488. Xeon processor to succeed, unblocking use of the ISA in frameworks.
  6489. - bpo-46917: The :data:`math.nan` value is now always available. Patch by
  6490. Victor Stinner.
  6491. - bpo-46955: Expose :class:`asyncio.base_events.Server` as
  6492. :class:`asyncio.Server`. Patch by Stefan Zabka.
  6493. - bpo-23325: The :mod:`signal` module no longer assumes that
  6494. :const:`~signal.SIG_IGN` and :const:`~signal.SIG_DFL` are small int
  6495. singletons.
  6496. - bpo-46932: Update bundled libexpat to 2.4.7
  6497. - bpo-46933: The :mod:`pwd` module is now optional.
  6498. :func:`os.path.expanduser` returns the path when the :mod:`pwd` module is
  6499. not available.
  6500. - bpo-40059: :pep:`680`, the :mod:`tomllib` module. Adds support for parsing
  6501. TOML.
  6502. - bpo-464471: :func:`asyncio.timeout` and :func:`asyncio.timeout_at` context
  6503. managers added. Patch by Tin Tvrtković and Andrew Svetlov.
  6504. - bpo-46805: Added raw datagram socket functions for asyncio:
  6505. :meth:`~asyncio.AbstractEventLoop.sock_sendto`,
  6506. :meth:`~asyncio.AbstractEventLoop.sock_recvfrom` and
  6507. :meth:`~asyncio.AbstractEventLoop.sock_recvfrom_into`.
  6508. - bpo-46644: No longer require valid typeforms to be callable. This allows
  6509. :data:`typing.Annotated` to wrap :data:`typing.ParamSpecArgs` and
  6510. :data:`dataclasses.InitVar`. Patch by Gregory Beauregard.
  6511. - bpo-46581: Brings :class:`ParamSpec` propagation for :class:`GenericAlias`
  6512. in line with :class:`Concatenate` (and others).
  6513. - bpo-45413: Define *posix_venv* and *nt_venv* :ref:`sysconfig installation
  6514. schemes <installation_paths>` to be used for bootstrapping new virtual
  6515. environments. Add *venv* sysconfig installation scheme to get the
  6516. appropriate one of the above. The schemes are identical to the
  6517. pre-existing *posix_prefix* and *nt* install schemes. The :mod:`venv`
  6518. module now uses the *venv* scheme to create new virtual environments
  6519. instead of hardcoding the paths depending only on the platform. Downstream
  6520. Python distributors customizing the *posix_prefix* or *nt* install scheme
  6521. in a way that is not compatible with the install scheme used in virtual
  6522. environments are encouraged not to customize the *venv* schemes. When
  6523. Python itself runs in a virtual environment,
  6524. :func:`sysconfig.get_default_scheme` and
  6525. :func:`sysconfig.get_preferred_scheme` with ``key="prefix"`` returns
  6526. *venv*.
  6527. - bpo-43224: Implement support for PEP 646 in typing.py.
  6528. - bpo-43224: Allow unpacking types.GenericAlias objects, e.g. ``*tuple[int,
  6529. str]``.
  6530. - bpo-46557: Warnings captured by the logging module are now logged without
  6531. a format string to prevent systems that group logs by the msg argument
  6532. from grouping captured warnings together.
  6533. - bpo-41370: :func:`typing.get_type_hints` now supports evaluating strings
  6534. as forward references in :ref:`PEP 585 generic aliases
  6535. <types-genericalias>`.
  6536. - bpo-46607: Add :exc:`DeprecationWarning` to :class:`LegacyInterpolation`,
  6537. deprecated in the docstring since Python 3.2. Will be removed in Python
  6538. 3.13. Use :class:`BasicInterpolation` or :class:`ExtendedInterpolation`
  6539. instead.
  6540. - bpo-26120: :mod:`pydoc` now excludes __future__ imports from the module's
  6541. data items.
  6542. - bpo-46480: Add :func:`typing.assert_type`. Patch by Jelle Zijlstra.
  6543. - bpo-46421: Fix a unittest issue where if the command was invoked as
  6544. ``python -m unittest`` and the filename(s) began with a dot (.), a
  6545. ``ValueError`` is returned.
  6546. - bpo-46245: Add optional parameter *dir_fd* in :func:`shutil.rmtree`.
  6547. - bpo-22859: :meth:`~unittest.TestProgram.usageExit` is marked deprecated,
  6548. to be removed in 3.13.
  6549. - bpo-46170: Improve the error message when you try to subclass an instance
  6550. of :class:`typing.NewType`.
  6551. - bpo-40296: Fix supporting generic aliases in :mod:`pydoc`.
  6552. - bpo-20392: Fix inconsistency with uppercase file extensions in
  6553. :meth:`MimeTypes.guess_type`. Patch by Kumar Aditya.
  6554. - bpo-46030: Add ``LOCAL_CREDS``, ``LOCAL_CREDS_PERSISTENT`` and
  6555. ``SCM_CREDS2`` FreeBSD constants to the socket module.
  6556. - bpo-44439: Fix ``.write()`` method of a member file in ``ZipFile``, when
  6557. the input data is an object that supports the buffer protocol, the file
  6558. length may be wrong.
  6559. - bpo-45171: Fix handling of the ``stacklevel`` argument to logging
  6560. functions in the :mod:`logging` module so that it is consistent across all
  6561. logging functions and, as advertised, similar to the ``stacklevel``
  6562. argument used in :meth:`~warnings.warn`.
  6563. - bpo-24959: Fix bug where :mod:`unittest` sometimes drops frames from
  6564. tracebacks of exceptions raised in tests.
  6565. - bpo-44859: Raise more accurate and :pep:`249` compatible exceptions in
  6566. :mod:`sqlite3`.
  6567. * Raise :exc:`~sqlite3.InterfaceError` instead of
  6568. :exc:`~sqlite3.ProgrammingError` for ``SQLITE_MISUSE`` errors.
  6569. * Don't overwrite :exc:`BufferError` with :exc:`ValueError` when conversion to
  6570. BLOB fails.
  6571. * Raise :exc:`~sqlite3.ProgrammingError` instead of :exc:`~sqlite3.Warning` if
  6572. user tries to :meth:`~sqlite3.Cursor.execute()` more than one SQL statement.
  6573. * Raise :exc:`~sqlite3.ProgrammingError` instead of :exc:`ValueError` if an SQL
  6574. query contains null characters.
  6575. - bpo-44493: Add missing terminated NUL in sockaddr_un's length
  6576. This was potentially observable when using non-abstract AF_UNIX datagram
  6577. sockets to processes written in another programming language.
  6578. - bpo-41930: Add :meth:`~sqlite3.Connection.serialize` and
  6579. :meth:`~sqlite3.Connection.deserialize` support to :mod:`sqlite3`. Patch
  6580. by Erlend E. Aasland.
  6581. - bpo-33178: Added :class:`ctypes.BigEndianUnion` and
  6582. :class:`ctypes.LittleEndianUnion` classes, as originally documented in the
  6583. library docs but not yet implemented.
  6584. - bpo-43352: Add an Barrier object in synchronization primitives of
  6585. *asyncio* Lib in order to be consistant with Barrier from *threading* and
  6586. *multiprocessing* libs*
  6587. - bpo-35859: :mod:`re` module, fix a few bugs about capturing group. In rare
  6588. cases, capturing group gets an incorrect string. Patch by Ma Lin.
  6589. Documentation
  6590. -------------
  6591. - bpo-45099: Document internal :mod:`asyncio` API.
  6592. - bpo-47126: Update PEP URLs to :pep:`676`'s new canonical form.
  6593. - bpo-47040: Clarified the old Python versions compatiblity note of
  6594. :func:`binascii.crc32` / :func:`zlib.adler32` / :func:`zlib.crc32`
  6595. functions.
  6596. - bpo-46033: Clarify ``for`` statement execution in its doc.
  6597. - bpo-45790: Adjust inaccurate phrasing in
  6598. :doc:`../extending/newtypes_tutorial` about the ``ob_base`` field and the
  6599. macros used to access its contents.
  6600. - bpo-42340: Document that in some circumstances :exc:`KeyboardInterrupt`
  6601. may cause the code to enter an inconsistent state. Provided a sample
  6602. workaround to avoid it if needed.
  6603. - bpo-41233: Link the errnos referenced in ``Doc/library/exceptions.rst`` to
  6604. their respective section in ``Doc/library/errno.rst``, and vice versa.
  6605. Previously this was only done for EINTR and InterruptedError. Patch by Yan
  6606. "yyyyyyyan" Orestes.
  6607. Tests
  6608. -----
  6609. - bpo-47205: Skip test for :func:`~os.sched_getaffinity` and
  6610. :func:`~os.sched_setaffinity` error case on FreeBSD.
  6611. - bpo-46126: Restore 'descriptions' when running tests internally.
  6612. - bpo-47104: Rewrite :func:`asyncio.to_thread` tests to use
  6613. :class:`unittest.IsolatedAsyncioTestCase`.
  6614. - bpo-40280: The test suite is now passing on the Emscripten platform. All
  6615. fork, socket, and subprocess-based tests are skipped.
  6616. - bpo-47037: Skip ``strftime("%4Y")`` feature test on Windows. It can cause
  6617. an assertion error in debug builds.
  6618. - bpo-46587: Skip tests if platform's ``strftime`` does not support
  6619. non-portable glibc extensions.
  6620. - bpo-47015: A test case for :func:`os.sendfile` is converted from
  6621. deprecated :mod:`!asyncore` (see :pep:`594`) to :mod:`asyncio`. Patch by
  6622. Oleg Iarygin.
  6623. Build
  6624. -----
  6625. - bpo-40280: Add configure option :option:`--enable-wasm-dynamic-linking` to
  6626. enable ``dlopen`` and MAIN_MODULE / SIDE_MODULE on ``wasm32-emscripten``.
  6627. - bpo-46023: ``makesetup`` now detects and skips all duplicated module
  6628. definitions. The first entry wins.
  6629. - bpo-40280: Add SOABI ``wasm32-emscripten`` for Emscripten and
  6630. ``wasm32-wasi`` for WASI on 32bit WASM as well as ``wasm64`` counter
  6631. parts.
  6632. - bpo-47032: Ensure Windows install builds fail correctly with a non-zero
  6633. exit code when part of the build fails.
  6634. - bpo-47024: Update OpenSSL to 1.1.1n for macOS installers and all Windows
  6635. builds.
  6636. - bpo-46996: The :mod:`tkinter` package now requires Tcl/Tk version 8.5.12
  6637. or newer.
  6638. - bpo-46973: Add ``regen-configure`` make target to regenerate configure
  6639. script with Christian's container image
  6640. ``quay.io/tiran/cpython_autoconf:269``.
  6641. - bpo-46917: Building Python now requires support of IEEE 754 floating point
  6642. numbers. Patch by Victor Stinner.
  6643. - bpo-45774: ``configure`` now verifies that all SQLite C APIs needed for
  6644. the :mod:`sqlite3` extension module are found.
  6645. Windows
  6646. -------
  6647. - bpo-47194: Update ``zlib`` to v1.2.12 to resolve CVE-2018-25032.
  6648. - bpo-47171: Enables installing the :file:`py.exe` launcher on Windows
  6649. ARM64.
  6650. - bpo-46566: Upgraded :ref:`launcher` to support a new ``-V:company/tag``
  6651. argument for full :pep:`514` support and to detect ARM64 installs. The
  6652. ``-64`` suffix on arguments is deprecated, but still selects any
  6653. non-32-bit install. Setting :envvar:`PYLAUNCHER_ALLOW_INSTALL` and
  6654. specifying a version that is not installed will attempt to install the
  6655. requested version from the Microsoft Store.
  6656. - bpo-47086: The installer for Windows now includes documentation as loose
  6657. HTML files rather than a single compiled :file:`.chm` file.
  6658. - bpo-46907: Update Windows installer to use SQLite 3.38.1.
  6659. - bpo-44549: Update bzip2 to 1.0.8 in Windows builds to mitigate
  6660. CVE-2016-3189 and CVE-2019-12900
  6661. - bpo-46948: Prevent CVE-2022-26488 by ensuring the Add to PATH option in
  6662. the Windows installer uses the correct path when being repaired.
  6663. macOS
  6664. -----
  6665. - bpo-46890: Fix a regression in the setting of ``sys._base_executable`` in
  6666. framework builds, and thereby fix a regression in :mod:`venv` virtual
  6667. environments with such builds.
  6668. - bpo-46907: Update macOS installer to SQLite 3.38.1.
  6669. Tools/Demos
  6670. -----------
  6671. - bpo-40280: Replace Emscripten's limited shell with Katie Bell's browser-ui
  6672. REPL from python-wasm project.
  6673. C API
  6674. -----
  6675. - bpo-40421: Add ``PyFrame_GetBuiltins``, ``PyFrame_GetGenerator`` and
  6676. ``PyFrame_GetGlobals`` C-API functions to access frame object attributes
  6677. safely from C code.
  6678. - bpo-46850: Move the private ``_PyFrameEvalFunction`` type, and private
  6679. ``_PyInterpreterState_GetEvalFrameFunc()`` and
  6680. ``_PyInterpreterState_SetEvalFrameFunc()`` functions to the internal C
  6681. API. The ``_PyFrameEvalFunction`` callback function type now uses the
  6682. ``_PyInterpreterFrame`` type which is part of the internal C API. Patch by
  6683. Victor Stinner.
  6684. - bpo-46850: Move the private undocumented ``_PyEval_EvalFrameDefault()``
  6685. function to the internal C API. The function now uses the
  6686. ``_PyInterpreterFrame`` type which is part of the internal C API. Patch by
  6687. Victor Stinner.
  6688. - bpo-46850: Remove the private undocumented function
  6689. ``_PyEval_CallTracing()`` from the C API. Call the public
  6690. :func:`sys.call_tracing` function instead. Patch by Victor Stinner.
  6691. - bpo-46850: Remove the private undocumented function
  6692. ``_PyEval_GetCoroutineOriginTrackingDepth()`` from the C API. Call the
  6693. public :func:`sys.get_coroutine_origin_tracking_depth` function instead.
  6694. Patch by Victor Stinner.
  6695. - bpo-46850: Remove the following private undocumented functions from the C
  6696. API:
  6697. * ``_PyEval_GetAsyncGenFirstiter()``
  6698. * ``_PyEval_GetAsyncGenFinalizer()``
  6699. * ``_PyEval_SetAsyncGenFirstiter()``
  6700. * ``_PyEval_SetAsyncGenFinalizer()``
  6701. Call the public :func:`sys.get_asyncgen_hooks` and
  6702. :func:`sys.set_asyncgen_hooks` functions instead. Patch by Victor Stinner.
  6703. - bpo-46987: Remove private functions ``_PySys_GetObjectId()`` and
  6704. ``_PySys_SetObjectId()``. Patch by Donghee Na.
  6705. - bpo-46906: Add new functions to pack and unpack C double (serialize and
  6706. deserialize): :c:func:`PyFloat_Pack2`, :c:func:`PyFloat_Pack4`,
  6707. :c:func:`PyFloat_Pack8`, :c:func:`PyFloat_Unpack2`,
  6708. :c:func:`PyFloat_Unpack4` and :c:func:`PyFloat_Unpack8`. Patch by Victor
  6709. Stinner.
  6710. What's New in Python 3.11.0 alpha 6?
  6711. ====================================
  6712. *Release date: 2022-03-07*
  6713. Core and Builtins
  6714. -----------------
  6715. - bpo-46940: Avoid overriding :exc:`AttributeError` metadata information for
  6716. nested attribute access calls. Patch by Pablo Galindo.
  6717. - bpo-46927: Include the type's name in the error message for subscripting
  6718. non-generic types.
  6719. - bpo-46921: Support vectorcall for ``super()``. Patch by Ken Jin.
  6720. - bpo-46841: Fix incorrect handling of inline cache entries when
  6721. specializing :opcode:`BINARY_OP`.
  6722. - bpo-46841: Use an oparg to simplify the construction of helpful error
  6723. messages in :opcode:`GET_AWAITABLE`.
  6724. - bpo-46903: Make sure that str subclasses can be used as attribute names
  6725. for instances with virtual dictionaries. Fixes regression in 3.11alpha
  6726. - bpo-46841: Add more detailed specialization failure stats for
  6727. :opcode:`COMPARE_OP` followed by :opcode:`EXTENDED_ARG`.
  6728. - bpo-46891: Fix bug introduced during 3.11alpha where subclasses of
  6729. ``types.ModuleType`` with ``__slots__`` were not initialized correctly,
  6730. resulting in an interpreter crash.
  6731. - bpo-46841: Use inline caching for :opcode:`LOAD_ATTR`,
  6732. :opcode:`LOAD_METHOD`, and :opcode:`STORE_ATTR`.
  6733. - bpo-46841: Use inline cache for :opcode:`BINARY_SUBSCR`.
  6734. - bpo-46841: Use inline caching for :opcode:`COMPARE_OP`.
  6735. - bpo-46864: Deprecate ``PyBytesObject.ob_shash``. It will be removed in
  6736. Python 3.13.
  6737. - bpo-46841: Use inline caching for :opcode:`UNPACK_SEQUENCE`.
  6738. - bpo-46845: Reduces dict size by removing hash value from hash table when
  6739. all inserted keys are Unicode. For example,
  6740. ``sys.getsizeof(dict.fromkeys("abcdefg"))`` becomes 272 bytes from 352
  6741. bytes on 64bit platform.
  6742. - bpo-46841: Use inline cache for :opcode:`LOAD_GLOBAL`.
  6743. - bpo-46852: Rename the private undocumented ``float.__set_format__()``
  6744. method to ``float.__setformat__()`` to fix a typo introduced in Python
  6745. 3.7. The method is only used by test_float. Patch by Victor Stinner.
  6746. - bpo-46852: Remove the undocumented private ``float.__set_format__()``
  6747. method, previously known as ``float.__setformat__()`` in Python 3.7. Its
  6748. docstring said: "You probably don't want to use this function. It exists
  6749. mainly to be used in Python's test suite." Patch by Victor Stinner.
  6750. - bpo-40116: Fix regression that dict.update(other) may don't respect
  6751. iterate order of other when other is key sharing dict.
  6752. - bpo-46712: Share global string identifiers in deep-frozen modules.
  6753. - bpo-46430: Fix memory leak in interned strings of deep-frozen modules.
  6754. - bpo-46841: Store :opcode:`BINARY_OP` caches inline using a new
  6755. :opcode:`CACHE` instruction.
  6756. - bpo-45107: Specialize ``LOAD_METHOD`` for instances with a dict.
  6757. - bpo-44337: Reduce the memory usage of specialized :opcode:`LOAD_ATTR` and
  6758. :opcode:`STORE_ATTR` instructions.
  6759. - bpo-46729: Add number of sub-exceptions to :meth:`BaseException.__str__`.
  6760. - bpo-45885: Don't un-adapt :opcode:`COMPARE_OP` when collecting
  6761. specialization stats.
  6762. - bpo-46329: Fix specialization stats gathering for :opcode:`!PRECALL`
  6763. instructions.
  6764. - bpo-46794: Bump up the libexpat version into 2.4.6
  6765. - bpo-46823: Implement a specialized combined opcode
  6766. ``LOAD_FAST__LOAD_ATTR_INSTANCE_VALUE``. Patch by Dennis Sweeney.
  6767. - bpo-46820: Fix parsing a numeric literal immediately (without spaces)
  6768. followed by "not in" keywords, like in ``1not in x``. Now the parser only
  6769. emits a warning, not a syntax error.
  6770. - bpo-46329: Move ``KW_NAMES`` before ``PRECALL`` instruction in call
  6771. sequence. Change ``operand`` of ``CALL`` to match ``PRECALL`` for easier
  6772. specialization.
  6773. - bpo-46808: Remove the ``NEXT_BLOCK`` macro from compile.c, and make the
  6774. compiler automatically generate implicit blocks when they are needed.
  6775. - bpo-46329: Add ``PUSH_NULL`` instruction. This is used as a prefix when
  6776. evaluating a callable, so that the stack has the same shape for methods
  6777. and other calls. ``PRECALL_FUNCTION`` and ``PRECALL_METHOD`` are merged
  6778. into a single ``PRECALL`` instruction.
  6779. There is no change in semantics.
  6780. - bpo-46762: Fix an assert failure in debug builds when a '<', '>', or '='
  6781. is the last character in an f-string that's missing a closing right brace.
  6782. - bpo-46730: Message of AttributeError caused by getting, setting or
  6783. deleting a property without the corresponding function now mentions that
  6784. the attribute is in fact a property and also specifies type of the class
  6785. that it belongs to.
  6786. - bpo-46724: Make sure that all backwards jumps use the ``JUMP_ABSOLUTE``
  6787. instruction, rather than ``JUMP_FORWARD`` with an argument of
  6788. ``(2**32)+offset``.
  6789. - bpo-46732: Correct the docstring for the :meth:`~object.__bool__` method.
  6790. Patch by Jelle Zijlstra.
  6791. - bpo-46072: Add more detailed specialization failure statistics for
  6792. :opcode:`BINARY_OP`.
  6793. - bpo-46707: Avoid potential exponential backtracking when producing some
  6794. syntax errors involving lots of brackets. Patch by Pablo Galindo.
  6795. - bpo-46323: :mod:`ctypes` now allocates memory on the stack instead of on
  6796. the heap to pass arguments while calling a Python callback function. Patch
  6797. by Donghee Na.
  6798. - bpo-45923: Add a quickened form of :opcode:`RESUME` that skips quickening
  6799. checks.
  6800. - bpo-46702: Specialize :opcode:`UNPACK_SEQUENCE` for :class:`tuple` and
  6801. :class:`list` unpackings.
  6802. - bpo-46072: Opcode pair stats are now gathered with ``--enable-pystats``.
  6803. Defining ``DYNAMIC_EXECUTION_PROFILE`` or ``DXPAIRS`` no longer has any
  6804. effect.
  6805. - bpo-46675: Allow more than 16 items in a split dict before it is combined.
  6806. The limit is now 254.
  6807. - bpo-40479: Add a missing call to ``va_end()`` in
  6808. ``Modules/_hashopenssl.c``.
  6809. - bpo-46323: Use :c:func:`PyObject_Vectorcall` while calling ctypes callback
  6810. function. Patch by Donghee Na.
  6811. - bpo-46615: When iterating over sets internally in ``setobject.c``, acquire
  6812. strong references to the resulting items from the set. This prevents
  6813. crashes in corner-cases of various set operations where the set gets
  6814. mutated.
  6815. - bpo-45828: The bytecode compiler now attempts to apply runtime stack
  6816. manipulations at compile-time (whenever it is feasible to do so).
  6817. - bpo-30496: Fixed a minor portability issue in the implementation of
  6818. :c:func:`PyLong_FromLong`, and added a fast path for single-digit integers
  6819. to :c:func:`PyLong_FromLongLong`.
  6820. Library
  6821. -------
  6822. - bpo-25707: Fixed a file leak in :func:`xml.etree.ElementTree.iterparse`
  6823. when the iterator is not exhausted. Patch by Jacob Walls.
  6824. - bpo-46877: Export :func:`unittest.doModuleCleanups` in :mod:`unittest`.
  6825. Patch by Kumar Aditya.
  6826. - bpo-46848: For performance, use the optimized string-searching
  6827. implementations from :meth:`~bytes.find` and :meth:`~bytes.rfind` for
  6828. :meth:`~mmap.find` and :meth:`~mmap.rfind`.
  6829. - bpo-46736: :class:`~http.server.SimpleHTTPRequestHandler` now uses HTML5
  6830. grammar. Patch by Donghee Na.
  6831. - bpo-44886: Inherit asyncio proactor datagram transport from
  6832. :class:`asyncio.DatagramTransport`.
  6833. - bpo-46827: Support UDP sockets in :meth:`asyncio.loop.sock_connect` for
  6834. selector-based event loops. Patch by Thomas Grainger.
  6835. - bpo-46811: Make test suite support Expat >=2.4.5
  6836. - bpo-46252: Raise :exc:`TypeError` if :class:`ssl.SSLSocket` is passed to
  6837. transport-based APIs.
  6838. - bpo-46784: Fix libexpat symbols collisions with user dynamically loaded or
  6839. statically linked libexpat in embedded Python.
  6840. - bpo-46786: The HTML serialisation in xml.etree.ElementTree now writes
  6841. ``embed``, ``source``, ``track`` and ``wbr`` as empty tags, as defined in
  6842. HTML 5.
  6843. - bpo-39327: :func:`shutil.rmtree` can now work with VirtualBox shared
  6844. folders when running from the guest operating-system.
  6845. - bpo-45390: Propagate :exc:`asyncio.CancelledError` message from inner task
  6846. to outer awaiter.
  6847. - bpo-46756: Fix a bug in
  6848. :meth:`urllib.request.HTTPPasswordMgr.find_user_password` and
  6849. :meth:`urllib.request.HTTPPasswordMgrWithPriorAuth.is_authenticated` which
  6850. allowed to bypass authorization. For example, access to URI
  6851. ``example.org/foobar`` was allowed if the user was authorized for URI
  6852. ``example.org/foo``.
  6853. - bpo-46737: :func:`random.gauss` and :func:`random.normalvariate` now have
  6854. default arguments.
  6855. - bpo-46752: Add task groups to asyncio (structured concurrency, inspired by
  6856. Trio's nurseries). This also introduces a change to task cancellation,
  6857. where a cancelled task can't be cancelled again until it calls
  6858. .uncancel().
  6859. - bpo-46724: Fix :mod:`dis` behavior on negative jump offsets.
  6860. - bpo-46333: The :meth:`__repr__` method of :class:`typing.ForwardRef` now
  6861. includes the ``module`` parameter of :class:`typing.ForwardRef` when it is
  6862. set.
  6863. - bpo-46643: In :func:`typing.get_type_hints`, support evaluating
  6864. stringified ``ParamSpecArgs`` and ``ParamSpecKwargs`` annotations. Patch
  6865. by Gregory Beauregard.
  6866. - bpo-45863: When the :mod:`tarfile` module creates a pax format archive, it
  6867. will put an integer representation of timestamps in the ustar header (if
  6868. possible) for the benefit of older unarchivers, in addition to the
  6869. existing full-precision timestamps in the pax extended header.
  6870. - bpo-46066: Deprecate kwargs-based syntax for :class:`typing.TypedDict`
  6871. definitions. It had confusing semantics when specifying totality, and was
  6872. largely unused. Patch by Jingchen Ye.
  6873. - bpo-46676: Make :data:`typing.ParamSpec` args and kwargs equal to
  6874. themselves. Patch by Gregory Beauregard.
  6875. - bpo-46323: ``ctypes.CFUNCTYPE()`` and ``ctypes.WINFUNCTYPE()`` now fail to
  6876. create the type if its ``_argtypes_`` member contains too many arguments.
  6877. Previously, the error was only raised when calling a function. Patch by
  6878. Victor Stinner.
  6879. - bpo-46672: Fix ``NameError`` in :func:`asyncio.gather` when initial type
  6880. check fails.
  6881. - bpo-46659: The :class:`calendar.LocaleTextCalendar` and
  6882. :class:`calendar.LocaleHTMLCalendar` classes now use
  6883. :func:`locale.getlocale`, instead of using
  6884. :func:`locale.getdefaultlocale`, if no locale is specified. Patch by
  6885. Victor Stinner.
  6886. - bpo-46659: The :func:`locale.getdefaultlocale` function is deprecated and
  6887. will be removed in Python 3.13. Use :func:`locale.setlocale`,
  6888. :func:`locale.getpreferredencoding(False) <locale.getpreferredencoding>`
  6889. and :func:`locale.getlocale` functions instead. Patch by Victor Stinner.
  6890. - bpo-46655: In :func:`typing.get_type_hints`, support evaluating bare
  6891. stringified ``TypeAlias`` annotations. Patch by Gregory Beauregard.
  6892. - bpo-45948: Fixed a discrepancy in the C implementation of the
  6893. :mod:`xml.etree.ElementTree` module. Now, instantiating an
  6894. :class:`xml.etree.ElementTree.XMLParser` with a ``target=None`` keyword
  6895. provides a default :class:`xml.etree.ElementTree.TreeBuilder` target as
  6896. the Python implementation does.
  6897. - bpo-46626: Expose Linux's ``IP_BIND_ADDRESS_NO_PORT`` option in
  6898. :mod:`socket`.
  6899. - bpo-46521: Fix a bug in the :mod:`codeop` module that was incorrectly
  6900. identifying invalid code involving string quotes as valid code.
  6901. - bpo-46571: Improve :func:`typing.no_type_check`.
  6902. Now it does not modify external classes and functions. We also now
  6903. correctly mark classmethods as not to be type checked.
  6904. - bpo-46400: expat: Update libexpat from 2.4.1 to 2.4.4
  6905. - bpo-46556: Deprecate undocumented support for using a
  6906. :class:`pathlib.Path` object as a context manager.
  6907. - bpo-46534: Implement :pep:`673` :class:`typing.Self`. Patch by James
  6908. Hilton-Balfe.
  6909. - bpo-46522: Make various module ``__getattr__`` AttributeErrors more
  6910. closely match a typical AttributeError
  6911. - bpo-46475: Add :data:`typing.Never` and :func:`typing.assert_never`. Patch
  6912. by Jelle Zijlstra.
  6913. - bpo-46333: The :meth:`__eq__` and :meth:`__hash__` methods of
  6914. :class:`typing.ForwardRef` now honor the ``module`` parameter of
  6915. :class:`typing.ForwardRef`. Forward references from different modules are
  6916. now differentiated.
  6917. - bpo-46246: Add missing ``__slots__`` to
  6918. ``importlib.metadata.DeprecatedList``. Patch by Arie Bovenberg.
  6919. - bpo-46232: The :mod:`ssl` module now handles certificates with bit strings
  6920. in DN correctly.
  6921. - bpo-46195: :func:`typing.get_type_hints` no longer adds ``Optional`` to
  6922. parameters with ``None`` as a default. This aligns to changes to PEP 484
  6923. in https://github.com/python/peps/pull/689
  6924. - bpo-31369: Add :class:`~re.RegexFlag` to ``re.__all__`` and documented it.
  6925. Add :data:`~re.RegexFlag.NOFLAG` to indicate no flags being set.
  6926. - bpo-45898: :mod:`ctypes` no longer defines ``ffi_type_*`` symbols in
  6927. ``cfield.c``. The symbols have been provided by libffi for over a decade.
  6928. - bpo-44953: Calling ``operator.itemgetter`` objects and
  6929. ``operator.attrgetter`` objects is now faster due to use of the vectorcall
  6930. calling convention.
  6931. - bpo-44289: Fix an issue with :meth:`~tarfile.is_tarfile` method when using
  6932. *fileobj* argument: position in the *fileobj* was advanced forward which
  6933. made it unreadable with :meth:`tarfile.TarFile.open`.
  6934. - bpo-44011: Reimplement SSL/TLS support in asyncio, borrow the
  6935. implementation from uvloop library.
  6936. - bpo-41086: Make the :class:`configparser.ConfigParser` constructor raise
  6937. :exc:`TypeError` if the ``interpolation`` parameter is not of type
  6938. :class:`!configparser.Interpolation`
  6939. - bpo-29418: Implement :func:`inspect.ismethodwrapper` and fix
  6940. :func:`inspect.isroutine` for cases where methodwrapper is given. Patch by
  6941. Hakan Çelik.
  6942. - bpo-14156: argparse.FileType now supports an argument of '-' in binary
  6943. mode, returning the .buffer attribute of sys.stdin/sys.stdout as
  6944. appropriate. Modes including 'x' and 'a' are treated equivalently to 'w'
  6945. when argument is '-'. Patch contributed by Josh Rosenberg
  6946. Documentation
  6947. -------------
  6948. - bpo-42238: ``Doc/tools/rstlint.py`` has moved to its own repository and is
  6949. now packaged on PyPI as ``sphinx-lint``.
  6950. Tests
  6951. -----
  6952. - bpo-46913: Fix test_faulthandler.test_sigfpe() if Python is built with
  6953. undefined behavior sanitizer (UBSAN): disable UBSAN on the
  6954. faulthandler_sigfpe() function. Patch by Victor Stinner.
  6955. - bpo-46760: Remove bytecode offsets from expected values in test.test_dis
  6956. module. Reduces the obstacles to modifying the VM or compiler.
  6957. - bpo-46708: Prevent default asyncio event loop policy modification warning
  6958. after ``test_asyncio`` execution.
  6959. - bpo-46678: The function ``make_legacy_pyc`` in
  6960. ``Lib/test/support/import_helper.py`` no longer fails when
  6961. ``PYTHONPYCACHEPREFIX`` is set to a directory on a different device from
  6962. where tempfiles are stored.
  6963. - bpo-46623: Skip test_pair() and test_speech128() of test_zlib on s390x
  6964. since they fail if zlib uses the s390x hardware accelerator. Patch by
  6965. Victor Stinner.
  6966. Build
  6967. -----
  6968. - bpo-46860: Respect ``--with-suffix`` when building on case-insensitive
  6969. file systems.
  6970. - bpo-46656: Building Python now requires a C11 compiler. Optional C11
  6971. features are not required. Patch by Victor Stinner.
  6972. - bpo-46656: Building Python now requires support for floating point
  6973. Not-a-Number (NaN): remove the ``Py_NO_NAN`` macro. Patch by Victor
  6974. Stinner.
  6975. - bpo-46640: Building Python now requires a C99 ``<math.h>`` header file
  6976. providing a ``NAN`` constant, or the ``__builtin_nan()`` built-in
  6977. function. Patch by Victor Stinner.
  6978. - bpo-46608: Exclude marshalled-frozen data if deep-freezing to save 300 KB
  6979. disk space. This includes adding a new ``is_package`` field to
  6980. :c:struct:`_frozen`. Patch by Kumar Aditya.
  6981. - bpo-40280: Fix wasm32-emscripten test failures and platform issues. -
  6982. Disable syscalls that are not supported or don't work, e.g. wait,
  6983. getrusage, prlimit, mkfifo, mknod, setres[gu]id, setgroups. - Use fd_count
  6984. to cound open fds. - Add more checks for subprocess and fork. - Add
  6985. workarounds for missing _multiprocessing and failing socket.accept(). -
  6986. Enable bzip2. - Disable large file support. - Disable signal.alarm.
  6987. - bpo-46430: Intern strings in deep-frozen modules. Patch by Kumar Aditya.
  6988. Windows
  6989. -------
  6990. - bpo-46744: The default all users install directory for ARM64 is now under
  6991. the native ``Program Files`` folder, rather than ``Program Files (Arm)``
  6992. which is intended for ARM (32-bit) files.
  6993. - bpo-46567: Adds Tcl and Tk support for Windows ARM64. This also adds IDLE
  6994. to the installation.
  6995. - bpo-46638: Ensures registry virtualization is consistently disabled. For
  6996. 3.10 and earlier, it remains enabled (some registry writes are protected),
  6997. while for 3.11 and later it is disabled (registry modifications affect all
  6998. applications).
  6999. IDLE
  7000. ----
  7001. - bpo-46630: Make query dialogs on Windows start with a cursor in the entry
  7002. box.
  7003. - bpo-45447: Apply IDLE syntax highlighting to ``.pyi`` files. Patch by Alex
  7004. Waygood and Terry Jan Reedy.
  7005. C API
  7006. -----
  7007. - bpo-46748: Python's public headers no longer import ``<stdbool.h>``,
  7008. leaving code that embedd/extends Python free to define ``bool``, ``true``
  7009. and ``false``.
  7010. - bpo-46836: Move the :c:type:`PyFrameObject` type definition (``struct
  7011. _frame``) to the internal C API ``pycore_frame.h`` header file. Patch by
  7012. Victor Stinner.
  7013. - bpo-45459: Rename ``Include/buffer.h`` header file to
  7014. ``Include/pybuffer.h`` to avoid conflits with projects having an existing
  7015. ``buffer.h`` header file. Patch by Victor Stinner.
  7016. - bpo-45412: Remove the ``HAVE_PY_SET_53BIT_PRECISION`` macro (moved to the
  7017. internal C API). Patch by Victor Stinner.
  7018. - bpo-46613: Added function :c:func:`PyType_GetModuleByDef`, which allows
  7019. accesss to module state when a method's defining class is not available.
  7020. What's New in Python 3.11.0 alpha 5?
  7021. ====================================
  7022. *Release date: 2022-02-03*
  7023. Core and Builtins
  7024. -----------------
  7025. - bpo-45773: Remove two invalid "peephole" optimizations from the bytecode
  7026. compiler.
  7027. - bpo-46564: Do not create frame objects when creating :class:`super`
  7028. object. Patch by Kumar Aditya.
  7029. - bpo-45885: Added more fined-grained specialization failure stats regarding
  7030. the ``COMPARE_OP`` bytecode.
  7031. - bpo-44977: The delegation of :func:`int` to :meth:`__trunc__` is now
  7032. deprecated. Calling ``int(a)`` when ``type(a)`` implements
  7033. :meth:`__trunc__` but not :meth:`__int__` or :meth:`__index__` now raises
  7034. a :exc:`DeprecationWarning`.
  7035. - bpo-46458: Reorder code emitted by the compiler for a
  7036. :keyword:`try`-:keyword:`except` block so that the :keyword:`else` block's
  7037. code immediately follows the :keyword:`try` body (without a jump). This is
  7038. more optimal for the happy path.
  7039. - bpo-46527: Allow passing ``iterable`` as a keyword argument to
  7040. :func:`enumerate` again. Patch by Jelle Zijlstra.
  7041. - bpo-46528: Replace several stack manipulation instructions (``DUP_TOP``,
  7042. ``DUP_TOP_TWO``, ``ROT_TWO``, ``ROT_THREE``, ``ROT_FOUR``, and ``ROT_N``)
  7043. with new :opcode:`COPY` and :opcode:`SWAP` instructions.
  7044. - bpo-46329: Use two or three bytecodes to implement most calls.
  7045. Calls without named arguments are implemented as a sequence of two
  7046. instructions: ``PRECALL; CALL``. Calls with named arguments are
  7047. implemented as a sequence of three instructions: ``PRECALL; KW_NAMES;
  7048. CALL``. There are two different ``PRECALL`` instructions:
  7049. ``PRECALL_FUNTION`` and ``PRECALL_METHOD``. The latter pairs with
  7050. ``LOAD_METHOD``.
  7051. This partition into pre-call and call allows better specialization, and
  7052. thus better performance ultimately.
  7053. There is no change in semantics.
  7054. - bpo-46503: Fix an assert when parsing some invalid \N escape sequences in
  7055. f-strings.
  7056. - bpo-46431: Improve error message on invalid calls to
  7057. :meth:`BaseExceptionGroup.__new__`.
  7058. - bpo-46476: Fix memory leak in code objects generated by deepfreeze. Patch
  7059. by Kumar Aditya.
  7060. - bpo-46481: Speed up calls to :meth:`weakref.ref.__call__` by using the
  7061. :pep:`590` ``vectorcall`` calling convention. Patch by Donghee Na.
  7062. - bpo-46417: Fix a race condition on setting a type ``__bases__`` attribute:
  7063. the internal function ``add_subclass()`` now gets the
  7064. ``PyTypeObject.tp_subclasses`` member after calling
  7065. :c:func:`PyWeakref_NewRef` which can trigger a garbage collection which
  7066. can indirectly modify ``PyTypeObject.tp_subclasses``. Patch by Victor
  7067. Stinner.
  7068. - bpo-46417: ``python -X showrefcount`` now shows the total reference count
  7069. after clearing and destroyed the main Python interpreter. Previously, it
  7070. was shown before. Patch by Victor Stinner.
  7071. - bpo-43683: Add ASYNC_GEN_WRAP opcode to wrap the value to be yielded in
  7072. async generators. Removes the need to special case async generators in the
  7073. ``YIELD_VALUE`` instruction.
  7074. - bpo-46407: Optimize some modulo operations in ``Objects/longobject.c``.
  7075. Patch by Jeremiah Vivian.
  7076. - bpo-46409: Add new ``RETURN_GENERATOR`` bytecode to make generators.
  7077. Simplifies calling Python functions in the VM, as they no longer any need
  7078. to special case generator functions.
  7079. Also add ``JUMP_NO_INTERRUPT`` bytecode that acts like ``JUMP_ABSOLUTE``,
  7080. but does not check for interrupts.
  7081. - bpo-46406: The integer division ``//`` implementation has been optimized
  7082. to better let the compiler understand its constraints. It can be 20%
  7083. faster on the amd64 platform when dividing an int by a value smaller than
  7084. ``2**30``.
  7085. - bpo-46383: Fix invalid signature of ``_zoneinfo``'s ``module_free``
  7086. function to resolve a crash on wasm32-emscripten platform.
  7087. - bpo-46361: Ensure that "small" integers created by :meth:`int.from_bytes`
  7088. and :class:`decimal.Decimal` are properly cached.
  7089. - bpo-46161: Fix the class building error when the arguments are constants
  7090. and CALL_FUNCTION_EX is used.
  7091. - bpo-46028: Fixes calculation of :data:`sys._base_executable` when inside a
  7092. virtual environment that uses symlinks with different binary names than
  7093. the base environment provides.
  7094. - bpo-46091: Correctly calculate indentation levels for lines with
  7095. whitespace character that are ended by line continuation characters. Patch
  7096. by Pablo Galindo
  7097. - bpo-30512: Add CAN Socket support for NetBSD.
  7098. - bpo-46045: Do not use POSIX semaphores on NetBSD
  7099. - bpo-44024: Improve the :exc:`TypeError` message for non-string second
  7100. arguments passed to the built-in functions :func:`getattr` and
  7101. :func:`hasattr`. Patch by Géry Ogam.
  7102. Library
  7103. -------
  7104. - bpo-46624: Restore support for non-integer arguments of
  7105. :func:`random.randrange` and :func:`random.randint`.
  7106. - bpo-46591: Make the IDLE doc URL on the About IDLE dialog clickable.
  7107. - bpo-46565: Remove loop variables that are leaking into modules'
  7108. namespaces.
  7109. - bpo-46553: In :func:`typing.get_type_hints`, support evaluating bare
  7110. stringified ``ClassVar`` annotations. Patch by Gregory Beauregard.
  7111. - bpo-46544: Don't leak ``x`` & ``uspace`` intermediate vars in
  7112. :class:`textwrap.TextWrapper`.
  7113. - bpo-46487: Add the ``get_write_buffer_limits`` method to
  7114. :class:`asyncio.transports.WriteTransport` and to the SSL transport.
  7115. - bpo-45173: Note the configparser deprecations will be removed in Python
  7116. 3.12.
  7117. - bpo-45162: The deprecated :mod:`unittest` APIs removed in 3.11a1 have been
  7118. temporarily restored to be removed in 3.12 while cleanups in external
  7119. projects go in.
  7120. - bpo-46539: In :func:`typing.get_type_hints`, support evaluating
  7121. stringified ``ClassVar`` and ``Final`` annotations inside ``Annotated``.
  7122. Patch by Gregory Beauregard.
  7123. - bpo-46510: Add missing test for :class:`types.TracebackType` and
  7124. :class:`types.FrameType`. Calculate them directly from the caught
  7125. exception without calling :func:`sys.exc_info`.
  7126. - bpo-46491: Allow :data:`typing.Annotated` to wrap :data:`typing.Final` and
  7127. :data:`typing.ClassVar`. Patch by Gregory Beauregard.
  7128. - bpo-46483: Remove :meth:`~object.__class_getitem__` from
  7129. :class:`pathlib.PurePath` as this class was not supposed to be generic.
  7130. - bpo-46436: Fix command-line option ``-d``/``--directory`` in module
  7131. :mod:`http.server` which is ignored when combined with command-line option
  7132. ``--cgi``. Patch by Géry Ogam.
  7133. - bpo-41403: Make :meth:`mock.patch` raise a :exc:`TypeError` with a
  7134. relevant error message on invalid arg. Previously it allowed a cryptic
  7135. :exc:`AttributeError` to escape.
  7136. - bpo-46474: In ``importlib.metadata.EntryPoint.pattern``, avoid potential
  7137. REDoS by limiting ambiguity in consecutive whitespace.
  7138. - bpo-46474: Removed private method from ``importlib.metadata.Path``. Sync
  7139. with importlib_metadata 4.10.0.
  7140. - bpo-46470: Remove unused branch from ``typing._remove_dups_flatten``
  7141. - bpo-46469: :mod:`asyncio` generic classes now return
  7142. :class:`types.GenericAlias` in ``__class_getitem__`` instead of the same
  7143. class.
  7144. - bpo-41906: Support passing filter instances in the ``filters`` values of
  7145. ``handlers`` and ``loggers`` in the dictionary passed to
  7146. :func:`logging.config.dictConfig`.
  7147. - bpo-46422: Use ``dis.Positions`` in ``dis.Instruction`` instead of a
  7148. regular ``tuple``.
  7149. - bpo-46434: :mod:`pdb` now gracefully handles ``help`` when :attr:`__doc__`
  7150. is missing, for example when run with pregenerated optimized ``.pyc``
  7151. files.
  7152. - bpo-43869: Python uses the same time Epoch on all platforms. Add an
  7153. explicit unit test to ensure that it's the case. Patch by Victor Stinner.
  7154. - bpo-46414: Add :func:`typing.reveal_type`. Patch by Jelle Zijlstra.
  7155. - bpo-40280: :mod:`subprocess` now imports Windows-specific imports when
  7156. ``msvcrt`` module is available, and POSIX-specific imports on all other
  7157. platforms. This gives a clean exception when ``_posixsubprocess`` is not
  7158. available (e.g. Emscripten browser target).
  7159. - bpo-40066: ``IntEnum``, ``IntFlag``, and ``StrEnum`` use the mixed-in type
  7160. for their ``str()`` and ``format()`` output.
  7161. - bpo-46316: Optimize :meth:`pathlib.Path.iterdir` by removing an
  7162. unnecessary check for special entries.
  7163. - bpo-29688: Document :meth:`pathlib.Path.absolute` (which has always
  7164. existed).
  7165. - bpo-43012: The pathlib module's obsolete and internal ``_Accessor`` class
  7166. has been removed to prepare the terrain for upcoming enhancements to the
  7167. module.
  7168. - bpo-46258: Speed up :func:`math.isqrt` for small positive integers by
  7169. replacing two division steps with a lookup table.
  7170. - bpo-46242: Improve error message when creating a new :class:`enum.Enum`
  7171. type subclassing an existing ``Enum`` with ``_member_names_`` using
  7172. :meth:`enum.Enum.__call__`.
  7173. - bpo-43118: Fix a bug in :func:`inspect.signature` that was causing it to
  7174. fail on some subclasses of classes with a ``__text_signature__``
  7175. referencing module globals. Patch by Weipeng Hong.
  7176. - bpo-26552: Fixed case where failing :func:`asyncio.ensure_future` did not
  7177. close the coroutine. Patch by Kumar Aditya.
  7178. - bpo-21987: Fix an issue with :meth:`tarfile.TarFile.getmember` getting a
  7179. directory name with a trailing slash.
  7180. - bpo-46124: Update :mod:`zoneinfo` to rely on importlib.resources
  7181. traversable API.
  7182. - bpo-46103: Now :func:`inspect.getmembers` only gets :attr:`__bases__`
  7183. attribute from class type. Patch by Weipeng Hong.
  7184. - bpo-46080: Fix exception in argparse help text generation if a
  7185. :class:`argparse.BooleanOptionalAction` argument's default is
  7186. ``argparse.SUPPRESS`` and it has ``help`` specified. Patch by Felix
  7187. Fontein.
  7188. - bpo-44791: Fix substitution of :class:`~typing.ParamSpec` in
  7189. :data:`~typing.Concatenate` with different parameter expressions.
  7190. Substitution with a list of types returns now a tuple of types.
  7191. Substitution with ``Concatenate`` returns now a ``Concatenate`` with
  7192. concatenated lists of arguments.
  7193. Documentation
  7194. -------------
  7195. - bpo-46463: Fixes :file:`escape4chm.py` script used when building the CHM
  7196. documentation file
  7197. Tests
  7198. -----
  7199. - bpo-43478: Mocks can no longer be provided as the specs for other Mocks.
  7200. As a result, an already-mocked object cannot be passed to ``mock.Mock()``.
  7201. This can uncover bugs in tests since these Mock-derived Mocks will always
  7202. pass certain tests (e.g. isinstance) and builtin assert functions (e.g.
  7203. assert_called_once_with) will unconditionally pass.
  7204. - bpo-46616: Ensures ``test_importlib.test_windows`` cleans up registry keys
  7205. after completion.
  7206. - bpo-44359: test_ftplib now silently ignores socket errors to prevent
  7207. logging unhandled threading exceptions. Patch by Victor Stinner.
  7208. - bpo-46600: Fix test_gdb.test_pycfunction() for Python built with ``clang
  7209. -Og``. Tolerate inlined functions in the gdb traceback. Patch by Victor
  7210. Stinner.
  7211. - bpo-46542: Fix a Python crash in test_lib2to3 when using Python built in
  7212. debug mode: limit the recursion limit. Patch by Victor Stinner.
  7213. - bpo-46576: test_peg_generator now disables compiler optimization when
  7214. testing compilation of its own C extensions to significantly speed up the
  7215. testing on non-debug builds of CPython.
  7216. - bpo-46542: Fix ``test_json`` tests checking for :exc:`RecursionError`:
  7217. modify these tests to use ``support.infinite_recursion()``. Patch by
  7218. Victor Stinner.
  7219. - bpo-13886: Skip test_builtin PTY tests on non-ASCII characters if the
  7220. readline module is loaded. The readline module changes input() behavior,
  7221. but test_builtin is not intented to test the readline module. Patch by
  7222. Victor Stinner.
  7223. - bpo-40280: Add :func:`test.support.requires_fork` decorators to mark tests
  7224. that require a working :func:`os.fork`.
  7225. - bpo-40280: Add :func:`test.support.requires_subprocess` decorator to mark
  7226. tests which require working :mod:`subprocess` module or ``os.spawn*``. The
  7227. wasm32-emscripten platform has no support for processes.
  7228. - bpo-46126: Disable 'descriptions' when running tests internally.
  7229. Build
  7230. -----
  7231. - bpo-46602: Tidied up configure.ac so that conftest.c is truncated rather
  7232. than appended. This assists in the case where the 'rm' of conftest.c fails
  7233. to happen between tests. Downstream issues such as a clobbered SOABI can
  7234. result.
  7235. - bpo-46600: Fix the test checking if the C compiler supports ``-Og`` option
  7236. in the ``./configure`` script to also use ``-Og`` on clang which supports
  7237. it. Patch by Victor Stinner.
  7238. - bpo-38472: Fix GCC detection in setup.py when cross-compiling. The C
  7239. compiler is now run with LC_ALL=C. Previously, the detection failed with a
  7240. German locale.
  7241. - bpo-46513: :program:`configure` no longer uses ``AC_C_CHAR_UNSIGNED``
  7242. macro and ``pyconfig.h`` no longer defines reserved symbol
  7243. ``__CHAR_UNSIGNED__``.
  7244. - bpo-46471: Use global singletons for single byte bytes objects in
  7245. deepfreeze.
  7246. - bpo-46443: Deepfreeze now uses cached small integers as it saves some
  7247. space for common small integers.
  7248. - bpo-46429: Merge all deep-frozen files into one for space savings. Patch
  7249. by Kumar Aditya.
  7250. - bpo-45569: The build now defaults to using 30-bit digits for Python
  7251. integers. Previously either 15-bit or 30-bit digits would be selected,
  7252. depending on the platform. 15-bit digits may still be selected using the
  7253. ``--enable-big-digits=15`` option to the ``configure`` script, or by
  7254. defining ``PYLONG_BITS_IN_DIGIT`` in ``pyconfig.h``.
  7255. - bpo-45925: Update Windows installer to use SQLite 3.37.2.
  7256. - bpo-43112: Detect musl libc as a separate SOABI (tagged as
  7257. ``linux-musl``).
  7258. Windows
  7259. -------
  7260. - bpo-33125: The traditional EXE/MSI based installer for Windows is now
  7261. available for ARM64
  7262. - bpo-46362: os.path.abspath("C:\CON") is now fixed to return "\\.\CON", not
  7263. the same path. The regression was true of all legacy DOS devices such as
  7264. COM1, LPT1, or NUL.
  7265. - bpo-44934: The installer now offers a command-line only option to add the
  7266. installation directory to the end of :envvar:`PATH` instead of at the
  7267. start.
  7268. macOS
  7269. -----
  7270. - bpo-45925: Update macOS installer to SQLite 3.37.2.
  7271. IDLE
  7272. ----
  7273. - bpo-45296: Clarify close, quit, and exit in IDLE. In the File menu,
  7274. 'Close' and 'Exit' are now 'Close Window' (the current one) and 'Exit' is
  7275. now 'Exit IDLE' (by closing all windows). In Shell, 'quit()' and 'exit()'
  7276. mean 'close Shell'. If there are no other windows, this also exits IDLE.
  7277. C API
  7278. -----
  7279. - bpo-40170: Remove the ``PyHeapType_GET_MEMBERS()`` macro. It was exposed
  7280. in the public C API by mistake, it must only be used by Python internally.
  7281. Use the ``PyTypeObject.tp_members`` member instead. Patch by Victor
  7282. Stinner.
  7283. - bpo-40170: Move _Py_GetAllocatedBlocks() and _PyObject_DebugMallocStats()
  7284. private functions to the internal C API. Patch by Victor Stinner.
  7285. - bpo-46433: The internal function _PyType_GetModuleByDef now correctly
  7286. handles inheritance patterns involving static types.
  7287. - bpo-45459: :c:type:`Py_buffer` and various ``Py_buffer`` related functions
  7288. are now part of the limited API and stable ABI.
  7289. - bpo-14916: Fixed bug in the tokenizer that prevented
  7290. ``PyRun_InteractiveOne`` from parsing from the provided FD.
  7291. What's New in Python 3.11.0 alpha 4?
  7292. ====================================
  7293. *Release date: 2022-01-13*
  7294. Core and Builtins
  7295. -----------------
  7296. - bpo-46070: :c:func:`Py_EndInterpreter` now explicitly untracks all objects
  7297. currently tracked by the GC. Previously, if an object was used later by
  7298. another interpreter, calling :c:func:`PyObject_GC_UnTrack` on the object
  7299. crashed if the previous or the next object of the :c:type:`PyGC_Head`
  7300. structure became a dangling pointer. Patch by Victor Stinner.
  7301. - bpo-46347: Fix memory leak in PyEval_EvalCodeEx.
  7302. - bpo-46339: Fix a crash in the parser when retrieving the error text for
  7303. multi-line f-strings expressions that do not start in the first line of
  7304. the string. Patch by Pablo Galindo
  7305. - bpo-46331: Do not set line number of instruction storing doc-string. Fixes
  7306. regression introduced in 3.11 alpha.
  7307. - bpo-46314: Remove spurious "call" event when creating a lambda function
  7308. that was accidentally introduced in 3.11a4.
  7309. - bpo-46289: ASDL declaration of ``FormattedValue`` has changed to reflect
  7310. ``conversion`` field is not optional.
  7311. - bpo-46297: Fixed an interpreter crash on bootup with multiple PythonPaths
  7312. set in the Windows registry. Patch by Derzsi Dániel.
  7313. - bpo-46237: Fix the line number of tokenizer errors inside f-strings. Patch
  7314. by Pablo Galindo.
  7315. - bpo-46263: We always expect the "use_frozen_modules" config to be set, now
  7316. that getpath.c was rewritten in pure Python and the logic improved.
  7317. - bpo-46006: Fix a regression when a type method like ``__init__()`` is
  7318. modified in a subinterpreter. Fix a regression in
  7319. ``_PyUnicode_EqualToASCIIId()`` and type ``update_slot()``. Revert the
  7320. change which made the Unicode dictionary of interned strings compatible
  7321. with subinterpreters: the internal interned dictionary is shared again by
  7322. all interpreters. Patch by Victor Stinner.
  7323. - bpo-45923: Add RESUME opcode. This is a logical no-op. It is emitted by
  7324. the compiler anywhere a Python function can be entered. It is used by the
  7325. interpreter to perform tracing and optimizer checks.
  7326. - bpo-46208: Fix the regression of os.path.normpath("A/../../B") not
  7327. returning expected "../B" but "B".
  7328. - bpo-46240: Correct the error message for unclosed parentheses when the
  7329. tokenizer doesn't reach the end of the source when the error is reported.
  7330. Patch by Pablo Galindo
  7331. - bpo-46009: Remove the ``GEN_START`` opcode.
  7332. - bpo-46235: Certain sequence multiplication operations like ``[0] * 1_000``
  7333. are now faster due to reference-counting optimizations. Patch by Dennis
  7334. Sweeney.
  7335. - bpo-46221: :opcode:`!PREP_RERAISE_STAR` no longer pushes ``lasti`` to the
  7336. stack.
  7337. - bpo-46202: Remove :opcode:`!POP_EXCEPT_AND_RERAISE` and replace it by an
  7338. equivalent sequence of other opcodes.
  7339. - bpo-46085: Fix iterator cache mechanism of :class:`OrderedDict`.
  7340. - bpo-46055: Speed up shifting operation involving integers less than
  7341. :c:macro:`PyLong_BASE`. Patch by Xinhang Xu.
  7342. - bpo-46110: Add a maximum recursion check to the PEG parser to avoid stack
  7343. overflow. Patch by Pablo Galindo
  7344. - bpo-46107: Fix bug where :meth:`ExceptionGroup.split` and
  7345. :meth:`ExceptionGroup.subgroup` did not copy the exception group's
  7346. ``__note__`` field to the parts.
  7347. - bpo-45711: The interpreter state's representation of handled exceptions
  7348. (a.k.a exc_info, or _PyErr_StackItem) now has only the ``exc_value``
  7349. field, ``exc_type`` and ``exc_traceback`` have been removed as their
  7350. values can be derived from ``exc_value``.
  7351. - bpo-44525: Replace the four call bytecode instructions which one pre-call
  7352. instruction and two call instructions.
  7353. Removes ``CALL_FUNCTION``, ``CALL_FUNCTION_KW``, ``CALL_METHOD`` and
  7354. ``CALL_METHOD_KW``.
  7355. Adds ``CALL_NO_KW`` and ``CALL_KW`` call instructions, and
  7356. ``PRECALL_METHOD`` prefix for pairing with ``LOAD_METHOD``.
  7357. - bpo-46039: Remove the ``YIELD_FROM`` instruction and replace it with the
  7358. ``SEND`` instruction which performs the same operation, but without the
  7359. loop.
  7360. - bpo-45635: The code called from :c:func:`_PyErr_Display` was refactored to
  7361. improve error handling. It now exits immediately upon an unrecoverable
  7362. error.
  7363. - bpo-46054: Fix parser error when parsing non-utf8 characters in source
  7364. files. Patch by Pablo Galindo.
  7365. - bpo-46042: Improve the location of the caret in :exc:`SyntaxError`
  7366. exceptions emitted by the symbol table. Patch by Pablo Galindo.
  7367. - bpo-46049: Ensure :file:`._pth` files work as intended on platforms other
  7368. than Windows.
  7369. - bpo-46048: Fixes parsing of :file:`._pth` files on startup so that
  7370. single-character paths are correctly read.
  7371. - bpo-37971: Fix a bug where the line numbers given in a traceback when a
  7372. decorator application raised an exception were wrong.
  7373. - bpo-46031: Add :opcode:`POP_JUMP_IF_NOT_NONE` and
  7374. :opcode:`POP_JUMP_IF_NONE` opcodes to speed up conditional jumps.
  7375. - bpo-45654: Deepfreeze :mod:`runpy`, patch by Kumar Aditya.
  7376. - bpo-46025: Fix a crash in the :mod:`atexit` module involving functions
  7377. that unregister themselves before raising exceptions. Patch by Pablo
  7378. Galindo.
  7379. - bpo-46000: Improve compatibility of the :mod:`curses` module with NetBSD
  7380. curses.
  7381. - bpo-44525: Specialize the CALL_FUNCTION instruction for calls to builtin
  7382. types with a single argument. Speeds up ``range(x)``, ``list(x)``, and
  7383. specifically ``type(obj)``.
  7384. - bpo-42918: Fix bug where the built-in :func:`compile` function did not
  7385. always raise a :exc:`SyntaxError` when passed multiple statements in
  7386. 'single' mode. Patch by Weipeng Hong.
  7387. - bpo-45953: The main interpreter in _PyRuntimeState.interpreters is now
  7388. statically allocated (as part of _PyRuntime). Likewise for the initial
  7389. thread state of each interpreter. This means less allocation during
  7390. runtime init, as well as better memory locality for these key state
  7391. objects.
  7392. - bpo-45292: Complete the :pep:`654` implementation: add ``except*``.
  7393. - bpo-43413: Revert changes in ``set.__init__``. Subclass of :class:`set`
  7394. needs to define a ``__init__()`` method if it defines a ``__new__()``
  7395. method with additional keyword parameters.
  7396. - bpo-43931: Added the :c:data:`Py_Version` constant which bears the same
  7397. value as :c:macro:`PY_VERSION_HEX`. Patch by Gabriele N. Tornetta.
  7398. Library
  7399. -------
  7400. - bpo-46342: The ``@typing.final`` decorator now sets the ``__final__``
  7401. attribute on the decorated object to allow runtime introspection. Patch by
  7402. Jelle Zijlstra.
  7403. - bpo-46328: Added the :meth:`sys.exception` method which returns the active
  7404. exception instance.
  7405. - bpo-46307: Add :meth:`string.Template.is_valid` and
  7406. :meth:`string.Template.get_identifiers` methods.
  7407. - bpo-46306: Assume that :class:`types.CodeType` always has
  7408. :attr:`types.CodeType.co_firstlineno` in :mod:`doctest`.
  7409. - bpo-40479: Fix :mod:`hashlib` *usedforsecurity* option to work correctly
  7410. with OpenSSL 3.0.0 in FIPS mode.
  7411. - bpo-46070: Fix possible segfault when importing the :mod:`asyncio` module
  7412. from different sub-interpreters in parallel. Patch by Erlend E. Aasland.
  7413. - bpo-46244: Removed ``__slots__`` from :class:`typing.ParamSpec` and
  7414. :class:`typing.TypeVar`. They served no purpose. Patch by Arie Bovenberg.
  7415. - bpo-46278: Reflect ``context`` argument in ``AbstractEventLoop.call_*()``
  7416. methods. Loop implementations already support it.
  7417. - bpo-46269: Remove special-casing of ``__new__`` in
  7418. :meth:`enum.Enum.__dir__`.
  7419. - bpo-46266: Improve day constants in :mod:`calendar`.
  7420. Now all constants (``MONDAY`` ... ``SUNDAY``) are documented, tested, and
  7421. added to ``__all__``.
  7422. - bpo-46257: Optimized the mean, variance, and stdev functions in the
  7423. statistics module. If the input is an iterator, it is consumed in a single
  7424. pass rather than eating memory by conversion to a list. The single pass
  7425. algorithm is about twice as fast as the previous two pass code.
  7426. - bpo-41011: Added two new variables to *pyvenv.cfg* which is generated by
  7427. :mod:`venv` module: *executable* for the executable and *command* for the
  7428. command line used to create the environment.
  7429. - bpo-46239: Improve error message when importing
  7430. :mod:`asyncio.windows_events` on non-Windows.
  7431. - bpo-46238: Reuse ``_winapi`` constants in ``asyncio.windows_events``.
  7432. - bpo-46222: Adding ``SF_NOCACHE`` sendfile constant for FreeBSD for the
  7433. posixmodule.
  7434. - bpo-37295: Add fast path for ``0 <= k <= n <= 67`` for :func:`math.comb`.
  7435. - bpo-46176: Adding the ``MAP_STACK`` constant for the mmap module.
  7436. - bpo-43424: Deprecate :attr:`webbrowser.MacOSXOSAScript._name` and use
  7437. ``name`` instead.
  7438. - bpo-45321: Added missing error codes to module
  7439. ``xml.parsers.expat.errors``.
  7440. - bpo-46125: Refactor tests to test traversable API directly. Includes
  7441. changes from importlib 5.4.0.
  7442. - bpo-46118: Moved importlib.resources and its related functionality to a
  7443. package.
  7444. - bpo-37578: Add *include_hidden* parameter to :func:`~glob.glob` and
  7445. :func:`~glob.iglob` to match hidden files and directories when using
  7446. special characters like ``*``, ``**``, ``?`` and ``[]``.
  7447. - bpo-20369: :func:`concurrent.futures.wait` no longer blocks forever when
  7448. given duplicate Futures. Patch by Kumar Aditya.
  7449. - bpo-46105: Honor spec when generating requirement specs with urls and
  7450. extras (importlib_metadata 4.8.3).
  7451. - bpo-44893: EntryPoint objects are no longer tuples. Recommended means to
  7452. access is by attribute ('.name', '.group') or accessor ('.load()'). Access
  7453. by index is deprecated and will raise deprecation warning.
  7454. - bpo-22815: Print unexpected successes together with failures and errors in
  7455. summary in :class:`unittest.TextTestResult`.
  7456. - bpo-22047: Calling :meth:`add_argument_group` on an argument group is
  7457. deprecated. Calling :meth:`add_argument_group` or
  7458. :meth:`add_mutually_exclusive_group` on a mutually exclusive group is
  7459. deprecated.
  7460. These features were never supported and do not always work correctly. The
  7461. functions exist on the API by accident through inheritance and will be
  7462. removed in the future.
  7463. - bpo-26952: :mod:`argparse` raises :exc:`ValueError` with clear message
  7464. when trying to render usage for an empty mutually exclusive group.
  7465. Previously it raised a cryptic :exc:`IndexError`.
  7466. - bpo-45615: Functions in the :mod:`traceback` module raise :exc:`TypeError`
  7467. rather than :exc:`AttributeError` when an exception argument is not of
  7468. type :exc:`BaseException`.
  7469. - bpo-16594: Add allow allow_reuse_port flag in socketserver.
  7470. - bpo-27718: Fix help for the :mod:`signal` module. Some functions (e.g.
  7471. ``signal()`` and ``getsignal()``) were omitted.
  7472. - bpo-46032: The ``registry()`` method of :func:`functools.singledispatch`
  7473. functions checks now the first argument or the first parameter annotation
  7474. and raises a TypeError if it is not supported. Previously unsupported
  7475. "types" were ignored (e.g. ``typing.List[int]``) or caused an error at
  7476. calling time (e.g. ``list[int]``).
  7477. - bpo-46014: Add ability to use ``typing.Union`` and ``types.UnionType`` as
  7478. dispatch argument to ``functools.singledispatch``. Patch provided by Yurii
  7479. Karabas.
  7480. - bpo-27062: Add :attr:`__all__` to :mod:`inspect`, patch by Kumar Aditya.
  7481. - bpo-46018: Ensure that :func:`math.expm1` does not raise on underflow.
  7482. - bpo-46016: Adding :attr:`F_DUP2FD` and :attr:`F_DUP2FD_CLOEXEC` constants
  7483. from FreeBSD into the fcntl module.
  7484. - bpo-45755: :mod:`typing` generic aliases now reveal the class attributes
  7485. of the original generic class when passed to ``dir()``. This was the
  7486. behavior up to Python 3.6, but was changed in 3.7-3.9.
  7487. - bpo-45874: The empty query string, consisting of no query arguments, is
  7488. now handled correctly in ``urllib.parse.parse_qsl``. This caused problems
  7489. before when strict parsing was enabled.
  7490. - bpo-44674: Change how dataclasses disallows mutable default values. It
  7491. used to use a list of known types (list, dict, set). Now it disallows
  7492. unhashable objects to be defaults. It's using unhashability as a proxy
  7493. for mutability. Patch by Eric V. Smith, idea by Raymond Hettinger.
  7494. - bpo-23882: Remove namespace package (PEP 420) support from unittest
  7495. discovery. It was introduced in Python 3.4 but has been broken since
  7496. Python 3.7.
  7497. - bpo-25066: Added a :meth:`__repr__` method to
  7498. :class:`multiprocessing.Event` objects, patch by Kumar Aditya.
  7499. - bpo-45643: Added :const:`signal.SIGSTKFLT` on platforms where this signal
  7500. is defined.
  7501. - bpo-44092: Fetch across rollback no longer raises
  7502. :exc:`~sqlite3.InterfaceError`. Instead we leave it to the SQLite library
  7503. to handle these cases. Patch by Erlend E. Aasland.
  7504. - bpo-42413: Replace ``concurrent.futures.TimeoutError`` and
  7505. ``asyncio.TimeoutError`` with builtin :exc:`TimeoutError`, keep these
  7506. names as deprecated aliases.
  7507. Documentation
  7508. -------------
  7509. - bpo-46196: Document method :meth:`cmd.Cmd.columnize`.
  7510. - bpo-46120: State that ``|`` is preferred for readability over ``Union`` in
  7511. the :mod:`typing` docs.
  7512. - bpo-46109: Extracted ``importlib.resources`` and
  7513. ``importlib.resources.abc`` documentation into separate files.
  7514. - bpo-19737: Update the documentation for the :func:`globals` function.
  7515. Tests
  7516. -----
  7517. - bpo-46296: Add a test case for :mod:`enum` with ``_use_args_ == True`` and
  7518. ``_member_type_ == object``.
  7519. - bpo-46205: Fix hang in runtest_mp due to race condition
  7520. - bpo-46263: Fix test_capi on FreeBSD 14-dev: instruct jemalloc to not fill
  7521. freed memory with junk byte.
  7522. - bpo-46262: Cover ``ValueError`` path in tests for
  7523. :meth:`enum.Flag._missing_`.
  7524. - bpo-46150: Now ``fakename`` in
  7525. ``test_pathlib.PosixPathTest.test_expanduser`` is checked to be
  7526. non-existent.
  7527. - bpo-46129: Rewrite ``asyncio.locks`` tests with
  7528. :class:`unittest.IsolatedAsyncioTestCase` usage.
  7529. - bpo-23819: Fixed :mod:`asyncio` tests in python optimized mode. Patch by
  7530. Kumar Aditya.
  7531. - bpo-46114: Fix test case for OpenSSL 3.0.1 version. OpenSSL 3.0 uses
  7532. ``0xMNN00PP0L``.
  7533. Build
  7534. -----
  7535. - bpo-44133: When Python is configured with
  7536. :option:`--without-static-libpython`, the Python static library
  7537. (libpython.a) is no longer built. Patch by Victor Stinner.
  7538. - bpo-44133: When Python is built without :option:`--enable-shared`, the
  7539. ``python`` program is now linked to object files, rather than being linked
  7540. to the Python static library (libpython.a), to make sure that all symbols
  7541. are exported. Previously, the linker omitted some symbols like the
  7542. :c:func:`Py_FrozenMain` function. Patch by Victor Stinner.
  7543. - bpo-40280: The ``configure`` script has a new option
  7544. ``--with-emscripten-target`` to select browser or node as Emscripten build
  7545. target.
  7546. - bpo-46315: Added and fixed ``#ifdef HAVE_FEATURE`` checks for
  7547. functionality that is not available on WASI platform.
  7548. - bpo-45723: Fixed a regression in ``configure`` check for
  7549. :func:`select.epoll`.
  7550. - bpo-46263: ``configure`` no longer sets ``MULTIARCH`` on FreeBSD
  7551. platforms.
  7552. - bpo-46106: Updated OpenSSL to 1.1.1m in Windows builds, macOS installer
  7553. builds, and CI. Patch by Kumar Aditya.
  7554. - bpo-46088: Automatically detect or install bootstrap Python runtime when
  7555. building from Visual Studio.
  7556. - bpo-46072: Add a --with-pystats configure option to turn on internal
  7557. statistics gathering.
  7558. - bpo-40280: A new directory ``Tools/wasm`` contains WebAssembly-related
  7559. helpers like ``config.site`` override for wasm32-emscripten, wasm assets
  7560. generator to bundle the stdlib, and a README.
  7561. - bpo-46023: :program:`makesetup` no longer builds extensions that have been
  7562. marked as *disabled*. This allows users to disable modules in
  7563. ``Modules/Setup.local``.
  7564. - bpo-45949: Use pure Python ``freeze_module`` for all but importlib
  7565. bootstrap files. ``--with-freeze-module`` :program:`configure` option is
  7566. no longer needed for cross builds.
  7567. Windows
  7568. -------
  7569. - bpo-46217: Removed parameter that is unsupported on Windows 8.1 and early
  7570. Windows 10 and may have caused build or runtime failures.
  7571. macOS
  7572. -----
  7573. - bpo-40477: The Python Launcher app for macOS now properly launches scripts
  7574. and, if necessary, the Terminal app when running on recent macOS releases.
  7575. C API
  7576. -----
  7577. - bpo-46236: Fix a bug in :c:func:`PyFunction_GetAnnotations` that caused it
  7578. to return a ``tuple`` instead of a ``dict``.
  7579. - bpo-46140: :c:func:`PyBuffer_GetPointer`,
  7580. :c:func:`PyBuffer_FromContiguous`, :c:func:`PyBuffer_ToContiguous` and
  7581. :c:func:`PyMemoryView_FromBuffer` now take buffer info by ``const
  7582. Py_buffer *`` instead of ``Py_buffer *``, as they do not need mutability.
  7583. :c:func:`PyBuffer_FromContiguous` also now takes the source buffer as
  7584. ``const void *``, and similarly :c:func:`PyBuffer_GetPointer` takes the
  7585. strides as ``const Py_ssize_t *``.
  7586. - bpo-45855: Document that the *no_block* argument to
  7587. :c:func:`PyCapsule_Import` is a no-op now.
  7588. - bpo-45855: Replaced deprecated usage of
  7589. :c:func:`PyImport_ImportModuleNoBlock` with
  7590. :c:func:`PyImport_ImportModule` in stdlib modules. Patch by Kumar Aditya.
  7591. - bpo-46007: The :c:func:`!PyUnicode_CHECK_INTERNED` macro has been excluded
  7592. from the limited C API. It was never usable there, because it used
  7593. internal structures which are not available in the limited C API. Patch by
  7594. Victor Stinner.
  7595. What's New in Python 3.11.0 alpha 3?
  7596. ====================================
  7597. *Release date: 2021-12-08*
  7598. Core and Builtins
  7599. -----------------
  7600. - bpo-46009: Restore behavior from 3.9 and earlier when sending non-None to
  7601. newly started generator. In 3.9 this did not affect the state of the
  7602. generator. In 3.10.0 and 3.10.1 ``gen_func().send(0)`` is equivalent to
  7603. ``gen_func().throw(TypeError(...)`` which exhausts the generator. In
  7604. 3.10.2 onward, the behavior has been reverted to that of 3.9.
  7605. - bpo-46004: Fix the :exc:`SyntaxError` location for errors involving for
  7606. loops with invalid targets. Patch by Pablo Galindo
  7607. - bpo-45711: :c:func:`_PyErr_ChainStackItem` no longer normalizes
  7608. ``exc_info`` (including setting the traceback on the exception instance)
  7609. because ``exc_info`` is always normalized.
  7610. - bpo-45607: The ``__note__`` field was added to :exc:`BaseException`. It is
  7611. ``None`` by default but can be set to a string which is added to the
  7612. exception's traceback.
  7613. - bpo-45947: Place pointers to dict and values immediately before GC header.
  7614. This reduces number of dependent memory loads to access either dict or
  7615. values from 3 to 1.
  7616. - bpo-45915: ``is_valid_fd`` now uses faster ``fcntl(fd, F_GETFD)`` on
  7617. Linux, macOS, and Windows.
  7618. - bpo-44530: Reverts a change to the ``code.__new__`` :ref:`audit event
  7619. <audit-events>` from an earlier prerelease.
  7620. - bpo-42268: Fail the configure step if the selected compiler doesn't
  7621. support memory sanitizer. Patch by Pablo Galindo
  7622. - bpo-45711: The three values of ``exc_info`` are now always consistent with
  7623. each other. In particular, the ``type`` and ``traceback`` fields are now
  7624. derived from the exception instance. This impacts the return values of
  7625. :func:`sys.exc_info` and :c:func:`PyErr_GetExcInfo()` if the exception
  7626. instance is modified while the exception is handled, as well as
  7627. :c:func:`PyErr_SetExcInfo()`, which now ignores the ``type`` and
  7628. ``traceback`` arguments provided to it.
  7629. - bpo-45727: Refine the custom syntax error that suggests that a comma may
  7630. be missing to trigger only when the expressions are detected between
  7631. parentheses or brackets. Patch by Pablo Galindo
  7632. - bpo-45885: Specialized the ``COMPARE_OP`` opcode using the PEP 659
  7633. machinery.
  7634. - bpo-45786: Allocate space for the interpreter frame in the frame object,
  7635. to avoid an additional allocation when the frame object outlives the frame
  7636. activation.
  7637. - bpo-45614: Fix :mod:`traceback` display for exceptions with invalid module
  7638. name.
  7639. - bpo-45813: Fix crash when calling coro.cr_frame.clear() after coroutine
  7640. has been freed.
  7641. - bpo-45811: Improve the tokenizer errors when encountering invisible
  7642. control characters in the parser. Patch by Pablo Galindo
  7643. - bpo-45848: Allow the parser to obtain error lines directly from encoded
  7644. files. Patch by Pablo Galindo
  7645. - bpo-45709: Restore behavior from 3.10 when tracing an exception raised
  7646. within a with statement.
  7647. - bpo-44525: Adds new :opcode:`COPY_FREE_VARS` opcode, to make copying of
  7648. free variables from function to frame explicit. Helps optimization of
  7649. calls to Python function.
  7650. - bpo-45829: Specialize :opcode:`BINARY_SUBSCR` for classes with a
  7651. ``__getitem__`` method implemented in Python
  7652. - bpo-45826: Fixed a crash when calling ``.with_traceback(None)`` on
  7653. ``NameError``. This occurs internally in
  7654. ``unittest.TestCase.assertRaises()``.
  7655. - bpo-45822: Fixed a bug in the parser that was causing it to not respect
  7656. :pep:`263` coding cookies when no flags are provided. Patch by Pablo
  7657. Galindo
  7658. - bpo-45820: Fix a segfault when the parser fails without reading any input.
  7659. Patch by Pablo Galindo
  7660. - bpo-45636: Simplify the implementation of :opcode:`BINARY_OP` by indexing
  7661. into an array of function pointers (rather than switching on the oparg).
  7662. - bpo-42540: Fix crash when :func:`os.fork` is called with an active
  7663. non-default memory allocator.
  7664. - bpo-45738: Fix computation of error location for invalid continuation
  7665. characters in the parser. Patch by Pablo Galindo.
  7666. - bpo-45636: Remove an existing "fast path" for old-style string formatting,
  7667. since it no longer appears to have any measurable impact.
  7668. - bpo-45753: Make recursion checks a bit more efficient by tracking amount
  7669. of calls left before overflow.
  7670. - bpo-45773: Fix a compiler hang when attempting to optimize certain jump
  7671. patterns.
  7672. - bpo-45764: The parser now gives a better error message when leaving out
  7673. the opening parenthesis ``(`` after a ``def``-statement::
  7674. >>> def f:
  7675. File "<stdin>", line 1
  7676. def f:
  7677. ^
  7678. SyntaxError: expected '('
  7679. - bpo-45609: Specialized the ``STORE_SUBSCR`` opcode using the PEP 659
  7680. machinery.
  7681. - bpo-45636: Replace all numeric ``BINARY_*`` and ``INPLACE_*`` instructions
  7682. with a single :opcode:`BINARY_OP` implementation.
  7683. - bpo-45582: Path calculation (known as ``getpath``) has been reimplemented
  7684. as a frozen Python module. This should have no visible impact, but may
  7685. affect calculation of all paths referenced in :mod:`sys` and
  7686. :mod:`sysconfig`.
  7687. - bpo-45450: Improve the syntax error message for parenthesized arguments.
  7688. Patch by Pablo Galindo.
  7689. Library
  7690. -------
  7691. - bpo-27946: Fix possible crash when getting an attribute of
  7692. :class:`xml.etree.ElementTree.Element` simultaneously with replacing the
  7693. ``attrib`` dict.
  7694. - bpo-45711: Make :mod:`asyncio` normalize exceptions as soon as they are
  7695. captured with :c:func:`PyErr_Fetch`, and before they are stored as an
  7696. exc_info triplet. This brings :mod:`asyncio` in line with the rest of the
  7697. codebase, where an exc_info triplet is always normalized.
  7698. - bpo-23819: Replaced asserts with exceptions in asyncio, patch by Kumar
  7699. Aditya.
  7700. - bpo-13236: :class:`unittest.TextTestResult` and
  7701. :class:`unittest.TextTestRunner` flush now the output stream more often.
  7702. - bpo-45917: Added :func:`math.exp2`:, which returns 2 raised to the power
  7703. of x.
  7704. - bpo-37658: Fix issue when on certain conditions ``asyncio.wait_for()`` may
  7705. allow a coroutine to complete successfully, but fail to return the result,
  7706. potentially causing memory leaks or other issues.
  7707. - bpo-45876: Improve the accuracy of stdev() and pstdev() in the statistics
  7708. module. When the inputs are floats or fractions, the output is a
  7709. correctly rounded float
  7710. - bpo-44649: Handle dataclass(slots=True) with a field that has default a
  7711. default value, but for which init=False.
  7712. - bpo-45803: Added missing kw_only parameter to
  7713. dataclasses.make_dataclass().
  7714. - bpo-45837: The :meth:`turtle.RawTurtle.settiltangle` is deprecated since
  7715. Python 3.1, it now emits a deprecation warning and will be removed in
  7716. Python 3.13.
  7717. Use :meth:`turtle.RawTurtle.tiltangle` instead.
  7718. :meth:`turtle.RawTurtle.tiltangle` was earlier incorrectly marked as
  7719. deprecated, its docstring has been corrected.
  7720. Patch by Hugo van Kemenade.
  7721. - bpo-45831: :mod:`faulthandler` can now write ASCII-only strings (like
  7722. filenames and function names) with a single write() syscall when dumping a
  7723. traceback. It reduces the risk of getting an unreadable dump when two
  7724. threads or two processes dump a traceback to the same file (like stderr)
  7725. at the same time. Patch by Victor Stinner.
  7726. - bpo-45828: :mod:`sqlite` C callbacks now use unraisable exceptions if
  7727. callback tracebacks are enabled. Patch by Erlend E. Aasland.
  7728. - bpo-41735: Fix thread lock in ``zlib.Decompress.flush()`` method before
  7729. ``PyObject_GetBuffer``.
  7730. - bpo-45235: Reverted an argparse bugfix that caused regression in the
  7731. handling of default arguments for subparsers. This prevented leaf level
  7732. arguments from taking precedence over root level arguments.
  7733. - bpo-45754: Fix a regression in Python 3.11a1 and 3.11a2 where
  7734. :mod:`sqlite3` incorrectly would use ``SQLITE_LIMIT_LENGTH`` when checking
  7735. SQL statement lengths. Now, ``SQLITE_LIMIT_SQL_LENGTH`` is used. Patch by
  7736. Erlend E. Aasland.
  7737. - bpo-45766: Added *proportional* option to
  7738. :meth:`statistics.linear_regression`.
  7739. - bpo-45765: In importlib.metadata, fix distribution discovery for an empty
  7740. path.
  7741. - bpo-45757: Fix bug where :mod:`dis` produced an incorrect oparg when
  7742. :opcode:`EXTENDED_ARG` is followed by an opcode that does not use its
  7743. argument.
  7744. - bpo-45644: In-place JSON file formatting using ``python3 -m json.tool
  7745. infile infile`` now works correctly, previously it left the file empty.
  7746. Patch by Chris Wesseling.
  7747. - bpo-45703: When a namespace package is imported before another module from
  7748. the same namespace is created/installed in a different :data:`sys.path`
  7749. location while the program is running, calling the
  7750. :func:`importlib.invalidate_caches` function will now also guarantee the
  7751. new module is noticed.
  7752. - bpo-45535: Improve output of ``dir()`` with Enums.
  7753. - bpo-45664: Fix :func:`types.resolve_bases` and :func:`types.new_class` for
  7754. :class:`types.GenericAlias` instance as a base.
  7755. - bpo-45663: Fix :func:`dataclasses.is_dataclass` for dataclasses which are
  7756. subclasses of :class:`types.GenericAlias`.
  7757. - bpo-45662: Fix the repr of :data:`dataclasses.InitVar` with a type alias
  7758. to the built-in class, e.g. ``InitVar[list[int]]``.
  7759. - bpo-43137: Launch GNOME web browsers via gio tool instead of obsolete
  7760. gvfs-open
  7761. - bpo-45429: On Windows, :func:`time.sleep` now uses a waitable timer which
  7762. supports high-resolution timers. Patch by Donghee Na and Eryk Sun.
  7763. - bpo-37295: Optimize :func:`math.comb` and :func:`math.perm`.
  7764. - bpo-45514: Deprecated legacy functions in :mod:`importlib.resources`.
  7765. - bpo-45507: Add tests for truncated/missing trailers in gzip.decompress
  7766. implementation.
  7767. - bpo-45359: Implement :pep:`585` for :class:`graphlib.TopologicalSorter`.
  7768. - bpo-44733: Add ``max_tasks_per_child`` to
  7769. :class:`concurrent.futures.ProcessPoolExecutor`. This allows users to
  7770. specify the maximum number of tasks a single process should execute before
  7771. the process needs to be restarted.
  7772. - bpo-28806: Improve netrc library. netrc file no longer needs to contain
  7773. all tokens. And if the login name is anonymous, security check is no
  7774. longer need.
  7775. - bpo-43498: Avoid a possible *"RuntimeError: dictionary changed size during
  7776. iteration"* when adjusting the process count of
  7777. :class:`ProcessPoolExecutor`.
  7778. - bpo-42158: Add MIME types for N-quads, N-triples, Notation3 and TriG to
  7779. ``mimetypes``.
  7780. - bpo-30533: Add :func:`inspect.getmembers_static` , it return all members
  7781. without triggering dynamic lookup via the descriptor protocol. Patch by
  7782. Weipeng Hong.
  7783. Documentation
  7784. -------------
  7785. - bpo-42238: ``make -C Doc suspicious`` will be removed soon in favor of
  7786. ``make -C Doc check``, mark it as deprecated.
  7787. - bpo-45840: Improve cross-references in the documentation for the data
  7788. model.
  7789. - bpo-45640: Properly marked-up grammar tokens in the documentation are now
  7790. clickable and take you to the definition of a given piece of grammar.
  7791. Patch by Arthur Milchior.
  7792. - bpo-45788: Link doc for sys.prefix to sysconfig doc on installation paths.
  7793. - bpo-45772: ``socket.socket`` documentation is corrected to a class from a
  7794. function.
  7795. - bpo-45392: Update the docstring of the :class:`type` built-in to remove a
  7796. redundant line and to mention keyword arguments for the constructor.
  7797. - bpo-45250: Update the documentation to note that CPython does not
  7798. consistently require iterators to define ``__iter__``.
  7799. - bpo-25381: In the extending chapter of the extending doc, update a
  7800. paragraph about the global variables containing exception information.
  7801. - bpo-43905: Expanded :func:`~dataclasses.astuple` and
  7802. :func:`~dataclasses.asdict` docs, warning about deepcopy being applied and
  7803. providing a workaround.
  7804. Tests
  7805. -----
  7806. - bpo-45695: Out-of-tree builds with a read-only source directory are now
  7807. tested by CI.
  7808. - bpo-19460: Add new Test for
  7809. ``Lib/email/mime/nonmultipart.py::MIMENonMultipart``.
  7810. - bpo-45835: Fix race condition in test_queue tests with multiple "feeder"
  7811. threads.
  7812. - bpo-45783: The test for the freeze tool now handles file moves and
  7813. deletions.
  7814. - bpo-45745: Remove the ``--findleaks`` command line option of regrtest: use
  7815. the ``--fail-env-changed`` option instead. Since Python 3.7, it was a
  7816. deprecated alias to the ``--fail-env-changed`` option.
  7817. - bpo-45701: Add tests with ``tuple`` type with :func:`functools.lru_cache`
  7818. to ``test_functools``.
  7819. Build
  7820. -----
  7821. - bpo-44035: CI now verifies that autoconf files have been regenerated with
  7822. a current and unpatched autoconf package.
  7823. - bpo-45950: The build system now uses a :program:`_bootstrap_python`
  7824. interpreter for freezing and deepfreezing again. To speed up build process
  7825. the build tools :program:`_bootstrap_python` and :program:`_freeze_module`
  7826. are no longer build with LTO.
  7827. - bpo-45881: The :program:`configure` script now accepts
  7828. ``--with-build-python`` and ``--with-freeze-module`` options to make cross
  7829. compiling easier.
  7830. - bpo-40280: Emscripten platform now uses ``.wasm`` suffix by default.
  7831. - bpo-40280: Disable unusable core extension modules on WASM/Emscripten
  7832. targets.
  7833. - bpo-40280: ``configure`` now checks for socket ``shutdown`` function. The
  7834. check makes it possible to disable ``SYS_shutdown`` with
  7835. ``ac_cv_func_shutdown=no`` in CONFIG_SITE.
  7836. - bpo-40280: ``configure`` now checks for functions ``fork1, getegid,
  7837. geteuid, getgid, getppid, getuid, opendir, pipe, system, wait, ttyname``.
  7838. - bpo-33393: Update ``config.guess`` to 2021-06-03 and ``config.sub`` to
  7839. 2021-08-14. ``Makefile`` now has an ``update-config`` target to make
  7840. updating more convenient.
  7841. - bpo-45866: ``make regen-all`` now produces the same output when run from a
  7842. directory other than the source tree: when building Python out of the
  7843. source tree. pegen now strips directory of the "generated by pygen from
  7844. <FILENAME>" header Patch by Victor Stinner.
  7845. - bpo-40280: ``configure`` now accepts machine ``wasm32`` or ``wasm64`` and
  7846. OS ``wasi`` or ``emscripten`` for cross building, e.g.
  7847. ``wasm32-unknown-emscripten``, ``wasm32-wasi``, or
  7848. ``wasm32-unknown-wasi``.
  7849. - bpo-41498: Python now compiles on platforms without ``sigset_t``. Several
  7850. functions in :mod:`signal` are not available when ``sigset_t`` is missing.
  7851. Based on patch by Roman Yurchak for pyodide.
  7852. - bpo-45881: ``setup.py`` now uses ``CC`` from environment first to discover
  7853. multiarch and cross compile paths.
  7854. - bpo-45886: The ``_freeze_module`` program path can now be overridden on
  7855. the command line, e.g. ``make
  7856. FREEZE_MODULE=../x86_64/Program/_freeze_module``.
  7857. - bpo-45873: Get rid of the ``_bootstrap_python`` build step. The
  7858. deepfreeze.py script is now run using ``$(PYTHON_FOR_REGEN)`` which can be
  7859. Python 3.7 or newer (on Windows, 3.8 or newer).
  7860. - bpo-45847: Port builtin hashlib extensions to ``PY_STDLIB_MOD`` macro and
  7861. ``addext()``.
  7862. - bpo-45723: Add ``autoconf`` helpers for saving and restoring environment
  7863. variables:
  7864. * ``SAVE_ENV``: Save ``$CFLAGS``, ``$LDFLAGS``, ``$LIBS``, and
  7865. ``$CPPFLAGS``.
  7866. * ``RESTORE_ENV``: Restore ``$CFLAGS``, ``$LDFLAGS``, ``$LIBS``, and
  7867. ``$CPPFLAGS``.
  7868. * ``WITH_SAVE_ENV([SCRIPT])``: Run ``SCRIPT`` wrapped with ``SAVE_ENV`` and
  7869. ``RESTORE_ENV``.
  7870. Patch by Erlend E. Aasland.
  7871. - bpo-45573: Mandatory core modules, that are required to bootstrap Python,
  7872. are now in ``Modules/Setup.bootstrap``.
  7873. - bpo-45573: ``configure`` now creates ``Modules/Setup.stdlib`` with
  7874. conditionally enabled/disabled extension module lines. The file is not
  7875. used, yet.
  7876. - bpo-45573: ``configure`` now uses a unified format to set state, compiler
  7877. flags, and linker flags in Makefile. The new macro ``PY_STDLIB_MOD`` sets
  7878. three variables that are consumed by ``Modules/Setup`` and ``setup.py``.
  7879. - bpo-45816: Python now supports building with Visual Studio 2022 (MSVC
  7880. v143, VS Version 17.0). Patch by Jeremiah Vivian.
  7881. - bpo-45800: Settings for :mod:`pyexpat` C extension are now detected by
  7882. ``configure``. The bundled ``expat`` library is built in ``Makefile``.
  7883. - bpo-45798: Settings for :mod:`decimal` internal C extension are now
  7884. detected by ``configure``. The bundled ``libmpdec`` library is built in
  7885. ``Makefile``.
  7886. - bpo-45723: :program:`configure` has a new option ``--with-pkg-config`` to
  7887. disable or require pkg-config.
  7888. - bpo-45774: The build dependencies for :mod:`sqlite3` are now detected by
  7889. ``configure`` and ``pkg-config``. Patch by Erlend E. Aasland.
  7890. - bpo-45763: The build dependencies for :mod:`zlib`, :mod:`bz2`, and
  7891. :mod:`lzma` are now detected by ``configure``.
  7892. - bpo-45747: gdbm and dbm build dependencies are now detected by
  7893. ``configure``.
  7894. - bpo-45743: On macOS, the build system no longer passes
  7895. ``search_paths_first`` to the linker. The flag has been the default since
  7896. Xcode 4 / macOS 10.6.
  7897. - bpo-45723: ``configure.ac`` is now compatible with autoconf 2.71.
  7898. Deprecated checks ``STDC_HEADERS`` and ``AC_HEADER_TIME`` have been
  7899. removed.
  7900. - bpo-45723: ``configure`` now prints a warning when pkg-config is missing.
  7901. - bpo-45731: ``configure --enable-loadable-sqlite-extensions`` is now
  7902. handled by new ``PY_SQLITE_ENABLE_LOAD_EXTENSION`` macro instead of logic
  7903. in setup.py.
  7904. - bpo-45723: configure.ac now uses custom helper macros and
  7905. ``AC_CACHE_CHECK`` to simplify and speed up configure runs.
  7906. - bpo-45696: Skip the marshal step for frozen modules by generating C code
  7907. that produces a set of ready-to-use code objects. This speeds up startup
  7908. time by another 10% or more.
  7909. - bpo-45561: Run smelly.py tool from $(srcdir).
  7910. Windows
  7911. -------
  7912. - bpo-46105: Fixed calculation of :data:`sys.path` in a venv on Windows.
  7913. - bpo-45901: When installed through the Microsoft Store and set as the
  7914. default app for :file:`*.py` files, command line arguments will now be
  7915. passed to Python when invoking a script without explicitly launching
  7916. Python (that is, ``script.py args`` rather than ``python script.py
  7917. args``).
  7918. - bpo-45616: Fix Python Launcher's ability to distinguish between versions
  7919. 3.1 and 3.10 when either one is explicitly requested. Previously, 3.1
  7920. would be used if 3.10 was requested but not installed, and 3.10 would be
  7921. used if 3.1 was requested but 3.10 was installed.
  7922. - bpo-45850: Implement changes to build with deep-frozen modules on Windows.
  7923. Note that we now require Python 3.10 as the "bootstrap" or "host" Python.
  7924. - bpo-45732: Updates bundled Tcl/Tk to 8.6.12.
  7925. - bpo-45720: Internal reference to :file:`shlwapi.dll` was dropped to help
  7926. improve startup time. This DLL will no longer be loaded at the start of
  7927. every Python process.
  7928. macOS
  7929. -----
  7930. - bpo-45732: Update python.org macOS installer to use Tcl/Tk 8.6.12.
  7931. C API
  7932. -----
  7933. - bpo-39026: Fix Python.h to build C extensions with Xcode: remove a
  7934. relative include from ``Include/cpython/pystate.h``.
  7935. What's New in Python 3.11.0 alpha 2?
  7936. ====================================
  7937. *Release date: 2021-11-05*
  7938. Core and Builtins
  7939. -----------------
  7940. - bpo-45716: Improve the :exc:`SyntaxError` message when using ``True``,
  7941. ``None`` or ``False`` as keywords in a function call. Patch by Pablo
  7942. Galindo.
  7943. - bpo-45688: :data:`sys.stdlib_module_names` now contains the macOS-specific
  7944. module :mod:`_scproxy`.
  7945. - bpo-45379: Clarify :exc:`ImportError` message when we try to explicitly
  7946. import a frozen module but frozen modules are disabled.
  7947. - bpo-44525: Specialize simple calls to Python functions (no starargs,
  7948. keyowrd dict, or closure)
  7949. - bpo-45530: Cases of sorting using tuples as keys may now be significantly
  7950. faster in some cases. Patch by Tim Peters.
  7951. The order of the result may differ from earlier releases if the tuple
  7952. elements don't define a total ordering (see
  7953. :ref:`expressions-value-comparisons` for information on total ordering).
  7954. It's generally true that the result of sorting simply isn't well-defined
  7955. in the absence of a total ordering on list elements.
  7956. - bpo-45526: In obmalloc, set ADDRESS_BITS to not ignore any bits (ignored
  7957. 16 before). That is safer in the case that the kernel gives user-space
  7958. virtual addresses that span a range greater than 48 bits.
  7959. - bpo-30570: Fixed a crash in ``issubclass()`` from infinite recursion when
  7960. searching pathological ``__bases__`` tuples.
  7961. - bpo-45521: Fix a bug in the obmalloc radix tree code. On 64-bit machines,
  7962. the bug causes the tree to hold 46-bits of virtual addresses, rather than
  7963. the intended 48-bits.
  7964. - bpo-45494: Fix parser crash when reporting errors involving invalid
  7965. continuation characters. Patch by Pablo Galindo.
  7966. - bpo-45445: Python now fails to initialize if it finds an invalid
  7967. :option:`-X` option in the command line. Patch by Pablo Galindo.
  7968. - bpo-45340: Object attributes are held in an array instead of a dictionary.
  7969. An object's dictionary are created lazily, only when needed. Reduces the
  7970. memory consumption of a typical Python object by about 30%. Patch by Mark
  7971. Shannon.
  7972. - bpo-45408: Fix a crash in the parser when reporting tokenizer errors that
  7973. occur at the same time unclosed parentheses are detected. Patch by Pablo
  7974. Galindo.
  7975. - bpo-29410: Add SipHash13 for string hash algorithm and use it by default.
  7976. - bpo-45385: Fix reference leak from descr_check. Patch by Donghee Na.
  7977. - bpo-45367: Specialized the ``BINARY_MULTIPLY`` opcode to
  7978. ``BINARY_MULTIPLY_INT`` and ``BINARY_MULTIPLY_FLOAT`` using the PEP 659
  7979. machinery.
  7980. - bpo-21736: Frozen stdlib modules now have ``__file__`` to the .py file
  7981. they would otherwise be loaded from, if possible. For packages,
  7982. ``__path__`` now has the correct entry instead of being an empty list,
  7983. which allows unfrozen submodules to be imported. These are set only if
  7984. the stdlib directory is known when the runtime is initialized. Note that
  7985. the file at ``__file__`` is not guaranteed to exist. None of this affects
  7986. non-stdlib frozen modules nor, for now, frozen modules imported using
  7987. ``PyImport_ImportFrozenModule()``. Also, at the moment ``co_filename`` is
  7988. not updated for the module.
  7989. - bpo-45020: For frozen stdlib modules, record the original module name as
  7990. ``module.__spec__.loader_state.origname``. If the value is different than
  7991. ``module.__spec__.name`` then the module was defined as an alias in
  7992. Tools/scripts/freeze_modules.py. If it is ``None`` then the module comes
  7993. from a source file outside the stdlib.
  7994. - bpo-45324: In FrozenImporter.find_spec(), we now preserve the information
  7995. needed in exec_module() to load the module. This change mostly impacts
  7996. internal details, rather than changing the importer's behavior.
  7997. - bpo-45292: Implement :pep:`654`. Add :class:`ExceptionGroup` and
  7998. :class:`BaseExceptionGroup`. Update traceback display code.
  7999. - bpo-40116: Change to the implementation of split dictionaries. Classes
  8000. where the instances differ either in the exact set of attributes, or in
  8001. the order in which those attributes are set, can still share keys. This
  8002. should have no observable effect on users of Python or the C-API. Patch by
  8003. Mark Shannon.
  8004. - bpo-44050: Extensions that indicate they use global state (by setting
  8005. ``m_size`` to -1) can again be used in multiple interpreters. This reverts
  8006. to behavior of Python 3.8.
  8007. - bpo-44525: Setup initial specialization infrastructure for the
  8008. ``CALL_FUNCTION`` opcode. Implemented initial specializations for C
  8009. function calls:
  8010. * ``CALL_FUNCTION_BUILTIN_O`` for ``METH_O`` flag.
  8011. * ``CALL_FUNCTION_BUILTIN_FAST`` for ``METH_FASTCALL`` flag without keywords.
  8012. * ``CALL_FUNCTION_LEN`` for ``len(o)``.
  8013. * ``CALL_FUNCTION_ISINSTANCE`` for ``isinstance(o, t)``.
  8014. - bpo-44511: Improve the generated bytecode for class and mapping patterns.
  8015. - bpo-43706: Speed up calls to ``enumerate()`` by using the :pep:`590`
  8016. ``vectorcall`` calling convention. Patch by Donghee Na.
  8017. Library
  8018. -------
  8019. - bpo-45679: Fix caching of multi-value :data:`typing.Literal`.
  8020. ``Literal[True, 2]`` is no longer equal to ``Literal[1, 2]``.
  8021. - bpo-42064: Convert :mod:`sqlite3` to multi-phase initialisation (PEP 489).
  8022. Patches by Erlend E. Aasland.
  8023. - bpo-45438: Fix typing.Signature string representation for generic builtin
  8024. types.
  8025. - bpo-45613: :mod:`sqlite3` now sets :attr:`sqlite3.threadsafety` based on
  8026. the default threading mode the underlying SQLite library has been compiled
  8027. with. Patch by Erlend E. Aasland.
  8028. - bpo-45574: Fix warning about ``print_escape`` being unused.
  8029. - bpo-45581: :meth:`sqlite3.connect` now correctly raises :exc:`MemoryError`
  8030. if the underlying SQLite API signals memory error. Patch by Erlend E.
  8031. Aasland.
  8032. - bpo-45557: pprint.pprint() now handles underscore_numbers correctly.
  8033. Previously it was always setting it to False.
  8034. - bpo-44019: Add :func:`operator.call` to ``operator.__all__``. Patch by
  8035. Kreusada.
  8036. - bpo-42174: :meth:`shutil.get_terminal_size` now falls back to sane values
  8037. if the column or line count are 0.
  8038. - bpo-35673: Improve the introspectability of the ``__loader__`` attribute
  8039. for namespace packages. :class:`importlib.machinery.NamespaceLoader` is
  8040. now public, and implements the :class:`importlib.abc.InspectLoader`
  8041. interface. ``_NamespaceLoader`` is kept for backward compatibility.
  8042. - bpo-45515: Add references to :mod:`zoneinfo` in the :mod:`datetime`
  8043. documentation, mostly replacing outdated references to ``dateutil.tz``.
  8044. Change by Paul Ganssle.
  8045. - bpo-45475: Reverted optimization of iterating :class:`gzip.GzipFile`,
  8046. :class:`bz2.BZ2File`, and :class:`lzma.LZMAFile` (see bpo-43787) because
  8047. it caused regression when user iterate them without having reference of
  8048. them. Patch by Inada Naoki.
  8049. - bpo-45489: Update :class:`~typing.ForwardRef` to support ``|`` operator.
  8050. Patch by Donghee Na.
  8051. - bpo-42222: Removed deprecated support for float arguments in
  8052. *randrange()*.
  8053. - bpo-45428: Fix a regression in py_compile when reading filenames from
  8054. standard input.
  8055. - bpo-45467: Fix incremental decoder and stream reader in the
  8056. "raw-unicode-escape" codec. Previously they failed if the escape sequence
  8057. was split.
  8058. - bpo-45461: Fix incremental decoder and stream reader in the
  8059. "unicode-escape" codec. Previously they failed if the escape sequence was
  8060. split.
  8061. - bpo-45239: Fixed :func:`email.utils.parsedate_tz` crashing with
  8062. :exc:`UnboundLocalError` on certain invalid input instead of returning
  8063. ``None``. Patch by Ben Hoyt.
  8064. - bpo-45417: Fix quadratic behaviour in the enum module: Creation of enum
  8065. classes with a lot of entries was quadratic.
  8066. - bpo-45249: Fix the behaviour of :func:`traceback.print_exc` when
  8067. displaying the caret when the ``end_offset`` in the exception is set to 0.
  8068. Patch by Pablo Galindo
  8069. - bpo-45416: Fix use of :class:`asyncio.Condition` with explicit
  8070. :class:`asyncio.Lock` objects, which was a regression due to removal of
  8071. explicit loop arguments. Patch by Joongi Kim.
  8072. - bpo-20028: Empty escapechar/quotechar is not allowed when initializing
  8073. :class:`csv.Dialect`. Patch by Vajrasky Kok and Donghee Na.
  8074. - bpo-44904: Fix bug in the :mod:`doctest` module that caused it to fail if
  8075. a docstring included an example with a ``classmethod`` ``property``. Patch
  8076. by Alex Waygood.
  8077. - bpo-45406: Make :func:`inspect.getmodule` catch ``FileNotFoundError``
  8078. raised by :func:`inspect.getabsfile`, and return ``None`` to indicate that
  8079. the module could not be determined.
  8080. - bpo-45411: Add extensions for files containing subtitles - .srt & .vtt -
  8081. to the mimetypes.py module.
  8082. - bpo-10716: Migrated pydoc to HTML5 (without changing the look of it). Side
  8083. effect is to update xmlrpc's ``ServerHTMLDoc`` which now uses the CSS too.
  8084. cgitb now relies less on pydoc (as it can't use the CSS file).
  8085. - bpo-27580: Add support of null characters in :mod:`csv`.
  8086. - bpo-45262: Prevent use-after-free in asyncio. Make sure the cached running
  8087. loop holder gets cleared on dealloc to prevent use-after-free in
  8088. get_running_loop
  8089. - bpo-45386: Make :mod:`xmlrpc.client` more robust to C runtimes where the
  8090. underlying C ``strftime`` function results in a ``ValueError`` when
  8091. testing for year formatting options.
  8092. - bpo-20028: Improve error message of :class:`csv.Dialect` when
  8093. initializing. Patch by Vajrasky Kok and Donghee Na.
  8094. - bpo-45343: Update bundled pip to 21.2.4 and setuptools to 58.1.0
  8095. - bpo-45328: Fixed :class:`http.client.HTTPConnection` to work properly in
  8096. OSs that don't support the ``TCP_NODELAY`` socket option.
  8097. - bpo-45243: Add :meth:`~sqlite3.Connection.setlimit` and
  8098. :meth:`~sqlite3.Connection.getlimit` to :class:`sqlite3.Connection` for
  8099. setting and getting SQLite limits by connection basis. Patch by Erlend E.
  8100. Aasland.
  8101. - bpo-45320: Removed from the :mod:`inspect` module:
  8102. * the ``getargspec`` function, deprecated since Python 3.0;
  8103. use :func:`inspect.signature` or :func:`inspect.getfullargspec` instead.
  8104. * the ``formatargspec`` function, deprecated since Python 3.5;
  8105. use the :func:`inspect.signature` function and :class:`Signature` object
  8106. directly.
  8107. * the undocumented ``Signature.from_builtin`` and ``Signature.from_function``
  8108. functions, deprecated since Python 3.5; use the
  8109. :meth:`Signature.from_callable() <inspect.Signature.from_callable>` method
  8110. instead.
  8111. Patch by Hugo van Kemenade.
  8112. - bpo-45192: Fix the ``tempfile._infer_return_type`` function so that the
  8113. ``dir`` argument of the :mod:`tempfile` functions accepts an object
  8114. implementing the ``os.PathLike`` protocol.
  8115. Patch by Kyungmin Lee.
  8116. - bpo-45160: When tracing a tkinter variable used by a ttk OptionMenu,
  8117. callbacks are no longer made twice.
  8118. - bpo-25625: Added non parallel-safe :func:`~contextlib.chdir` context
  8119. manager to change the current working directory and then restore it on
  8120. exit. Simple wrapper around :func:`~os.chdir`.
  8121. - bpo-24139: Add support for SQLite extended result codes in
  8122. :exc:`sqlite3.Error`. Patch by Erlend E. Aasland.
  8123. - bpo-24444: Fixed an error raised in :mod:`argparse` help display when help
  8124. for an option is set to 1+ blank spaces or when *choices* arg is an empty
  8125. container.
  8126. - bpo-44547: Implement ``Fraction.__int__``, so that a
  8127. :class:`fractions.Fraction` instance ``f`` passes an ``isinstance(f,
  8128. typing.SupportsInt)`` check.
  8129. - bpo-40321: Adds support for HTTP 308 redirects to :mod:`urllib`. See
  8130. :rfc:`7538` for details. Patch by Jochem Schulenklopper.
  8131. - bpo-41374: Ensure that ``socket.TCP_*`` constants are exposed on Cygwin
  8132. 3.1.6 and greater.
  8133. - bpo-35970: Add help flag to the base64 module's command line interface.
  8134. Patch contributed by Robert Kuska.
  8135. Documentation
  8136. -------------
  8137. - bpo-45726: Improve documentation for :func:`functools.singledispatch` and
  8138. :class:`functools.singledispatchmethod`.
  8139. - bpo-45680: Amend the docs on ``GenericAlias`` objects to clarify that
  8140. non-container classes can also implement ``__class_getitem__``. Patch
  8141. contributed by Alex Waygood.
  8142. - bpo-45618: Update Sphinx version used to build the documentation to 4.2.0.
  8143. Patch by Maciej Olko.
  8144. - bpo-45655: Add a new "relevant PEPs" section to the top of the
  8145. documentation for the ``typing`` module. Patch by Alex Waygood.
  8146. - bpo-45604: Add ``level`` argument to ``multiprocessing.log_to_stderr``
  8147. function docs.
  8148. - bpo-45516: Add protocol description to the
  8149. :class:`importlib.abc.TraversableResources` documentation.
  8150. - bpo-45464: Mention in the documentation of :ref:`Built-in Exceptions
  8151. <bltin-exceptions>` that inheriting from multiple exception types in a
  8152. single subclass is not recommended due to possible memory layout
  8153. incompatibility.
  8154. - bpo-45449: Add note about :pep:`585` in :mod:`collections.abc`.
  8155. - bpo-45516: Add protocol description to the
  8156. :class:`importlib.abc.Traversable` documentation.
  8157. - bpo-20692: Add Programming FAQ entry explaining that int literal attribute
  8158. access requires either a space after or parentheses around the literal.
  8159. Tests
  8160. -----
  8161. - bpo-45678: Add tests for scenarios in which
  8162. :class:`functools.singledispatchmethod` is stacked on top of a method that
  8163. has already been wrapped by two other decorators. Patch by Alex Waygood.
  8164. - bpo-45578: Add tests for :func:`dis.distb`
  8165. - bpo-45678: Add tests to ensure that ``functools.singledispatchmethod``
  8166. correctly wraps the attributes of the target function.
  8167. - bpo-45668: PGO tests now pass when Python is built without test extension
  8168. modules.
  8169. - bpo-45577: Add subtests for all ``pickle`` protocols in ``test_zoneinfo``.
  8170. - bpo-45566: Fix ``test_frozen_pickle`` in ``test_dataclasses`` to check all
  8171. ``pickle`` versions.
  8172. - bpo-43592: :mod:`test.libregrtest` now raises the soft resource limit for
  8173. the maximum number of file descriptors when the default is too low for our
  8174. test suite as was often the case on macOS.
  8175. - bpo-39679: Add more test cases for ``@functools.singledispatchmethod``
  8176. when combined with ``@classmethod`` or ``@staticmethod``.
  8177. - bpo-45410: When libregrtest spawns a worker process, stderr is now written
  8178. into stdout to keep messages order. Use a single pipe for stdout and
  8179. stderr, rather than two pipes. Previously, messages were out of order
  8180. which made analysis of buildbot logs harder Patch by Victor Stinner.
  8181. - bpo-45402: Fix test_tools.test_sundry() when Python is built out of tree:
  8182. fix how the freeze_modules.py tool locates the _freeze_module program.
  8183. Patch by Victor Stinner.
  8184. - bpo-45403: Fix test_sys.test_stdlib_dir() when Python is built outside the
  8185. source tree: compare normalized paths. Patch by Victor Stinner.
  8186. - bpo-45400: Fix
  8187. test_name_error_suggestions_do_not_trigger_for_too_many_locals() of
  8188. test_exceptions if a directory name contains "a1" (like
  8189. "Python-3.11.0a1"): use a stricter regular expression. Patch by Victor
  8190. Stinner.
  8191. - bpo-10572: Rename :mod:`sqlite3` tests from ``test_sqlite`` to
  8192. ``test_sqlite3``, and relocate them to ``Lib/test/test_sqlite3``. Patch by
  8193. Erlend E. Aasland.
  8194. Build
  8195. -----
  8196. - bpo-43158: ``setup.py`` now uses values from configure script to build the
  8197. ``_uuid`` extension module. Configure now detects util-linux's
  8198. ``libuuid``, too.
  8199. - bpo-45666: Fix warning of ``swprintf`` and ``%s`` usage in
  8200. ``_testembed.c``
  8201. - bpo-45548: ``Modules/Setup`` and ``Modules/makesetup`` have been improved.
  8202. The ``Setup`` file now contains working rules for all extensions. Outdated
  8203. comments have been removed. Rules defined by ``makesetup`` track
  8204. dependencies correctly.
  8205. - bpo-45548: The :mod:`math` and :mod:`cmath` implementation now require a
  8206. C99 compatible ``libm`` and no longer ship with workarounds for missing
  8207. acosh, asinh, atanh, expm1, and log1p functions.
  8208. - bpo-45595: ``setup.py`` and ``makesetup`` now track build dependencies on
  8209. all Python header files and module specific header files.
  8210. - bpo-45571: ``Modules/Setup`` now use ``PY_CFLAGS_NODIST`` instead of
  8211. ``PY_CFLAGS`` to compile shared modules.
  8212. - bpo-45570: :mod:`pyexpat` and :mod:`_elementtree` no longer define
  8213. obsolete macros ``HAVE_EXPAT_CONFIG_H`` and ``USE_PYEXPAT_CAPI``.
  8214. ``XML_POOR_ENTROPY`` is now defined in ``expat_config.h``.
  8215. - bpo-43974: ``setup.py`` no longer defines ``Py_BUILD_CORE_MODULE``.
  8216. Instead every module, that uses the internal API, defines the macro.
  8217. - bpo-45548: Fill in missing entries in Modules/Setup.
  8218. - bpo-45532: Update :data:`sys.version` to use ``main`` as fallback
  8219. information. Patch by Jeong YunWon.
  8220. - bpo-45536: The ``configure`` script now checks whether OpenSSL headers and
  8221. libraries provide required APIs. Most common APIs are verified. The check
  8222. detects outdated or missing OpenSSL. Failures do not stop configure.
  8223. - bpo-45221: Fixed regression in handling of ``LDFLAGS`` and ``CPPFLAGS``
  8224. options where :meth:`argparse.parse_known_args` could interpret an option
  8225. as one of the built-in command line argument, for example ``-h`` for help.
  8226. - bpo-45440: Building Python now requires a C99 ``<math.h>`` header file
  8227. providing the following functions: ``copysign()``, ``hypot()``,
  8228. ``isfinite()``, ``isinf()``, ``isnan()``, ``round()``. Patch by Victor
  8229. Stinner.
  8230. - bpo-45405: Prevent ``internal configure error`` when running ``configure``
  8231. with recent versions of non-Apple clang. Patch by David Bohman.
  8232. - bpo-45433: Avoid linking libpython with libcrypt.
  8233. Windows
  8234. -------
  8235. - bpo-43652: Update Tcl/Tk to 8.6.11, actually this time. The previous
  8236. update incorrectly included 8.6.10.
  8237. - bpo-45337: venv now warns when the created environment may need to be
  8238. accessed at a different path, due to redirections, links or junctions. It
  8239. also now correctly installs or upgrades components when the alternate path
  8240. is required.
  8241. - bpo-43851: Build SQLite ``SQLITE_OMIT_AUTOINIT`` on Windows. Patch by
  8242. Erlend E. Aasland.
  8243. macOS
  8244. -----
  8245. - bpo-44828: Avoid tkinter file dialog failure on macOS 12 Monterey when
  8246. using the Tk 8.6.11 provided by python.org macOS installers. Patch by Marc
  8247. Culler of the Tk project.
  8248. IDLE
  8249. ----
  8250. - bpo-45495: Add context keywords 'case' and 'match' to completions list.
  8251. C API
  8252. -----
  8253. - bpo-29103: :c:func:`PyType_FromSpec* <PyType_FromModuleAndSpec>` now
  8254. copies the class name from the spec to a buffer owned by the class, so the
  8255. original can be safely deallocated. Patch by Petr Viktorin.
  8256. - bpo-45522: The internal freelists for frame, float, list, dict, async
  8257. generators, and context objects can now be disabled.
  8258. - bpo-35134: Exclude :c:func:`PyWeakref_GET_OBJECT` from the limited C API.
  8259. It never worked since the :c:type:`!PyWeakReference` structure is opaque
  8260. in the limited C API.
  8261. - bpo-35081: Move the ``interpreteridobject.h`` header file from
  8262. ``Include/`` to ``Include/internal/``. It only provides private functions.
  8263. Patch by Victor Stinner.
  8264. - bpo-35134: The non-limited API files ``cellobject.h``, ``classobject.h``,
  8265. ``context.h``, ``funcobject.h``, ``genobject.h`` and ``longintrepr.h``
  8266. have been moved to the ``Include/cpython`` directory. Moreover, the
  8267. ``eval.h`` header file was removed. These files must not be included
  8268. directly, as they are already included in ``Python.h``: :ref:`Include
  8269. Files <api-includes>`. If they have been included directly, consider
  8270. including ``Python.h`` instead. Patch by Victor Stinner.
  8271. - bpo-45474: The following items are no longer available when
  8272. ``Py_LIMITED_API`` is defined:
  8273. * :c:func:`PyMarshal_WriteLongToFile`
  8274. * :c:func:`PyMarshal_WriteObjectToFile`
  8275. * :c:func:`PyMarshal_ReadObjectFromString`
  8276. * :c:func:`PyMarshal_WriteObjectToString`
  8277. * the ``Py_MARSHAL_VERSION`` macro
  8278. These are not part of the :ref:`limited API <limited-api-list>`.
  8279. Patch by Victor Stinner.
  8280. - bpo-45434: Remove the ``pystrhex.h`` header file. It only contains private
  8281. functions. C extensions should only include the main ``<Python.h>`` header
  8282. file. Patch by Victor Stinner.
  8283. - bpo-45440: Remove the ``Py_FORCE_DOUBLE()`` macro. It was used by the
  8284. ``Py_IS_INFINITY()`` macro. Patch by Victor Stinner.
  8285. - bpo-45434: ``<Python.h>`` no longer includes the header files
  8286. ``<stdlib.h>``, ``<stdio.h>``, ``<errno.h>`` and ``<string.h>`` when the
  8287. ``Py_LIMITED_API`` macro is set to ``0x030b0000`` (Python 3.11) or higher.
  8288. C extensions should explicitly include the header files after ``#include
  8289. <Python.h>``. Patch by Victor Stinner.
  8290. - bpo-41123: Remove ``Py_UNICODE_COPY()`` and ``Py_UNICODE_FILL()`` macros,
  8291. deprecated since Python 3.3. Use ``PyUnicode_CopyCharacters()`` or
  8292. ``memcpy()`` (``wchar_t*`` string), and ``PyUnicode_Fill()`` functions
  8293. instead. Patch by Victor Stinner.
  8294. - bpo-45412: Remove the following math macros using the ``errno`` variable:
  8295. * ``Py_ADJUST_ERANGE1()``
  8296. * ``Py_ADJUST_ERANGE2()``
  8297. * ``Py_OVERFLOWED()``
  8298. * ``Py_SET_ERANGE_IF_OVERFLOW()``
  8299. * ``Py_SET_ERRNO_ON_MATH_ERROR()``
  8300. Patch by Victor Stinner.
  8301. - bpo-45395: Custom frozen modules (the array set to
  8302. ``PyImport_FrozenModules``) are now treated as additions, rather than
  8303. replacing all the default frozen modules. Frozen stdlib modules can still
  8304. be disabled by setting the "code" field of the custom array entry to NULL.
  8305. - bpo-43760: Add new :c:func:`PyThreadState_EnterTracing`, and
  8306. :c:func:`PyThreadState_LeaveTracing` functions to the limited C API to
  8307. suspend and resume tracing and profiling. Patch by Victor Stinner.
  8308. - bpo-44220: :c:var:`PyStructSequence_UnnamedField` is added to the Stable
  8309. ABI.
  8310. What's New in Python 3.11.0 alpha 1?
  8311. ====================================
  8312. *Release date: 2021-10-05*
  8313. Security
  8314. --------
  8315. - bpo-42278: Replaced usage of :func:`tempfile.mktemp` with
  8316. :class:`~tempfile.TemporaryDirectory` to avoid a potential race condition.
  8317. - bpo-44600: Fix incorrect line numbers while tracing some failed patterns
  8318. in :ref:`match <match>` statements. Patch by Charles Burkland.
  8319. - bpo-41180: Add auditing events to the :mod:`marshal` module, and stop
  8320. raising ``code.__init__`` events for every unmarshalled code object.
  8321. Directly instantiated code objects will continue to raise an event, and
  8322. audit event handlers should inspect or collect the raw marshal data. This
  8323. reduces a significant performance overhead when loading from ``.pyc``
  8324. files.
  8325. - bpo-44394: Update the vendored copy of libexpat to 2.4.1 (from 2.2.8) to
  8326. get the fix for the CVE-2013-0340 "Billion Laughs" vulnerability. This
  8327. copy is most used on Windows and macOS.
  8328. - bpo-43124: Made the internal ``putcmd`` function in :mod:`smtplib`
  8329. sanitize input for presence of ``\r`` and ``\n`` characters to avoid
  8330. (unlikely) command injection.
  8331. - bpo-44022: :mod:`http.client` now avoids infinitely reading potential HTTP
  8332. headers after a ``100 Continue`` status response from the server.
  8333. Core and Builtins
  8334. -----------------
  8335. - bpo-43760: The number of hardware branches per instruction dispatch is
  8336. reduced from two to one by adding a special instruction for tracing. Patch
  8337. by Mark Shannon.
  8338. - bpo-45061: Add a deallocator to the bool type to detect refcount bugs in C
  8339. extensions which call Py_DECREF(Py_True) or Py_DECREF(Py_False) by
  8340. mistake. Detect also refcount bugs when the empty tuple singleton or the
  8341. Unicode empty string singleton is destroyed by mistake. Patch by Victor
  8342. Stinner.
  8343. - bpo-24076: sum() was further optimised for summing up single digit
  8344. integers.
  8345. - bpo-45190: Update Unicode databases to Unicode 14.0.0.
  8346. - bpo-45167: Fix deepcopying of :class:`types.GenericAlias` objects.
  8347. - bpo-45155: :meth:`int.to_bytes` and :meth:`int.from_bytes` now take a
  8348. default value of ``"big"`` for the ``byteorder`` argument.
  8349. :meth:`int.to_bytes` also takes a default value of ``1`` for the
  8350. ``length`` argument.
  8351. - bpo-44219: Release the GIL while performing ``isatty`` system calls on
  8352. arbitrary file descriptors. In particular, this affects :func:`os.isatty`,
  8353. :func:`os.device_encoding` and :class:`io.TextIOWrapper`. By extension,
  8354. :func:`io.open` in text mode is also affected. This change solves a
  8355. deadlock in :func:`os.isatty`. Patch by Vincent Michel in :issue:`44219`.
  8356. - bpo-44959: Added fallback to extension modules with '.sl' suffix on HP-UX
  8357. - bpo-45121: Fix issue where ``Protocol.__init__`` raises ``RecursionError``
  8358. when it's called directly or via ``super()``. Patch provided by Yurii
  8359. Karabas.
  8360. - bpo-44348: The deallocator function of the :exc:`BaseException` type now
  8361. uses the trashcan mechanism to prevent stack overflow. For example, when a
  8362. :exc:`RecursionError` instance is raised, it can be linked to another
  8363. RecursionError through the ``__context__`` attribute or the
  8364. ``__traceback__`` attribute, and then a chain of exceptions is created.
  8365. When the chain is destroyed, nested deallocator function calls can crash
  8366. with a stack overflow if the chain is too long compared to the available
  8367. stack memory. Patch by Victor Stinner.
  8368. - bpo-45123: Fix PyAiter_Check to only check for the __anext__ presence (not
  8369. for __aiter__). Rename PyAiter_Check to PyAIter_Check, PyObject_GetAiter
  8370. -> PyObject_GetAIter.
  8371. - bpo-1514420: Interpreter no longer attempts to open files with names in
  8372. angle brackets (like "<string>" or "<stdin>") when formatting an
  8373. exception.
  8374. - bpo-41031: Match C and Python code formatting of unprintable exceptions
  8375. and exceptions in the :mod:`__main__` module.
  8376. - bpo-37330: :func:`open`, :func:`io.open`, :func:`codecs.open` and
  8377. :class:`fileinput.FileInput` no longer accept ``'U'`` ("universal
  8378. newline") in the file mode. This flag was deprecated since Python 3.3.
  8379. Patch by Victor Stinner.
  8380. - bpo-45083: When the interpreter renders an exception, its name now has a
  8381. complete qualname. Previously only the class name was concatenated to the
  8382. module name, which sometimes resulted in an incorrect full name being
  8383. displayed.
  8384. (This issue impacted only the C code exception rendering, the
  8385. :mod:`traceback` module was using qualname already).
  8386. - bpo-34561: List sorting now uses the merge-ordering strategy from Munro
  8387. and Wild's ``powersort()``. Unlike the former strategy, this is provably
  8388. near-optimal in the entropy of the distribution of run lengths. Most uses
  8389. of ``list.sort()`` probably won't see a significant time difference, but
  8390. may see significant improvements in cases where the former strategy was
  8391. exceptionally poor. However, as these are all fast linear-time
  8392. approximations to a problem that's inherently at best quadratic-time to
  8393. solve truly optimally, it's also possible to contrive cases where the
  8394. former strategy did better.
  8395. - bpo-45056: Compiler now removes trailing unused constants from co_consts.
  8396. - bpo-45020: Add a new command line option, "-X frozen_modules=[on|off]" to
  8397. opt out of (or into) using optional frozen modules. This defaults to "on"
  8398. (or "off" if it's running out of the source tree).
  8399. - bpo-45012: In :mod:`posix`, release GIL during ``stat()``, ``lstat()``,
  8400. and ``fstatat()`` syscalls made by :func:`os.DirEntry.stat`. Patch by
  8401. Stanisław Skonieczny.
  8402. - bpo-45018: Fixed pickling of range iterators that iterated for over
  8403. ``2**32`` times.
  8404. - bpo-45000: A :exc:`SyntaxError` is now raised when trying to delete
  8405. :const:`__debug__`. Patch by Donghee Na.
  8406. - bpo-44963: Implement ``send()`` and ``throw()`` methods for
  8407. ``anext_awaitable`` objects. Patch by Pablo Galindo.
  8408. - bpo-44962: Fix a race in WeakKeyDictionary, WeakValueDictionary and
  8409. WeakSet when two threads attempt to commit the last pending removal. This
  8410. fixes asyncio.create_task and fixes a data loss in asyncio.run where
  8411. shutdown_asyncgens is not run
  8412. - bpo-24234: Implement the :meth:`__bytes__` special method on the
  8413. :class:`bytes` type, so a bytes object ``b`` passes an ``isinstance(b,
  8414. typing.SupportsBytes)`` check.
  8415. - bpo-24234: Implement the :meth:`__complex__` special method on the
  8416. :class:`complex` type, so a complex number ``z`` passes an ``isinstance(z,
  8417. typing.SupportsComplex)`` check.
  8418. - bpo-44954: Fixed a corner case bug where the result of
  8419. ``float.fromhex('0x.8p-1074')`` was rounded the wrong way.
  8420. - bpo-44947: Refine the syntax error for trailing commas in import
  8421. statements. Patch by Pablo Galindo.
  8422. - bpo-44945: Specialize the BINARY_ADD instruction using the PEP 659
  8423. machinery. Adds five new instructions:
  8424. * BINARY_ADD_ADAPTIVE
  8425. * BINARY_ADD_FLOAT
  8426. * BINARY_ADD_INT
  8427. * BINARY_ADD_UNICODE
  8428. * BINARY_ADD_UNICODE_INPLACE_FAST
  8429. - bpo-44929: Fix some edge cases of ``enum.Flag`` string representation in
  8430. the REPL. Patch by Pablo Galindo.
  8431. - bpo-44914: Class version tags are no longer recycled.
  8432. This means that a version tag serves as a unique identifier for the state
  8433. of a class. We rely on this for effective specialization of the LOAD_ATTR
  8434. and other instructions.
  8435. - bpo-44698: Restore behaviour of complex exponentiation with integer-valued
  8436. exponent of type :class:`float` or :class:`complex`.
  8437. - bpo-44895: A debug variable :envvar:`PYTHONDUMPREFSFILE` is added for
  8438. creating a dump file which is generated by :option:`--with-trace-refs`.
  8439. Patch by Donghee Na.
  8440. - bpo-44900: Add five superinstructions for PEP 659 quickening:
  8441. * LOAD_FAST LOAD_FAST
  8442. * STORE_FAST LOAD_FAST
  8443. * LOAD_FAST LOAD_CONST
  8444. * LOAD_CONST LOAD_FAST
  8445. * STORE_FAST STORE_FAST
  8446. - bpo-44889: Initial implementation of adaptive specialization of
  8447. ``LOAD_METHOD``. The following specialized forms were added:
  8448. * ``LOAD_METHOD_CACHED``
  8449. * ``LOAD_METHOD_MODULE``
  8450. * ``LOAD_METHOD_CLASS``
  8451. - bpo-44890: Specialization stats are always collected in debug builds.
  8452. - bpo-44885: Correct the ast locations of f-strings with format specs and
  8453. repeated expressions. Patch by Pablo Galindo
  8454. - bpo-44878: Remove the loop from the bytecode interpreter. All instructions
  8455. end with a DISPATCH macro, so the loop is now redundant.
  8456. - bpo-44878: Remove switch statement for interpreter loop when using
  8457. computed gotos. This makes sure that we only have one dispatch table in
  8458. the interpreter.
  8459. - bpo-44874: Deprecate the old trashcan macros
  8460. (``Py_TRASHCAN_SAFE_BEGIN``/``Py_TRASHCAN_SAFE_END``). They should be
  8461. replaced by the new macros ``Py_TRASHCAN_BEGIN`` and ``Py_TRASHCAN_END``.
  8462. - bpo-44872: Use new trashcan macros (Py_TRASHCAN_BEGIN/END) in
  8463. frameobject.c instead of the old ones (Py_TRASHCAN_SAFE_BEGIN/END).
  8464. - bpo-33930: Fix segmentation fault with deep recursion when cleaning method
  8465. objects. Patch by Augusto Goulart and Pablo Galindo.
  8466. - bpo-25782: Fix bug where ``PyErr_SetObject`` hangs when the current
  8467. exception has a cycle in its context chain.
  8468. - bpo-44856: Fix reference leaks in the error paths of ``update_bases()``
  8469. and ``__build_class__``. Patch by Pablo Galindo.
  8470. - bpo-44826: Initial implementation of adaptive specialization of STORE_ATTR
  8471. Three specialized forms of STORE_ATTR are added:
  8472. * STORE_ATTR_SLOT
  8473. * STORE_ATTR_SPLIT_KEYS
  8474. * STORE_ATTR_WITH_HINT
  8475. - bpo-44838: Fixed a bug that was causing the parser to raise an incorrect
  8476. custom :exc:`SyntaxError` for invalid 'if' expressions. Patch by Pablo
  8477. Galindo.
  8478. - bpo-44821: Create instance dictionaries (__dict__) eagerly, to improve
  8479. regularity of object layout and assist specialization.
  8480. - bpo-44792: Improve syntax errors for if expressions. Patch by Miguel Brito
  8481. - bpo-34013: Generalize the invalid legacy statement custom error message
  8482. (like the one generated when "print" is called without parentheses) to
  8483. include more generic expressions. Patch by Pablo Galindo
  8484. - bpo-44732: Rename ``types.Union`` to ``types.UnionType``.
  8485. - bpo-44725: Expose specialization stats in python via
  8486. :func:`_opcode.get_specialization_stats`.
  8487. - bpo-44717: Improve AttributeError on circular imports of submodules.
  8488. - bpo-44698: Fix undefined behaviour in complex object exponentiation.
  8489. - bpo-44653: Support :mod:`typing` types in parameter substitution in the
  8490. union type.
  8491. - bpo-44676: Add ability to serialise ``types.Union`` objects. Patch
  8492. provided by Yurii Karabas.
  8493. - bpo-44633: Parameter substitution of the union type with wrong types now
  8494. raises ``TypeError`` instead of returning :data:`NotImplemented`.
  8495. - bpo-44661: Update ``property_descr_set`` to use vectorcall if possible.
  8496. Patch by Donghee Na.
  8497. - bpo-44662: Add ``__module__`` to ``types.Union``. This also fixes
  8498. ``types.Union`` issues with ``typing.Annotated``. Patch provided by Yurii
  8499. Karabas.
  8500. - bpo-44655: Include the name of the type in unset __slots__ attribute
  8501. errors. Patch by Pablo Galindo
  8502. - bpo-44655: Don't include a missing attribute with the same name as the
  8503. failing one when offering suggestions for missing attributes. Patch by
  8504. Pablo Galindo
  8505. - bpo-44646: Fix the hash of the union type: it no longer depends on the
  8506. order of arguments.
  8507. - bpo-44636: Collapse union of equal types. E.g. the result of ``int | int``
  8508. is now ``int``. Fix comparison of the union type with non-hashable
  8509. objects. E.g. ``int | str == {}`` no longer raises a TypeError.
  8510. - bpo-44611: On Windows, :func:`os.urandom`: uses BCryptGenRandom API
  8511. instead of CryptGenRandom API which is deprecated from Microsoft Windows
  8512. API. Patch by Donghee Na.
  8513. - bpo-44635: Convert ``None`` to ``type(None)`` in the union type
  8514. constructor.
  8515. - bpo-26280: Implement adaptive specialization for BINARY_SUBSCR
  8516. Three specialized forms of BINARY_SUBSCR are added:
  8517. * BINARY_SUBSCR_LIST_INT
  8518. * BINARY_SUBSCR_TUPLE_INT
  8519. * BINARY_SUBSCR_DICT
  8520. - bpo-44589: Mapping patterns in ``match`` statements with two or more equal
  8521. literal keys will now raise a :exc:`SyntaxError` at compile-time.
  8522. - bpo-44606: Fix ``__instancecheck__`` and ``__subclasscheck__`` for the
  8523. union type.
  8524. - bpo-42073: The ``@classmethod`` decorator can now wrap other
  8525. classmethod-like descriptors.
  8526. - bpo-41972: Tuned the string-searching algorithm of fastsearch.h to have a
  8527. shorter inner loop for most cases.
  8528. - bpo-44590: All necessary data for executing a Python function (local
  8529. variables, stack, etc) is now kept in a per-thread stack. Frame objects
  8530. are lazily allocated on demand. This increases performance by about 7% on
  8531. the standard benchmark suite. Introspection and debugging are unaffected
  8532. as frame objects are always available when needed. Patch by Mark Shannon.
  8533. - bpo-44584: The threading debug (:envvar:`!PYTHONTHREADDEBUG` environment
  8534. variable) is deprecated in Python 3.10 and will be removed in Python 3.12.
  8535. This feature requires a debug build of Python. Patch by Victor Stinner.
  8536. - bpo-43895: An obsolete internal cache of shared object file handles added
  8537. in 1995 that attempted, but did not guarantee, that a .so would not be
  8538. dlopen'ed twice to work around flaws in mid-1990s posix-ish operating
  8539. systems has been removed from dynload_shlib.c.
  8540. - bpo-44490: :mod:`typing` now searches for type parameters in
  8541. ``types.Union`` objects. ``get_type_hints`` will also properly resolve
  8542. annotations with nested ``types.Union`` objects. Patch provided by Yurii
  8543. Karabas.
  8544. - bpo-43950: Code objects can now provide the column information for
  8545. instructions when available. This is levaraged during traceback printing
  8546. to show the expressions responsible for errors.
  8547. Contributed by Pablo Galindo, Batuhan Taskaya and Ammar Askar as part of
  8548. :pep:`657`.
  8549. - bpo-44562: Remove uses of :c:func:`PyObject_GC_Del` in error path when
  8550. initializing :class:`types.GenericAlias`.
  8551. - bpo-41486: Fix a memory consumption and copying performance regression in
  8552. earlier 3.10 beta releases if someone used an output buffer larger than
  8553. 4GiB with zlib.decompress on input data that expands that large.
  8554. - bpo-43908: Heap types with the :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` flag
  8555. can now inherit the :pep:`590` vectorcall protocol. Previously, this was
  8556. only possible for :ref:`static types <static-types>`. Patch by Erlend E.
  8557. Aasland.
  8558. - bpo-44553: Implement GC methods for ``types.Union`` to break reference
  8559. cycles and prevent memory leaks.
  8560. - bpo-44490: Add ``__parameters__`` attribute and ``__getitem__`` operator
  8561. to ``types.Union``. Patch provided by Yurii Karabas.
  8562. - bpo-44523: Remove the pass-through for :func:`hash` of
  8563. :class:`weakref.proxy` objects to prevent unintended consequences when the
  8564. original referred object dies while the proxy is part of a hashable
  8565. object. Patch by Pablo Galindo.
  8566. - bpo-44483: Fix a crash in ``types.Union`` objects when creating a union of
  8567. an object with bad ``__module__`` field.
  8568. - bpo-44486: Modules will always have a dictionary, even when created by
  8569. ``types.ModuleType.__new__()``
  8570. - bpo-44472: Fix ltrace functionality when exceptions are raised. Patch by
  8571. Pablo Galindo
  8572. - bpo-12022: A :exc:`TypeError` is now raised instead of an
  8573. :exc:`AttributeError` in :keyword:`with` and :keyword:`async with`
  8574. statements for objects which do not support the :term:`context manager` or
  8575. :term:`asynchronous context manager` protocols correspondingly.
  8576. - bpo-44297: Make sure that the line number is set when entering a
  8577. comprehension scope. Ensures that backtraces inclusing generator
  8578. expressions show the correct line number.
  8579. - bpo-44456: Improve the syntax error when mixing positional and keyword
  8580. patterns. Patch by Pablo Galindo.
  8581. - bpo-44409: Fix error location information for tokenizer errors raised on
  8582. initialization of the tokenizer. Patch by Pablo Galindo.
  8583. - bpo-44396: Fix a possible crash in the tokenizer when raising syntax
  8584. errors for unclosed strings. Patch by Pablo Galindo.
  8585. - bpo-44376: Exact integer exponentiation (like ``i**2`` or ``pow(i, 2)``)
  8586. with a small exponent is much faster, due to reducing overhead in such
  8587. cases.
  8588. - bpo-44313: Directly imported objects and modules (through import and from
  8589. import statements) don't generate ``LOAD_METHOD``/``CALL_METHOD`` for
  8590. directly accessed objects on their namespace. They now use the regular
  8591. ``LOAD_ATTR``/``CALL_FUNCTION``.
  8592. - bpo-44338: Implement adaptive specialization for LOAD_GLOBAL
  8593. Two specialized forms of LOAD_GLOBAL are added:
  8594. * LOAD_GLOBAL_MODULE
  8595. * LOAD_GLOBAL_BUILTIN
  8596. - bpo-44368: Improve syntax errors for invalid "as" targets. Patch by Pablo
  8597. Galindo
  8598. - bpo-44349: Fix an edge case when displaying text from files with encoding
  8599. in syntax errors. Patch by Pablo Galindo.
  8600. - bpo-44337: Initial implementation of adaptive specialization of LOAD_ATTR
  8601. Four specialized forms of LOAD_ATTR are added:
  8602. * LOAD_ATTR_SLOT
  8603. * LOAD_ATTR_SPLIT_KEYS
  8604. * LOAD_ATTR_WITH_HINT
  8605. * LOAD_ATTR_MODULE
  8606. - bpo-44335: Fix a regression when identifying incorrect characters in
  8607. syntax errors. Patch by Pablo Galindo
  8608. - bpo-43693: Computation of the offsets of cell variables is done in the
  8609. compiler instead of at runtime. This reduces the overhead of handling cell
  8610. and free variables, especially in the case where a variable is both an
  8611. argument and cell variable.
  8612. - bpo-44317: Improve tokenizer error with improved locations. Patch by Pablo
  8613. Galindo.
  8614. - bpo-44304: Fix a crash in the :mod:`sqlite3` module that happened when the
  8615. garbage collector clears :class:`sqlite.Statement` objects. Patch by Pablo
  8616. Galindo
  8617. - bpo-44305: Improve error message for ``try`` blocks without ``except`` or
  8618. ``finally`` blocks. Patch by Pablo Galindo.
  8619. - bpo-43413: Constructors of subclasses of some builtin classes (e.g.
  8620. :class:`tuple`, :class:`list`, :class:`frozenset`) no longer accept
  8621. arbitrary keyword arguments. [reverted in 3.11a4] Subclass of :class:`set`
  8622. can now define a ``__new__()`` method with additional keyword parameters
  8623. without overriding also ``__init__()``.
  8624. - bpo-43667: Improve Unicode support in non-UTF locales on Oracle Solaris.
  8625. This issue does not affect other Solaris systems.
  8626. - bpo-43693: A new opcode MAKE_CELL has been added that effectively moves
  8627. some of the work done on function entry into the compiler and into the
  8628. eval loop. In addition to creating the required cell objects, the new
  8629. opcode converts relevant arguments (and other locals) to cell variables on
  8630. function entry.
  8631. - bpo-44232: Fix a regression in :func:`type` when a metaclass raises an
  8632. exception. The C function :c:func:`type_new` must properly report the
  8633. exception when a metaclass constructor raises an exception and the winner
  8634. class is not the metaclass. Patch by Victor Stinner.
  8635. - bpo-44201: Avoid side effects of checking for specialized syntax errors in
  8636. the REPL that was causing it to ask for extra tokens after a syntax error
  8637. had been detected. Patch by Pablo Galindo
  8638. - bpo-43693: ``PyCodeObject`` gained ``co_fastlocalnames`` and
  8639. ``co_fastlocalkinds`` as the authoritative source of fast locals info.
  8640. Marshaled code objects have changed accordingly.
  8641. - bpo-44184: Fix a crash at Python exit when a deallocator function removes
  8642. the last strong reference to a heap type. Patch by Victor Stinner.
  8643. - bpo-44187: Implement quickening in the interpreter. This offers no
  8644. advantages as yet, but is an enabler of future optimizations. See PEP 659
  8645. for full explanation.
  8646. - bpo-44180: The parser doesn't report generic syntax errors that happen in
  8647. a position further away that the one it reached in the first pass. Patch
  8648. by Pablo Galindo
  8649. - bpo-44168: Fix error message in the parser involving keyword arguments
  8650. with invalid expressions. Patch by Pablo Galindo
  8651. - bpo-44156: String caches in ``compile.c`` are now subinterpreter
  8652. compatible.
  8653. - bpo-44143: Fixed a crash in the parser that manifest when raising
  8654. tokenizer errors when an existing exception was present. Patch by Pablo
  8655. Galindo.
  8656. - bpo-44032: Move 'fast' locals and other variables from the frame object to
  8657. a per-thread datastack.
  8658. - bpo-44114: Fix incorrect dictkeys_reversed and dictitems_reversed function
  8659. signatures in C code, which broke webassembly builds.
  8660. - bpo-44110: Improve :func:`str.__getitem__` error message
  8661. - bpo-26110: Add ``CALL_METHOD_KW`` opcode to speed up method calls with
  8662. keyword arguments. Idea originated from PyPy. A side effect is executing
  8663. ``CALL_METHOD`` is now branchless in the evaluation loop.
  8664. - bpo-28307: Compiler now optimizes simple C-style formatting with literal
  8665. format containing only format codes %s, %r and %a by converting them to
  8666. f-string expressions.
  8667. - bpo-43149: Correct the syntax error message regarding multiple exception
  8668. types to not refer to "exception groups". Patch by Pablo Galindo
  8669. - bpo-43822: The parser will prioritize tokenizer errors over custom syntax
  8670. errors when raising exceptions. Patch by Pablo Galindo.
  8671. - bpo-40222: "Zero cost" exception handling.
  8672. * Uses a lookup table to determine how to handle exceptions.
  8673. * Removes SETUP_FINALLY and POP_TOP block instructions, eliminating the runtime overhead of try statements.
  8674. * Reduces the size of the frame object by about 60%.
  8675. Patch by Mark Shannon
  8676. - bpo-43918: Document the signature and ``default`` argument in the
  8677. docstring of the new ``anext`` builtin.
  8678. - bpo-43833: Emit a deprecation warning if the numeric literal is
  8679. immediately followed by one of keywords: and, else, for, if, in, is, or.
  8680. Raise a syntax error with more informative message if it is immediately
  8681. followed by other keyword or identifier.
  8682. - bpo-43879: Add native_thread_id to PyThreadState. Patch by Gabriele N.
  8683. Tornetta.
  8684. - bpo-43693: Compute cell offsets relative to locals in compiler. Allows the
  8685. interpreter to treats locals and cells a single array, which is slightly
  8686. more efficient. Also make the LOAD_CLOSURE opcode an alias for LOAD_FAST.
  8687. Preserving LOAD_CLOSURE helps keep bytecode a bit more readable.
  8688. - bpo-17792: More accurate error messages for access of unbound locals or
  8689. free vars.
  8690. - bpo-28146: Fix a confusing error message in :func:`str.format`.
  8691. - bpo-11105: When compiling :class:`ast.AST` objects with recursive
  8692. references through :func:`compile`, the interpreter doesn't crash anymore
  8693. instead it raises a :exc:`RecursionError`.
  8694. - bpo-39091: Fix crash when using passing a non-exception to a generator's
  8695. ``throw()`` method. Patch by Noah Oxer
  8696. - bpo-33346: Asynchronous comprehensions are now allowed inside
  8697. comprehensions in asynchronous functions. Outer comprehensions implicitly
  8698. become asynchronous.
  8699. Library
  8700. -------
  8701. - bpo-45371: Fix clang rpath issue in ``distutils``. The UnixCCompiler now
  8702. uses correct clang option to add a runtime library directory (rpath) to a
  8703. shared library.
  8704. - bpo-45329: Fix freed memory access in :class:`pyexpat.xmlparser` when
  8705. building it with an installed expat library <= 2.2.0.
  8706. - bpo-41710: On Unix, if the ``sem_clockwait()`` function is available in
  8707. the C library (glibc 2.30 and newer), the :meth:`threading.Lock.acquire`
  8708. method now uses the monotonic clock (:const:`time.CLOCK_MONOTONIC`) for
  8709. the timeout, rather than using the system clock
  8710. (:const:`time.CLOCK_REALTIME`), to not be affected by system clock
  8711. changes. Patch by Victor Stinner.
  8712. - bpo-1596321: Fix the :func:`threading._shutdown` function when the
  8713. :mod:`threading` module was imported first from a thread different than
  8714. the main thread: no longer log an error at Python exit.
  8715. - bpo-45274: Fix a race condition in the :meth:`Thread.join()
  8716. <threading.Thread.join>` method of the :mod:`threading` module. If the
  8717. function is interrupted by a signal and the signal handler raises an
  8718. exception, make sure that the thread remains in a consistent state to
  8719. prevent a deadlock. Patch by Victor Stinner.
  8720. - bpo-21302: In Unix operating systems, :func:`time.sleep` now uses the
  8721. ``nanosleep()`` function, if ``clock_nanosleep()`` is not available but
  8722. ``nanosleep()`` is available. ``nanosleep()`` allows to sleep with
  8723. nanosecond precision.
  8724. - bpo-21302: On Windows, :func:`time.sleep` now uses a waitable timer which
  8725. has a resolution of 100 nanoseconds (10\ :sup:`-7` seconds). Previously,
  8726. it had a resolution of 1 millisecond (10\ :sup:`-3` seconds). Patch by
  8727. Benjamin Szőke and Victor Stinner.
  8728. - bpo-45238: Fix :meth:`unittest.IsolatedAsyncioTestCase.debug`: it runs now
  8729. asynchronous methods and callbacks.
  8730. - bpo-36674: :meth:`unittest.TestCase.debug` raises now a
  8731. :class:`unittest.SkipTest` if the class or the test method are decorated
  8732. with the skipping decorator.
  8733. - bpo-45235: Fix an issue where argparse would not preserve values in a
  8734. provided namespace when using a subparser with defaults.
  8735. - bpo-45183: Have zipimport.zipimporter.find_spec() not raise an exception
  8736. when the underlying zip file has been deleted and the internal cache has
  8737. been reset via invalidate_cache().
  8738. - bpo-45234: Fixed a regression in :func:`~shutil.copyfile`,
  8739. :func:`~shutil.copy`, :func:`~shutil.copy2` raising
  8740. :exc:`FileNotFoundError` when source is a directory, which should raise
  8741. :exc:`IsADirectoryError`
  8742. - bpo-45228: Fix stack buffer overflow in parsing J1939 network address.
  8743. - bpo-45225: use map function instead of genexpr in capwords.
  8744. - bpo-42135: Fix typo: ``importlib.find_loader`` is really slated for
  8745. removal in Python 3.12 not 3.10, like the others in PR 25169.
  8746. Patch by Hugo van Kemenade.
  8747. - bpo-20524: Improves error messages on ``.format()`` operation for ``str``,
  8748. ``float``, ``int``, and ``complex``. New format now shows the problematic
  8749. pattern and the object type.
  8750. - bpo-45168: Change :func:`dis.dis` output to omit op arg values that cannot
  8751. be resolved due to ``co_consts``, ``co_names`` etc not being provided.
  8752. Previously the oparg itself was repeated in the value field, which is not
  8753. useful and can be confusing.
  8754. - bpo-21302: In Unix operating systems, :func:`time.sleep` now uses the
  8755. ``clock_nanosleep()`` function, if available, which allows to sleep for an
  8756. interval specified with nanosecond precision.
  8757. - bpo-45173: Remove from the :mod:`configparser` module: the
  8758. :class:`!SafeConfigParser` class, the :attr:`!filename` property of the
  8759. :class:`~configparser.ParsingError` class, the :meth:`!readfp` method of
  8760. the :class:`~configparser.ConfigParser` class, deprecated since Python
  8761. 3.2.
  8762. Patch by Hugo van Kemenade.
  8763. - bpo-44987: Pure ASCII strings are now normalized in constant time by
  8764. :func:`unicodedata.normalize`. Patch by Donghee Na.
  8765. - bpo-35474: Calling :func:`mimetypes.guess_all_extensions` with
  8766. ``strict=False`` no longer affects the result of the following call with
  8767. ``strict=True``. Also, mutating the returned list no longer affects the
  8768. global state.
  8769. - bpo-45166: :func:`typing.get_type_hints` now works with
  8770. :data:`~typing.Final` wrapped in :class:`~typing.ForwardRef`.
  8771. - bpo-45162: Remove many old deprecated :mod:`unittest` features:
  8772. * "``fail*``" and "``assert*``" aliases of :class:`~unittest.TestCase` methods.
  8773. * Broken from start :class:`~unittest.TestCase` method ``assertDictContainsSubset()``.
  8774. * Ignored :meth:`<unittest.TestLoader.loadTestsFromModule> TestLoader.loadTestsFromModule` parameter *use_load_tests*.
  8775. * Old alias ``_TextTestResult`` of :class:`~unittest.TextTestResult`.
  8776. - bpo-38371: Remove the deprecated ``split()`` method of
  8777. :class:`_tkinter.TkappType`. Patch by Erlend E. Aasland.
  8778. - bpo-20499: Improve the speed and accuracy of statistics.pvariance().
  8779. - bpo-45132: Remove :meth:`~object.__getitem__` methods of
  8780. :class:`xml.dom.pulldom.DOMEventStream`, :class:`wsgiref.util.FileWrapper`
  8781. and :class:`fileinput.FileInput`, deprecated since Python 3.9.
  8782. Patch by Hugo van Kemenade.
  8783. - bpo-45129: Due to significant security concerns, the *reuse_address*
  8784. parameter of :meth:`asyncio.loop.create_datagram_endpoint`, disabled in
  8785. Python 3.9, is now entirely removed. This is because of the behavior of
  8786. the socket option ``SO_REUSEADDR`` in UDP.
  8787. Patch by Hugo van Kemenade.
  8788. - bpo-45124: The ``bdist_msi`` command, deprecated in Python 3.9, is now
  8789. removed.
  8790. Use ``bdist_wheel`` (wheel packages) instead.
  8791. Patch by Hugo van Kemenade.
  8792. - bpo-30856: :class:`unittest.TestResult` methods
  8793. :meth:`~unittest.TestResult.addFailure`,
  8794. :meth:`~unittest.TestResult.addError`,
  8795. :meth:`~unittest.TestResult.addSkip` and
  8796. :meth:`~unittest.TestResult.addSubTest` are now called immediately after
  8797. raising an exception in test or finishing a subtest. Previously they were
  8798. called only after finishing the test clean up.
  8799. - bpo-45034: Changes how error is formatted for ``struct.pack`` with ``'H'``
  8800. and ``'h'`` modes and too large / small numbers. Now it shows the actual
  8801. numeric limits, while previously it was showing arithmetic expressions.
  8802. - bpo-25894: :mod:`unittest` now always reports skipped and failed subtests
  8803. separately: separate characters in default mode and separate lines in
  8804. verbose mode. Also the test description is now output for errors in test
  8805. method, class and module cleanups.
  8806. - bpo-45081: Fix issue when dataclasses that inherit from
  8807. ``typing.Protocol`` subclasses have wrong ``__init__``. Patch provided by
  8808. Yurii Karabas.
  8809. - bpo-45085: The ``binhex`` module, deprecated in Python 3.9, is now
  8810. removed. The following :mod:`binascii` functions, deprecated in Python
  8811. 3.9, are now also removed:
  8812. * ``a2b_hqx()``, ``b2a_hqx()``;
  8813. * ``rlecode_hqx()``, ``rledecode_hqx()``.
  8814. The :func:`binascii.crc_hqx` function remains available.
  8815. Patch by Victor Stinner.
  8816. - bpo-40360: The :mod:`lib2to3` package is now deprecated and may not be
  8817. able to parse Python 3.10 or newer. See the :pep:`617` (New PEG parser for
  8818. CPython). Patch by Victor Stinner.
  8819. - bpo-45075: Rename :meth:`traceback.StackSummary.format_frame` to
  8820. :meth:`traceback.StackSummary.format_frame_summary`. This method was added
  8821. for 3.11 so it was not released yet.
  8822. Updated code and docs to better distinguish frame and FrameSummary.
  8823. - bpo-31299: Add option to completely drop frames from a traceback by
  8824. returning ``None`` from a :meth:`~traceback.StackSummary.format_frame`
  8825. override.
  8826. - bpo-41620: :meth:`~unittest.TestCase.run` now always return a
  8827. :class:`~unittest.TestResult` instance. Previously it returned ``None`` if
  8828. the test class or method was decorated with a skipping decorator.
  8829. - bpo-45021: Fix a potential deadlock at shutdown of forked children when
  8830. using :mod:`concurrent.futures` module
  8831. - bpo-43913: Fix bugs in cleaning up classes and modules in :mod:`unittest`:
  8832. * Functions registered with :func:`~unittest.addModuleCleanup` were not called unless the user defines ``tearDownModule()`` in their test module.
  8833. * Functions registered with :meth:`~unittest.TestCase.addClassCleanup` were not called if ``tearDownClass`` is set to ``None``.
  8834. * Buffering in :class:`~unittest.TestResult` did not work with functions registered with ``addClassCleanup()`` and ``addModuleCleanup()``.
  8835. * Errors in functions registered with ``addClassCleanup()`` and ``addModuleCleanup()`` were not handled correctly in buffered and debug modes.
  8836. * Errors in ``setUpModule()`` and functions registered with ``addModuleCleanup()`` were reported in wrong order.
  8837. * And several lesser bugs.
  8838. - bpo-45030: Fix integer overflow in pickling and copying the range
  8839. iterator.
  8840. - bpo-45001: Made email date parsing more robust against malformed input,
  8841. namely a whitespace-only ``Date:`` header. Patch by Wouter Bolsterlee.
  8842. - bpo-45010: Remove support of special method ``__div__`` in
  8843. :mod:`unittest.mock`. It is not used in Python 3.
  8844. - bpo-39218: Improve accuracy of variance calculations by using ``x*x``
  8845. instead of ``x**2``.
  8846. - bpo-43613: Improve the speed of :func:`gzip.compress` and
  8847. :func:`gzip.decompress` by compressing and decompressing at once in memory
  8848. instead of in a streamed fashion.
  8849. - bpo-37596: Ensure that :class:`set` and :class:`frozenset` objects are
  8850. always :mod:`marshalled <marshal>` reproducibly.
  8851. - bpo-44019: A new function ``operator.call`` has been added, such that
  8852. ``operator.call(obj, *args, **kwargs) == obj(*args, **kwargs)``.
  8853. - bpo-42255: :class:`webbrowser.MacOSX` is deprecated and will be removed in
  8854. Python 3.13. It is untested and undocumented and also not used by
  8855. webbrowser itself. Patch by Donghee Na.
  8856. - bpo-44955: Method :meth:`~unittest.TestResult.stopTestRun` is now always
  8857. called in pair with method :meth:`~unittest.TestResult.startTestRun` for
  8858. :class:`~unittest.TestResult` objects implicitly created in
  8859. :meth:`~unittest.TestCase.run`. Previously it was not called for test
  8860. methods and classes decorated with a skipping decorator.
  8861. - bpo-39039: tarfile.open raises :exc:`~tarfile.ReadError` when a zlib error
  8862. occurs during file extraction.
  8863. - bpo-44935: :mod:`subprocess` on Solaris now also uses
  8864. :func:`os.posix_spawn()` for better performance.
  8865. - bpo-44911: :class:`~unittest.IsolatedAsyncioTestCase` will no longer throw
  8866. an exception while cancelling leaked tasks. Patch by Bar Harel.
  8867. - bpo-41322: Added ``DeprecationWarning`` for tests and async tests that
  8868. return a value!=None (as this may indicate an improperly written test, for
  8869. example a test written as a generator function).
  8870. - bpo-44524: Make exception message more useful when subclass from typing
  8871. special form alias. Patch provided by Yurii Karabas.
  8872. - bpo-38956: :class:`argparse.BooleanOptionalAction`'s default value is no
  8873. longer printed twice when used with
  8874. :class:`argparse.ArgumentDefaultsHelpFormatter`.
  8875. - bpo-44860: Fix the ``posix_user`` scheme in :mod:`sysconfig` to not depend
  8876. on :data:`sys.platlibdir`.
  8877. - bpo-44859: Improve error handling in :mod:`sqlite3` and raise more
  8878. accurate exceptions.
  8879. * :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()``.
  8880. * :exc:`UnicodEncodeError` is now raised instead of :exc:`sqlite3.Warning` when the statement contains surrogate characters in ``Connection.__call__()`` and ``Cursor.execute()``.
  8881. * :exc:`TypeError` is now raised instead of :exc:`ValueError` for non-string script argument in ``Cursor.executescript()``.
  8882. * :exc:`ValueError` is now raised for script containing the null character instead of truncating it in ``Cursor.executescript()``.
  8883. * Correctly handle exceptions raised when getting boolean value of the result of the progress handler.
  8884. * Add many tests covering different corner cases.
  8885. - bpo-44581: Upgrade bundled pip to 21.2.3 and setuptools to 57.4.0
  8886. - bpo-44849: Fix the :func:`os.set_inheritable` function on FreeBSD 14 for
  8887. file descriptor opened with the :const:`~os.O_PATH` flag: ignore the
  8888. :const:`~errno.EBADF` error on ``ioctl()``, fallback on the ``fcntl()``
  8889. implementation. Patch by Victor Stinner.
  8890. - bpo-44605: The @functools.total_ordering() decorator now works with
  8891. metaclasses.
  8892. - bpo-44524: Fixed an issue wherein the ``__name__`` and ``__qualname__``
  8893. attributes of subscribed specialforms could be ``None``.
  8894. - bpo-44839: :class:`MemoryError` raised in user-defined functions will now
  8895. produce a ``MemoryError`` in :mod:`sqlite3`. :class:`OverflowError` will
  8896. now be converted to :class:`~sqlite3.DataError`. Previously
  8897. :class:`~sqlite3.OperationalError` was produced in these cases.
  8898. - bpo-44822: :mod:`sqlite3` user-defined functions and aggregators returning
  8899. :class:`strings <str>` with embedded NUL characters are no longer
  8900. truncated. Patch by Erlend E. Aasland.
  8901. - bpo-44801: Ensure that the :class:`~typing.ParamSpec` variable in Callable
  8902. can only be substituted with a parameters expression (a list of types, an
  8903. ellipsis, ParamSpec or Concatenate).
  8904. - bpo-44806: Non-protocol subclasses of :class:`typing.Protocol` ignore now
  8905. the ``__init__`` method inherited from protocol base classes.
  8906. - bpo-27275: :meth:`collections.OrderedDict.popitem` and
  8907. :meth:`collections.OrderedDict.pop` no longer call ``__getitem__`` and
  8908. ``__delitem__`` methods of the OrderedDict subclasses.
  8909. - bpo-44793: Fix checking the number of arguments when subscribe a generic
  8910. type with ``ParamSpec`` parameter.
  8911. - bpo-44784: In importlib.metadata tests, override warnings behavior under
  8912. expected DeprecationWarnings (importlib_metadata 4.6.3).
  8913. - bpo-44667: The :func:`tokenize.tokenize` doesn't incorrectly generate a
  8914. ``NEWLINE`` token if the source doesn't end with a new line character but
  8915. the last line is a comment, as the function is already generating a ``NL``
  8916. token. Patch by Pablo Galindo
  8917. - bpo-44771: Added ``importlib.simple`` module implementing adapters from a
  8918. low-level resources reader interface to a ``TraversableResources``
  8919. interface. Legacy API (``path``, ``contents``, ...) is now supported
  8920. entirely by the ``.files()`` API with a compatibility shim supplied for
  8921. resource loaders without that functionality. Feature parity with
  8922. ``importlib_resources`` 5.2.
  8923. - bpo-44752: :mod:`rcompleter` does not call :func:`getattr` on
  8924. :class:`property` objects to avoid the side-effect of evaluating the
  8925. corresponding method.
  8926. - bpo-44747: Refactor usage of ``sys._getframe`` in ``typing`` module. Patch
  8927. provided by Yurii Karabas.
  8928. - bpo-42378: Fixes the issue with log file being overwritten when
  8929. :class:`logging.FileHandler` is used in :mod:`atexit` with *filemode* set
  8930. to ``'w'``. Note this will cause the message in *atexit* not being logged
  8931. if the log stream is already closed due to shutdown of logging.
  8932. - bpo-44720: ``weakref.proxy`` objects referencing non-iterators now raise
  8933. ``TypeError`` rather than dereferencing the null ``tp_iternext`` slot and
  8934. crashing.
  8935. - bpo-44704: The implementation of ``collections.abc.Set._hash()`` now
  8936. matches that of ``frozenset.__hash__()``.
  8937. - bpo-44666: Fixed issue in :func:`compileall.compile_file` when
  8938. ``sys.stdout`` is redirected. Patch by Stefan Hölzl.
  8939. - bpo-44688: :meth:`sqlite3.Connection.create_collation` now accepts
  8940. non-ASCII collation names. Patch by Erlend E. Aasland.
  8941. - bpo-44690: Adopt *binacii.a2b_base64*'s strict mode in *base64.b64decode*.
  8942. - bpo-42854: Fixed a bug in the :mod:`_ssl` module that was throwing
  8943. :exc:`OverflowError` when using :meth:`_ssl._SSLSocket.write` and
  8944. :meth:`_ssl._SSLSocket.read` for a big value of the ``len`` parameter.
  8945. Patch by Pablo Galindo
  8946. - bpo-44686: Replace ``unittest.mock._importer`` with
  8947. ``pkgutil.resolve_name``.
  8948. - bpo-44353: Make ``NewType.__call__`` faster by implementing it in C. Patch
  8949. provided by Yurii Karabas.
  8950. - bpo-44682: Change the :mod:`pdb` *commands* directive to disallow setting
  8951. commands for an invalid breakpoint and to display an appropriate error.
  8952. - bpo-44353: Refactor ``typing.NewType`` from function into callable class.
  8953. Patch provided by Yurii Karabas.
  8954. - bpo-44678: Added a separate error message for discontinuous padding in
  8955. *binascii.a2b_base64* strict mode.
  8956. - bpo-44524: Add missing ``__name__`` and ``__qualname__`` attributes to
  8957. ``typing`` module classes. Patch provided by Yurii Karabas.
  8958. - bpo-40897: Give priority to using the current class constructor in
  8959. :func:`inspect.signature`. Patch by Weipeng Hong.
  8960. - bpo-44638: Add a reference to the zipp project and hint as to how to use
  8961. it.
  8962. - bpo-44648: Fixed wrong error being thrown by :func:`inspect.getsource`
  8963. when examining a class in the interactive session. Instead of
  8964. :exc:`TypeError`, it should be :exc:`OSError` with appropriate error
  8965. message.
  8966. - bpo-44608: Fix memory leak in :func:`_tkinter._flatten` if it is called
  8967. with a sequence or set, but not list or tuple.
  8968. - bpo-44594: Fix an edge case of :class:`ExitStack` and
  8969. :class:`AsyncExitStack` exception chaining. They will now match ``with``
  8970. block behavior when ``__context__`` is explicitly set to ``None`` when the
  8971. exception is in flight.
  8972. - bpo-42799: In :mod:`fnmatch`, the cache size for compiled regex patterns
  8973. (:func:`functools.lru_cache`) was bumped up from 256 to 32768, affecting
  8974. functions: :func:`fnmatch.fnmatch`, :func:`fnmatch.fnmatchcase`,
  8975. :func:`fnmatch.filter`.
  8976. - bpo-41928: Update :func:`shutil.copyfile` to raise
  8977. :exc:`FileNotFoundError` instead of confusing :exc:`IsADirectoryError`
  8978. when a path ending with a :const:`os.path.sep` does not exist;
  8979. :func:`shutil.copy` and :func:`shutil.copy2` are also affected.
  8980. - bpo-44569: Added the :func:`StackSummary.format_frame` function in
  8981. :mod:`traceback`. This allows users to customize the way individual lines
  8982. are formatted in tracebacks without re-implementing logic to handle
  8983. recursive tracebacks.
  8984. - bpo-44566: handle StopIteration subclass raised from
  8985. @contextlib.contextmanager generator
  8986. - bpo-44558: Make the implementation consistency of
  8987. :func:`~operator.indexOf` between C and Python versions. Patch by Donghee
  8988. Na.
  8989. - bpo-41249: Fixes ``TypedDict`` to work with ``typing.get_type_hints()``
  8990. and postponed evaluation of annotations across modules.
  8991. - bpo-44554: Refactor argument processing in :func:`pdb.main` to simplify
  8992. detection of errors in input loading and clarify behavior around module or
  8993. script invocation.
  8994. - bpo-34798: Break up paragraph about :class:`pprint.PrettyPrinter`
  8995. construction parameters to make it easier to read.
  8996. - bpo-44539: Added support for recognizing JPEG files without JFIF or Exif
  8997. markers.
  8998. - bpo-44461: Fix bug with :mod:`pdb`'s handling of import error due to a
  8999. package which does not have a ``__main__`` module
  9000. - bpo-43625: Fix a bug in the detection of CSV file headers by
  9001. :meth:`csv.Sniffer.has_header` and improve documentation of same.
  9002. - bpo-44516: Update vendored pip to 21.1.3
  9003. - bpo-42892: Fixed an exception thrown while parsing a malformed multipart
  9004. email by :class:`email.message.EmailMessage`.
  9005. - bpo-44468: :func:`typing.get_type_hints` now finds annotations in classes
  9006. and base classes with unexpected ``__module__``. Previously, it skipped
  9007. those MRO elements.
  9008. - bpo-44491: Allow clearing the :mod:`sqlite3` authorizer callback by
  9009. passing :const:`None` to :meth:`~sqlite3.Connection.set_authorizer`. Patch
  9010. by Erlend E. Aasland.
  9011. - bpo-43977: Set the proper :c:macro:`Py_TPFLAGS_MAPPING` and
  9012. :c:macro:`Py_TPFLAGS_SEQUENCE` flags for subclasses created before a
  9013. parent has been registered as a :class:`collections.abc.Mapping` or
  9014. :class:`collections.abc.Sequence`.
  9015. - bpo-44482: Fix very unlikely resource leak in :mod:`glob` in alternate
  9016. Python implementations.
  9017. - bpo-44466: The :mod:`faulthandler` module now detects if a fatal error
  9018. occurs during a garbage collector collection. Patch by Victor Stinner.
  9019. - bpo-44471: A :exc:`TypeError` is now raised instead of an
  9020. :exc:`AttributeError` in :meth:`contextlib.ExitStack.enter_context` and
  9021. :meth:`contextlib.AsyncExitStack.enter_async_context` for objects which do
  9022. not support the :term:`context manager` or :term:`asynchronous context
  9023. manager` protocols correspondingly.
  9024. - bpo-44404: :mod:`tkinter`'s ``after()`` method now supports callables
  9025. without the ``__name__`` attribute.
  9026. - bpo-41546: Make :mod:`pprint` (like the builtin ``print``) not attempt to
  9027. write to ``stdout`` when it is ``None``.
  9028. - bpo-44458: ``BUFFER_BLOCK_SIZE`` is now declared static, to avoid linking
  9029. collisions when bz2, lmza or zlib are statically linked.
  9030. - bpo-44464: Remove exception for flake8 in deprecated importlib.metadata
  9031. interfaces. Sync with importlib_metadata 4.6.
  9032. - bpo-44446: Take into account that ``lineno`` might be ``None`` in
  9033. :class:`traceback.FrameSummary`.
  9034. - bpo-44439: Fix in :meth:`bz2.BZ2File.write` / :meth:`lzma.LZMAFile.write`
  9035. methods, when the input data is an object that supports the buffer
  9036. protocol, the file length may be wrong.
  9037. - bpo-44434: _thread.start_new_thread() no longer calls
  9038. PyThread_exit_thread() explicitly at the thread exit, the call was
  9039. redundant. On Linux with the glibc, pthread_exit() aborts the whole
  9040. process if dlopen() fails to open libgcc_s.so file (ex: EMFILE error).
  9041. Patch by Victor Stinner.
  9042. - bpo-42972: The _thread.RLock type now fully implement the GC protocol: add
  9043. a traverse function and the :c:macro:`Py_TPFLAGS_HAVE_GC` flag. Patch by
  9044. Victor Stinner.
  9045. - bpo-44422: The :func:`threading.enumerate` function now uses a reentrant
  9046. lock to prevent a hang on reentrant call. Patch by Victor Stinner.
  9047. - bpo-38291: Importing typing.io or typing.re now prints a
  9048. ``DeprecationWarning``.
  9049. - bpo-37880: argparse actions store_const and append_const each receive a
  9050. default value of None when the ``const`` kwarg is not provided.
  9051. Previously, this raised a :exc:`TypeError`.
  9052. - bpo-44389: Fix deprecation of :data:`ssl.OP_NO_TLSv1_3`
  9053. - bpo-27827: :meth:`pathlib.PureWindowsPath.is_reserved` now identifies a
  9054. greater range of reserved filenames, including those with trailing spaces
  9055. or colons.
  9056. - bpo-44395: Fix :meth:`~email.message.MIMEPart.as_string` to pass unixfrom
  9057. properly. Patch by Donghee Na.
  9058. - bpo-34266: Handle exceptions from parsing the arg of :mod:`pdb`'s
  9059. run/restart command.
  9060. - bpo-44362: Improve :mod:`ssl` module's deprecation messages, error
  9061. reporting, and documentation for deprecations.
  9062. - bpo-44342: [Enum] Change pickling from by-value to by-name.
  9063. - bpo-44356: [Enum] Allow multiple data-type mixins if they are all the
  9064. same.
  9065. - bpo-44351: Restore back :func:`parse_makefile` in ``distutils.sysconfig``
  9066. because it behaves differently than the similar implementation in
  9067. :mod:`sysconfig`.
  9068. - bpo-35800: :class:`!smtpd.MailmanProxy` is now removed as it is unusable
  9069. without an external module, ``mailman``. Patch by Donghee Na.
  9070. - bpo-44357: Added a function that returns cube root of the given number
  9071. :func:`math.cbrt`
  9072. - bpo-44339: Change ``math.pow(±0.0, -math.inf)`` to return ``inf`` instead
  9073. of raising ``ValueError``. This brings the special-case handling of
  9074. ``math.pow`` into compliance with the IEEE 754 standard.
  9075. - bpo-44242: Remove missing flag check from Enum creation and move into a
  9076. ``verify`` decorator.
  9077. - bpo-44246: In ``importlib.metadata``, restore compatibility in the result
  9078. from ``Distribution.entry_points`` (``EntryPoints``) to honor expectations
  9079. in older implementations and issuing deprecation warnings for these cases:
  9080. A. ``EntryPoints`` objects are once again mutable, allowing for
  9081. ``sort()`` and other list-based mutation operations. Avoid deprecation
  9082. warnings by casting to a mutable sequence (e.g.
  9083. ``list(dist.entry_points).sort()``). B. ``EntryPoints`` results once again
  9084. allow for access by index. To avoid deprecation warnings, cast the
  9085. result to a Sequence first (e.g. ``tuple(dist.entry_points)[0]``).
  9086. - bpo-44246: In importlib.metadata.entry_points, de-duplication of
  9087. distributions no longer requires loading the full metadata for
  9088. PathDistribution objects, improving entry point loading performance by
  9089. ~10x.
  9090. - bpo-43858: Added a function that returns a copy of a dict of logging
  9091. levels: :func:`logging.getLevelNamesMapping`
  9092. - bpo-44260: The :class:`random.Random` constructor no longer reads system
  9093. entropy without need.
  9094. - bpo-44254: On Mac, give turtledemo button text a color that works on both
  9095. light or dark background. Programmers cannot control the latter.
  9096. - bpo-44258: Support PEP 515 for Fraction's initialization from string.
  9097. - bpo-44235: Remove deprecated functions in the :mod:`gettext`. Patch by
  9098. Donghee Na.
  9099. - bpo-38693: Prefer f-strings to ``.format`` in importlib.resources.
  9100. - bpo-33693: Importlib.metadata now prefers f-strings to .format.
  9101. - bpo-44241: Incorporate minor tweaks from importlib_metadata 4.1:
  9102. SimplePath protocol, support for Metadata 2.2.
  9103. - bpo-43216: Remove the :func:`@asyncio.coroutine <asyncio.coroutine>`
  9104. :term:`decorator` enabling legacy generator-based coroutines to be
  9105. compatible with async/await code; remove
  9106. :class:`asyncio.coroutines.CoroWrapper` used for wrapping legacy coroutine
  9107. objects in the debug mode. The decorator has been deprecated since Python
  9108. 3.8 and the removal was initially scheduled for Python 3.10. Patch by
  9109. Illia Volochii.
  9110. - bpo-44210: Make importlib.metadata._meta.PackageMetadata public.
  9111. - bpo-43643: Declare readers.MultiplexedPath.name as a property per the
  9112. spec.
  9113. - bpo-27334: The :mod:`sqlite3` context manager now performs a rollback
  9114. (thus releasing the database lock) if commit failed. Patch by Luca Citi
  9115. and Erlend E. Aasland.
  9116. - bpo-4928: Documented existing behavior on POSIX: NamedTemporaryFiles are
  9117. not deleted when creating process is killed with SIGKILL
  9118. - bpo-44154: Optimize :class:`fractions.Fraction` pickling for large
  9119. components.
  9120. - bpo-33433: For IPv4 mapped IPv6 addresses (:rfc:`4291` Section 2.5.5.2),
  9121. the :mod:`ipaddress.IPv6Address.is_private` check is deferred to the
  9122. mapped IPv4 address. This solves a bug where public mapped IPv4 addresses
  9123. were considered private by the IPv6 check.
  9124. - bpo-44150: Add optional *weights* argument to statistics.fmean().
  9125. - bpo-44142: :func:`ast.unparse` will now drop the redundant parentheses
  9126. when tuples used as assignment targets (e.g in for loops).
  9127. - bpo-44145: :mod:`hmac` computations were not releasing the GIL while
  9128. calling the OpenSSL ``HMAC_Update`` C API (a new feature in 3.9). This
  9129. unintentionally prevented parallel computation as other :mod:`hashlib`
  9130. algorithms support.
  9131. - bpo-44095: :class:`zipfile.Path` now supports :attr:`zipfile.Path.stem`,
  9132. :attr:`zipfile.Path.suffixes`, and :attr:`zipfile.Path.suffix` attributes.
  9133. - bpo-44077: It's now possible to receive the type of service (ToS), a.k.a.
  9134. differentiated services (DS), a.k.a. differentiated services code point
  9135. (DSCP) and explicit congestion notification (ECN) IP header fields with
  9136. ``socket.IP_RECVTOS``.
  9137. - bpo-37788: Fix a reference leak when a Thread object is never joined.
  9138. - bpo-38908: Subclasses of ``typing.Protocol`` which only have data
  9139. variables declared will now raise a ``TypeError`` when checked with
  9140. ``isinstance`` unless they are decorated with :func:`runtime_checkable`.
  9141. Previously, these checks passed silently. Patch provided by Yurii Karabas.
  9142. - bpo-44098: ``typing.ParamSpec`` will no longer be found in the
  9143. ``__parameters__`` of most :mod:`typing` generics except in valid use
  9144. locations specified by :pep:`612`. This prevents incorrect usage like
  9145. ``typing.List[P][int]``. This change means incorrect usage which may have
  9146. passed silently in 3.10 beta 1 and earlier will now error.
  9147. - bpo-44089: Allow subclassing ``csv.Error`` in 3.10 (it was allowed in 3.9
  9148. and earlier but was disallowed in early versions of 3.10).
  9149. - bpo-44081: :func:`ast.unparse` now doesn't use redundant spaces to
  9150. separate ``lambda`` and the ``:`` if there are no parameters.
  9151. - bpo-44061: Fix regression in previous release when calling
  9152. :func:`pkgutil.iter_modules` with a list of :class:`pathlib.Path` objects
  9153. - bpo-44059: Register the SerenityOS Browser in the :mod:`webbrowser`
  9154. module.
  9155. - bpo-36515: The :mod:`hashlib` module no longer does unaligned memory
  9156. accesses when compiled for ARM platforms.
  9157. - bpo-40465: Remove random module features deprecated in Python 3.9.
  9158. - bpo-44018: random.seed() no longer mutates bytearray inputs.
  9159. - bpo-38352: Add ``IO``, ``BinaryIO``, ``TextIO``, ``Match``, and
  9160. ``Pattern`` to ``typing.__all__``. Patch by Jelle Zijlstra.
  9161. - bpo-44002: :mod:`urllib.parse` now uses :func:`functool.lru_cache` for its
  9162. internal URL splitting and quoting caches instead of rolling its own like
  9163. its the '90s.
  9164. The undocumented internal :mod:`urllib.parse` ``Quoted`` class API is now
  9165. deprecated, for removal in 3.14.
  9166. - bpo-43972: When :class:`http.server.SimpleHTTPRequestHandler` sends a
  9167. ``301 (Moved Permanently)`` for a directory path not ending with ``/``,
  9168. add a ``Content-Length: 0`` header. This improves the behavior for certain
  9169. clients.
  9170. - bpo-28528: Fix a bug in :mod:`pdb` where :meth:`~pdb.Pdb.checkline` raises
  9171. :exc:`AttributeError` if it is called after :meth:`~pdb.Pdb.reset`.
  9172. - bpo-43853: Improved string handling for :mod:`sqlite3` user-defined
  9173. functions and aggregates:
  9174. * It is now possible to pass strings with embedded null characters to UDFs
  9175. * Conversion failures now correctly raise :exc:`MemoryError`
  9176. Patch by Erlend E. Aasland.
  9177. - bpo-43666: AIX: ``Lib/_aix_support.get_platform()`` may fail in an AIX
  9178. WPAR. The fileset bos.rte appears to have a builddate in both LPAR and
  9179. WPAR so this fileset is queried rather than bos.mp64. To prevent a similar
  9180. situation (no builddate in ODM) a value (9988) sufficient for completing a
  9181. build is provided. Patch by M Felt.
  9182. - bpo-43650: Fix :exc:`MemoryError` in :func:`shutil.unpack_archive` which
  9183. fails inside :func:`shutil._unpack_zipfile` on large files. Patch by Igor
  9184. Bolshakov.
  9185. - bpo-43612: :func:`zlib.compress` now accepts a wbits parameter which
  9186. allows users to compress data as a raw deflate block without zlib headers
  9187. and trailers in one go. Previously this required instantiating a
  9188. ``zlib.compressobj``. It also provides a faster alternative to
  9189. ``gzip.compress`` when wbits=31 is used.
  9190. - bpo-43392: :func:`importlib._bootstrap._find_and_load` now implements a
  9191. two-step check to avoid locking when modules have been already imported
  9192. and are ready. This improves performance of repeated calls to
  9193. :func:`importlib.import_module` and :func:`importlib.__import__`.
  9194. - bpo-43318: Fix a bug where :mod:`pdb` does not always echo cleared
  9195. breakpoints.
  9196. - bpo-43234: Prohibit passing
  9197. non-:class:`concurrent.futures.ThreadPoolExecutor` executors to
  9198. :meth:`loop.set_default_executor` following a deprecation in Python 3.8.
  9199. Patch by Illia Volochii.
  9200. - bpo-43232: Prohibit previously deprecated potentially disruptive
  9201. operations on :class:`asyncio.trsock.TransportSocket`. Patch by Illia
  9202. Volochii.
  9203. - bpo-30077: Added support for Apple's aifc/sowt pseudo-compression
  9204. - bpo-42971: Add definition of ``errno.EQFULL`` for platforms that define
  9205. this constant (such as macOS).
  9206. - bpo-43086: Added a new optional :code:`strict_mode` parameter to
  9207. *binascii.a2b_base64*. When :code:`scrict_mode` is set to :code:`True`,
  9208. the *a2b_base64* function will accept only valid base64 content. More
  9209. details about what "valid base64 content" is, can be found in the
  9210. function's documentation.
  9211. - bpo-43024: Improve the help signature of
  9212. :func:`traceback.print_exception`, :func:`traceback.format_exception` and
  9213. :func:`traceback.format_exception_only`.
  9214. - bpo-33809: Add the :meth:`traceback.TracebackException.print` method which
  9215. prints the formatted exception information.
  9216. - bpo-42862: :mod:`sqlite3` now utilizes :meth:`functools.lru_cache` to
  9217. implement the connection statement cache. As a small optimisation, the
  9218. default statement cache size has been increased from 100 to 128. Patch by
  9219. Erlend E. Aasland.
  9220. - bpo-41818: Soumendra Ganguly: add termios.tcgetwinsize(),
  9221. termios.tcsetwinsize().
  9222. - bpo-40497: :meth:`subprocess.check_output` now raises :exc:`ValueError`
  9223. when the invalid keyword argument *check* is passed by user code.
  9224. Previously such use would fail later with a :exc:`TypeError`. Patch by
  9225. Rémi Lapeyre.
  9226. - bpo-37449: ``ensurepip`` now uses ``importlib.resources.files()``
  9227. traversable APIs
  9228. - bpo-40956: Use Argument Clinic in :mod:`sqlite3`. Patches by Erlend E.
  9229. Aasland.
  9230. - bpo-41730: ``DeprecationWarning`` is now raised when importing
  9231. :mod:`tkinter.tix`, which has been deprecated in documentation since
  9232. Python 3.6.
  9233. - bpo-20684: Remove unused ``_signature_get_bound_param`` function from
  9234. :mod:`inspect` - by Anthony Sottile.
  9235. - bpo-41402: Fix :meth:`email.message.EmailMessage.set_content` when called
  9236. with binary data and ``7bit`` content transfer encoding.
  9237. - bpo-32695: The *compresslevel* and *preset* keyword arguments of
  9238. :func:`tarfile.open` are now both documented and tested.
  9239. - bpo-41137: Use utf-8 encoding while reading .pdbrc files. Patch by
  9240. Srinivas Reddy Thatiparthy
  9241. - bpo-24391: Improved reprs of :mod:`threading` synchronization objects:
  9242. :class:`~threading.Semaphore`, :class:`~threading.BoundedSemaphore`,
  9243. :class:`~threading.Event` and :class:`~threading.Barrier`.
  9244. - bpo-5846: Deprecated the following :mod:`unittest` functions, scheduled
  9245. for removal in Python 3.13:
  9246. * :func:`~unittest.findTestCases`
  9247. * :func:`~unittest.makeSuite`
  9248. * :func:`~unittest.getTestCaseNames`
  9249. Use :class:`~unittest.TestLoader` methods instead:
  9250. * :meth:`unittest.TestLoader.loadTestsFromModule`
  9251. * :meth:`unittest.TestLoader.loadTestsFromTestCase`
  9252. * :meth:`unittest.TestLoader.getTestCaseNames`
  9253. Patch by Erlend E. Aasland.
  9254. - bpo-40563: Support pathlike objects on dbm/shelve. Patch by Hakan Çelik
  9255. and Henry-Joseph Audéoud.
  9256. - bpo-34990: Fixed a Y2k38 bug in the compileall module where it would fail
  9257. to compile files with a modification time after the year 2038.
  9258. - bpo-39549: Whereas the code for reprlib.Repr had previously used a
  9259. hardcoded string value of '...', this PR updates it to use of a
  9260. “fillvalue” attribute, whose value defaults to '...' and can be reset in
  9261. either individual reprlib.Repr instances or in subclasses thereof.
  9262. - bpo-37022: :mod:`pdb` now displays exceptions from ``repr()`` with its
  9263. ``p`` and ``pp`` commands.
  9264. - bpo-38840: Fix ``test___all__`` on platforms lacking a shared memory
  9265. implementation.
  9266. - bpo-39359: Add one missing check that the password is a bytes object for
  9267. an encrypted zipfile.
  9268. - bpo-38741: :mod:`configparser`: using ']' inside a section header will no
  9269. longer cut the section name short at the ']'
  9270. - bpo-38415: Added missing behavior to
  9271. :func:`contextlib.asynccontextmanager` to match
  9272. :func:`contextlib.contextmanager` so decorated functions can themselves be
  9273. decorators.
  9274. - bpo-30256: Pass multiprocessing BaseProxy argument ``manager_owned``
  9275. through AutoProxy.
  9276. - bpo-27513: :func:`email.utils.getaddresses` now accepts
  9277. :class:`email.header.Header` objects along with string values. Patch by
  9278. Zackery Spytz.
  9279. - bpo-16379: Add SQLite error code and name to :mod:`sqlite3` exceptions.
  9280. Patch by Aviv Palivoda, Daniel Shahaf, and Erlend E. Aasland.
  9281. - bpo-26228: pty.spawn no longer hangs on FreeBSD, macOS, and Solaris.
  9282. - bpo-33349: lib2to3 now recognizes async generators everywhere.
  9283. - bpo-29298: Fix ``TypeError`` when required subparsers without ``dest`` do
  9284. not receive arguments. Patch by Anthony Sottile.
  9285. Documentation
  9286. -------------
  9287. - bpo-45216: Remove extra documentation listing methods in ``difflib``. It
  9288. was rendering twice in pydoc and was outdated in some places.
  9289. - bpo-45024: :mod:`collections.abc` documentation has been expanded to
  9290. explicitly cover how instance and subclass checks work, with additional
  9291. doctest examples and an exhaustive list of ABCs which test membership
  9292. purely by presence of the right :term:`special method`\s. Patch by Raymond
  9293. Hettinger.
  9294. - bpo-44957: Promote PEP 604 union syntax by using it where possible. Also,
  9295. mention ``X | Y`` more prominently in section about ``Union`` and mention
  9296. ``X | None`` at all in section about ``Optional``.
  9297. - bpo-16580: Added code equivalents for the :meth:`int.to_bytes` and
  9298. :meth:`int.from_bytes` methods, as well as tests ensuring that these code
  9299. equivalents are valid.
  9300. - bpo-44903: Removed the ``othergui.rst`` file, any references to it, and
  9301. the list of GUI frameworks in the FAQ. In their place I've added links to
  9302. the Python Wiki `page on GUI frameworks
  9303. <https://wiki.python.org/moin/GuiProgramming>`_.
  9304. - bpo-33479: Tkinter documentation has been greatly expanded with new
  9305. "Architecture" and "Threading model" sections.
  9306. - bpo-36700: :mod:`base64` RFC references were updated to point to
  9307. :rfc:`4648`; a section was added to point users to the new "security
  9308. considerations" section of the RFC.
  9309. - bpo-44740: Replaced occurrences of uppercase "Web" and "Internet" with
  9310. lowercase versions per the 2016 revised Associated Press Style Book.
  9311. - bpo-44693: Update the definition of __future__ in the glossary by
  9312. replacing the confusing word "pseudo-module" with a more accurate
  9313. description.
  9314. - bpo-35183: Add typical examples to os.path.splitext docs
  9315. - bpo-30511: Clarify that :func:`shutil.make_archive` is not thread-safe due
  9316. to reliance on changing the current working directory.
  9317. - bpo-44561: Update of three expired hyperlinks in
  9318. Doc/distributing/index.rst: "Project structure", "Building and packaging
  9319. the project", and "Uploading the project to the Python Packaging Index".
  9320. - bpo-44651: Delete entry "coercion" in Doc/glossary.rst for its outdated
  9321. definition.
  9322. - bpo-42958: Updated the docstring and docs of :func:`filecmp.cmp` to be
  9323. more accurate and less confusing especially in respect to *shallow* arg.
  9324. - bpo-44631: Refactored the ``repr()`` code of the ``_Environ`` (os module).
  9325. - bpo-44613: importlib.metadata is no longer provisional.
  9326. - bpo-44558: Match the docstring and python implementation of
  9327. :func:`~operator.countOf` to the behavior of its c implementation.
  9328. - bpo-44544: List all kwargs for :func:`textwrap.wrap`,
  9329. :func:`textwrap.fill`, and :func:`textwrap.shorten`. Now, there are nav
  9330. links to attributes of :class:`TextWrap`, which makes navigation much
  9331. easier while minimizing duplication in the documentation.
  9332. - bpo-38062: Clarify that atexit uses equality comparisons internally.
  9333. - bpo-40620: Convert examples in tutorial controlflow.rst section 4.3 to be
  9334. interpreter-demo style.
  9335. - bpo-43066: Added a warning to :mod:`zipfile` docs: filename arg with a
  9336. leading slash may cause archive to be un-openable on Windows systems.
  9337. - bpo-39452: Rewrote ``Doc/library/__main__.rst``. Broadened scope of the
  9338. document to explicitly discuss and differentiate between ``__main__.py``
  9339. in packages versus the ``__name__ == '__main__'`` expression (and the
  9340. idioms that surround it).
  9341. - bpo-13814: In the Design FAQ, answer "Why don't generators support the
  9342. with statement?"
  9343. - bpo-27752: Documentation of csv.Dialect is more descriptive.
  9344. - bpo-44453: Fix documentation for the return type of
  9345. :func:`sysconfig.get_path`.
  9346. - bpo-44392: Added a new section in the C API documentation for types used
  9347. in type hinting. Documented ``Py_GenericAlias`` and
  9348. ``Py_GenericAliasType``.
  9349. - bpo-38291: Mark ``typing.io`` and ``typing.re`` as deprecated since Python
  9350. 3.8 in the documentation. They were never properly supported by type
  9351. checkers.
  9352. - bpo-44322: Document that SyntaxError args have a details tuple and that
  9353. details are adjusted for errors in f-string field replacement expressions.
  9354. - bpo-42392: Document the deprecation and removal of the ``loop`` parameter
  9355. for many functions and classes in :mod:`asyncio`.
  9356. - bpo-44195: Corrected references to ``TraversableResources`` in docs. There
  9357. is no ``TraversableReader``.
  9358. - bpo-41963: Document that ``ConfigParser`` strips off comments when reading
  9359. configuration files.
  9360. - bpo-44072: Correct where in the numeric ABC hierarchy ``**`` support is
  9361. added, i.e., in numbers.Complex, not numbers.Integral.
  9362. - bpo-43558: Add the remark to :mod:`dataclasses` documentation that the
  9363. :meth:`__init__` of any base class has to be called in
  9364. :meth:`__post_init__`, along with a code example.
  9365. - bpo-44025: Clarify when '_' in match statements is a keyword, and when
  9366. not.
  9367. - bpo-41706: Fix docs about how methods like ``__add__`` are invoked when
  9368. evaluating operator expressions.
  9369. - bpo-41621: Document that :class:`collections.defaultdict` parameter
  9370. ``default_factory`` defaults to None and is positional-only.
  9371. - bpo-41576: document BaseException in favor of bare except
  9372. - bpo-21760: The description for __file__ fixed. Patch by Furkan Onder
  9373. - bpo-39498: Add a "Security Considerations" index which links to standard
  9374. library modules that have explicitly documented security considerations.
  9375. - bpo-33479: Remove the unqualified claim that tkinter is threadsafe. It has
  9376. not been true for several years and likely never was. An explanation of
  9377. what is true may be added later, after more discussion, and possibly after
  9378. patching _tkinter.c,
  9379. Tests
  9380. -----
  9381. - bpo-40173: Fix :func:`test.support.import_helper.import_fresh_module`.
  9382. - bpo-45280: Add a test case for empty :class:`typing.NamedTuple`.
  9383. - bpo-45269: Cover case when invalid ``markers`` type is supplied to
  9384. ``c_make_encoder``.
  9385. - bpo-45128: Fix ``test_multiprocessing_fork`` failure due to
  9386. ``test_logging`` and ``sys.modules`` manipulation.
  9387. - bpo-45209: Fix ``UserWarning: resource_tracker`` warning in
  9388. ``_test_multiprocessing._TestSharedMemory.test_shared_memory_cleaned_after_process_termination``
  9389. - bpo-45185: Enables ``TestEnumerations`` test cases in ``test_ssl`` suite.
  9390. - bpo-45195: Fix test_readline.test_nonascii(): sometimes, the newline
  9391. character is not written at the end, so don't expect it in the output.
  9392. Patch by Victor Stinner.
  9393. - bpo-45156: Fixes infinite loop on :func:`unittest.mock.seal` of mocks
  9394. created by :func:`~unittest.create_autospec`.
  9395. - bpo-45125: Improves pickling tests and docs of ``SharedMemory`` and
  9396. ``SharableList`` objects.
  9397. - bpo-44860: Update ``test_sysconfig.test_user_similar()`` for the
  9398. posix_user scheme: ``platlib`` doesn't use :data:`sys.platlibdir`. Patch
  9399. by Victor Stinner.
  9400. - bpo-45052: ``WithProcessesTestSharedMemory.test_shared_memory_basics``
  9401. test was ignored, because ``self.assertEqual(sms.size, sms2.size)`` line
  9402. was failing. It is now removed and test is unskipped.
  9403. The main motivation for this line to be removed from the test is that the
  9404. ``size`` of ``SharedMemory`` is not ever guaranteed to be the same. It is
  9405. decided by the platform.
  9406. - bpo-44895: libregrtest now clears the type cache later to reduce the risk
  9407. of false alarm when checking for reference leaks. Previously, the type
  9408. cache was cleared too early and libregrtest raised a false alarm about
  9409. reference leaks under very specific conditions. Patch by Irit Katriel and
  9410. Victor Stinner.
  9411. - bpo-45042: Fixes that test classes decorated with
  9412. ``@hashlib_helper.requires_hashdigest`` were skipped all the time.
  9413. - bpo-25130: Add calls of :func:`gc.collect` in tests to support PyPy.
  9414. - bpo-45011: Made tests relying on the :mod:`_asyncio` C extension module
  9415. optional to allow running on alternative Python implementations. Patch by
  9416. Serhiy Storchaka.
  9417. - bpo-44949: Fix auto history tests of test_readline: sometimes, the newline
  9418. character is not written at the end, so don't expect it in the output.
  9419. - bpo-44891: Tests were added to clarify :func:`id` is preserved when ``obj
  9420. * 1`` is used on :class:`str` and :class:`bytes` objects. Patch by Nikita
  9421. Sobolev.
  9422. - bpo-44852: Add ability to wholesale silence DeprecationWarnings while
  9423. running the regression test suite.
  9424. - bpo-40928: Notify users running test_decimal regression tests on macOS of
  9425. potential harmless "malloc can't allocate region" messages spewed by
  9426. test_decimal.
  9427. - bpo-44734: Fixed floating point precision issue in turtle tests.
  9428. - bpo-44708: Regression tests, when run with -w, are now re-running only the
  9429. affected test methods instead of re-running the entire test file.
  9430. - bpo-42095: Added interop tests for Apple plists: generate plist files with
  9431. Python plistlib and parse with Apple plutil; and the other way round.
  9432. - bpo-44647: Added a permanent Unicode-valued environment variable to
  9433. regression tests to ensure they handle this use case in the future. If
  9434. your test environment breaks because of that, report a bug to us, and
  9435. temporarily set PYTHONREGRTEST_UNICODE_GUARD=0 in your test environment.
  9436. - bpo-44515: Adjust recently added contextlib tests to avoid assuming the
  9437. use of a refcounted GC
  9438. - bpo-44287: Fix asyncio test_popen() of test_windows_utils by using a
  9439. longer timeout. Use military grade battle-tested
  9440. :data:`test.support.SHORT_TIMEOUT` timeout rather than a hardcoded timeout
  9441. of 10 seconds: it's 30 seconds by default, but it is made longer on slow
  9442. buildbots. Patch by Victor Stinner.
  9443. - bpo-44451: Reset ``DeprecationWarning`` filters in
  9444. ``test.test_importlib.test_metadata_api.APITests.test_entry_points_by_index``
  9445. to avoid ``StopIteration`` error if ``DeprecationWarnings`` are ignored.
  9446. - bpo-44363: Account for address sanitizer in test_capi. test_capi now
  9447. passes when run GCC address sanitizer.
  9448. - bpo-44364: Add non integral tests for :func:`math.sqrt` function.
  9449. - bpo-43921: Fix test_ssl.test_wrong_cert_tls13(): use
  9450. ``suppress_ragged_eofs=False``, since ``read()`` can raise
  9451. :exc:`ssl.SSLEOFError` on Windows. Patch by Victor Stinner.
  9452. - bpo-43921: Fix test_pha_required_nocert() of test_ssl: catch two more EOF
  9453. cases (when the ``recv()`` method returns an empty string). Patch by
  9454. Victor Stinner.
  9455. - bpo-44131: Add test_frozenmain to test_embed to test the
  9456. :c:func:`Py_FrozenMain` C function. Patch by Victor Stinner.
  9457. - bpo-31904: Ignore error string case in test_file_not_exists().
  9458. - bpo-42083: Add test to check that ``PyStructSequence_NewType`` accepts a
  9459. ``PyStructSequence_Desc`` with ``doc`` field set to ``NULL``.
  9460. - bpo-35753: Fix crash in doctest when doctest parses modules that include
  9461. unwrappable functions by skipping those functions.
  9462. - bpo-30256: Add test for nested queues when using ``multiprocessing``
  9463. shared objects ``AutoProxy[Queue]`` inside ``ListProxy`` and ``DictProxy``
  9464. Build
  9465. -----
  9466. - bpo-45220: Avoid building with the Windows 11 SDK previews automatically.
  9467. This may be overridden by setting the ``DefaultWindowsSDKVersion``
  9468. environment variable before building.
  9469. - bpo-45020: Freeze stdlib modules that are imported during startup. This
  9470. provides significant performance improvements to startup. If necessary,
  9471. use the previously added "-X frozen_modules=off" commandline option to
  9472. force importing the source modules.
  9473. - bpo-45188: Windows builds now regenerate frozen modules as the first part
  9474. of the build. Previously the regeneration was later in the build, which
  9475. would require it to be restarted if any modules had changed.
  9476. - bpo-45163: Fixes Haiku platform build.
  9477. - bpo-45067: The ncurses function extended_color_content was introduced in
  9478. 2017
  9479. (https://invisible-island.net/ncurses/NEWS.html#index-t20170401). The
  9480. ncurses-devel package in CentOS 7 had a older version ncurses resulted in
  9481. compilation error. For compiling ncurses with extended color support, we
  9482. verify the version of the ncurses library >= 20170401.
  9483. - bpo-45019: Generate lines in relevant files for frozen modules. Up until
  9484. now each of the files had to be edited manually. This change makes it
  9485. easier to add to and modify the frozen modules.
  9486. - bpo-44340: Add support for building with clang thin lto via
  9487. --with-lto=thin/full. Patch by Donghee Na and Brett Holman.
  9488. - bpo-44535: Enable building using a Visual Studio 2022 install on Windows.
  9489. - bpo-43298: Improved error message when building without a Windows SDK
  9490. installed.
  9491. - bpo-44381: The Windows build now accepts :envvar:`EnableControlFlowGuard`
  9492. set to ``guard`` to enable CFG.
  9493. - bpo-41282: Fix broken ``make install`` that caused standard library
  9494. extension modules to be unnecessarily and incorrectly rebuilt during the
  9495. install phase of cpython.
  9496. Windows
  9497. -------
  9498. - bpo-45375: Fixes an assertion failure due to searching for the standard
  9499. library in unnormalised paths.
  9500. - bpo-45022: Update Windows release to include libffi 3.4.2
  9501. - bpo-45007: Update to OpenSSL 1.1.1l in Windows build
  9502. - bpo-44848: Upgrade Windows installer to use SQLite 3.36.0.
  9503. - bpo-44572: Avoid consuming standard input in the :mod:`platform` module
  9504. - bpo-44582: Accelerate speed of :mod:`mimetypes` initialization using a
  9505. native implementation of the registry scan.
  9506. - bpo-41299: Fix 16 milliseconds jitter when using timeouts in
  9507. :mod:`threading`, such as with :meth:`threading.Lock.acquire` or
  9508. :meth:`threading.Condition.wait`.
  9509. - bpo-42686: Build :mod:`sqlite3` with math functions enabled. Patch by
  9510. Erlend E. Aasland.
  9511. - bpo-40263: This is a follow-on bug from
  9512. https://bugs.python.org/issue26903. Once that is applied we run into an
  9513. off-by-one assertion problem. The assert was not correct.
  9514. macOS
  9515. -----
  9516. - bpo-45007: Update macOS installer builds to use OpenSSL 1.1.1l.
  9517. - bpo-34602: When building CPython on macOS with ``./configure
  9518. --with-undefined-behavior-sanitizer --with-pydebug``, the stack size is
  9519. now quadrupled to allow for the entire test suite to pass.
  9520. - bpo-44848: Update macOS installer to use SQLite 3.36.0.
  9521. - bpo-44689: :meth:`ctypes.util.find_library` now works correctly on macOS
  9522. 11 Big Sur even if Python is built on an older version of macOS.
  9523. Previously, when built on older macOS systems, ``find_library`` was not
  9524. able to find macOS system libraries when running on Big Sur due to
  9525. changes in how system libraries are stored.
  9526. - bpo-41972: The framework build's user header path in sysconfig is changed
  9527. to add a 'pythonX.Y' component to match distutils's behavior.
  9528. - bpo-43109: Allow --with-lto configure option to work with Apple-supplied
  9529. Xcode or Command Line Tools.
  9530. - bpo-34932: Add socket.TCP_KEEPALIVE support for macOS. Patch by Shane
  9531. Harvey.
  9532. IDLE
  9533. ----
  9534. - bpo-45296: On Windows, change exit/quit message to suggest Ctrl-D, which
  9535. works, instead of <Ctrl-Z Return>, which does not work in IDLE.
  9536. - bpo-45193: Make completion boxes appear on Ubuntu again.
  9537. - bpo-40128: Mostly fix completions on macOS when not using tcl/tk 8.6.11
  9538. (as with 3.9). The added update_idletask call should be harmless and
  9539. possibly helpful otherwise.
  9540. - bpo-33962: Move the indent space setting from the Font tab to the new
  9541. Windows tab. Patch by Mark Roseman and Terry Jan Reedy.
  9542. - bpo-40468: Split the settings dialog General tab into Windows and Shell/ED
  9543. tabs. Move help sources, which extend the Help menu, to the Extensions
  9544. tab. Make space for new options and shorten the dialog. The latter makes
  9545. the dialog better fit small screens.
  9546. - bpo-41611: Avoid uncaught exceptions in
  9547. ``AutoCompleteWindow.winconfig_event()``.
  9548. - bpo-41611: Fix IDLE sometimes freezing upon tab-completion on macOS.
  9549. - bpo-44010: Highlight the new :ref:`match <match>` statement's :ref:`soft
  9550. keywords <soft-keywords>`: :keyword:`match`, :keyword:`case <match>`, and
  9551. :keyword:`_ <wildcard-patterns>`. However, this highlighting is not
  9552. perfect and will be incorrect in some rare cases, including some ``_``-s
  9553. in ``case`` patterns.
  9554. - bpo-44026: Include interpreter's typo fix suggestions in message line for
  9555. NameErrors and AttributeErrors. Patch by E. Paine.
  9556. Tools/Demos
  9557. -----------
  9558. - bpo-44786: Fix a warning in regular expression in the c-analyzer script.
  9559. - bpo-44967: pydoc now returns a non-zero status code when a module cannot
  9560. be found.
  9561. - bpo-44978: Allow the Argument Clinic tool to handle ``__complex__``
  9562. special methods.
  9563. - bpo-43425: Removed the 'test2to3' demo project that demonstrated using
  9564. lib2to3 to support Python 2.x and Python 3.x from a single source in a
  9565. distutils package. Patch by Donghee Na
  9566. - bpo-44074: Make patchcheck automatically detect the correct base branch
  9567. name (previously it was hardcoded to 'master')
  9568. - bpo-20291: Added support for variadic positional parameters in Argument
  9569. Clinic.
  9570. C API
  9571. -----
  9572. - bpo-41710: The PyThread_acquire_lock_timed() function now clamps the
  9573. timeout if it is too large, rather than aborting the process. Patch by
  9574. Victor Stinner.
  9575. - bpo-44687: :meth:`BufferedReader.peek` no longer raises :exc:`ValueError`
  9576. when the entire file has already been buffered.
  9577. - bpo-45116: Add the :c:macro:`Py_ALWAYS_INLINE` macro to ask the compiler
  9578. to always inline a static inline function. The compiler can ignore it and
  9579. decides to not inline the function. Patch by Victor Stinner.
  9580. - bpo-45094: Add the :c:macro:`Py_NO_INLINE` macro to disable inlining on a
  9581. function. Patch by Victor Stinner.
  9582. - bpo-45061: Add a deallocator to the :class:`bool` type to detect refcount
  9583. bugs in C extensions which call ``Py_DECREF(Py_True);`` or
  9584. ``Py_DECREF(Py_False);`` by mistake. Patch by Victor Stinner.
  9585. - bpo-42035: Add a new :c:func:`PyType_GetQualName` function to get type's
  9586. qualified name.
  9587. - bpo-41103: Reverts removal of the old buffer protocol because they are
  9588. part of stable ABI.
  9589. - bpo-44751: Remove ``crypt.h`` include from the public ``Python.h`` header.
  9590. - bpo-42747: The ``Py_TPFLAGS_HAVE_VERSION_TAG`` type flag now does nothing.
  9591. The ``Py_TPFLAGS_HAVE_AM_SEND`` flag (which was added in 3.10) is removed.
  9592. Both were unnecessary because it is not possible to have type objects with
  9593. the relevant fields missing.
  9594. - bpo-44530: Added the ``co_qualname`` to the ``PyCodeObject`` structure to
  9595. propagate the qualified name from the compiler to code objects.
  9596. Patch by Gabriele N. Tornetta
  9597. - bpo-44441: :c:func:`Py_RunMain` now resets :c:data:`PyImport_Inittab` to
  9598. its initial value at exit. It must be possible to call
  9599. :c:func:`PyImport_AppendInittab` or :c:func:`PyImport_ExtendInittab` at
  9600. each Python initialization. Patch by Victor Stinner.
  9601. - bpo-39947: Remove 4 private trashcan C API functions which were only kept
  9602. for the backward compatibility of the stable ABI with Python 3.8 and
  9603. older, since the trashcan API was not usable with the limited C API on
  9604. Python 3.8 and older. The trashcan API was excluded from the limited C API
  9605. in Python 3.9.
  9606. Removed functions:
  9607. * _PyTrash_deposit_object()
  9608. * _PyTrash_destroy_chain()
  9609. * _PyTrash_thread_deposit_object()
  9610. * _PyTrash_thread_destroy_chain()
  9611. The trashcan C API was never usable with the limited C API, since old
  9612. trashcan macros accessed directly :c:type:`PyThreadState` members like
  9613. ``_tstate->trash_delete_nesting``, whereas the :c:type:`PyThreadState`
  9614. structure is opaque in the limited C API.
  9615. Exclude also the ``PyTrash_UNWIND_LEVEL`` constant from the C API.
  9616. Patch by Victor Stinner.
  9617. - bpo-40939: Removed documentation for the removed ``PyParser_*`` C API.
  9618. - bpo-43795: The list in :ref:`limited-api-list` now shows the public name
  9619. :c:struct:`PyFrameObject` rather than ``_frame``. The non-existing entry
  9620. ``_node`` no longer appears in the list.
  9621. - bpo-44378: :c:func:`Py_IS_TYPE` no longer uses :c:func:`Py_TYPE` to avoid
  9622. a compiler warning: no longer cast ``const PyObject*`` to ``PyObject*``.
  9623. Patch by Victor Stinner.
  9624. - bpo-39573: Convert the :c:func:`Py_TYPE` and :c:func:`Py_SIZE` macros to
  9625. static inline functions. The :c:func:`Py_SET_TYPE` and
  9626. :c:func:`Py_SET_SIZE` functions must now be used to set an object type and
  9627. size. Patch by Victor Stinner.
  9628. - bpo-44263: The :c:func:`PyType_Ready` function now raises an error if a
  9629. type is defined with the :c:macro:`Py_TPFLAGS_HAVE_GC` flag set but has no
  9630. traverse function (:c:member:`PyTypeObject.tp_traverse`). Patch by Victor
  9631. Stinner.
  9632. - bpo-43795: The undocumented function :c:func:`Py_FrozenMain` is removed
  9633. from the Limited API.
  9634. - bpo-44113: Deprecate the following functions to configure the Python
  9635. initialization:
  9636. * :c:func:`!PySys_AddWarnOptionUnicode`
  9637. * :c:func:`!PySys_AddWarnOption`
  9638. * :c:func:`!PySys_AddXOption`
  9639. * :c:func:`!PySys_HasWarnOptions`
  9640. * :c:func:`!Py_SetPath`
  9641. * :c:func:`!Py_SetProgramName`
  9642. * :c:func:`!Py_SetPythonHome`
  9643. * :c:func:`!Py_SetStandardStreamEncoding`
  9644. * :c:func:`!_Py_SetProgramFullPath`
  9645. Use the new :c:type:`PyConfig` API of the :ref:`Python Initialization
  9646. Configuration <init-config>` instead (:pep:`587`).
  9647. - bpo-44094: Remove ``PyErr_SetFromErrnoWithUnicodeFilename()``,
  9648. ``PyErr_SetFromWindowsErrWithUnicodeFilename()``, and
  9649. ``PyErr_SetExcFromWindowsErrWithUnicodeFilename()``. They are not
  9650. documented and have been deprecated since Python 3.3.
  9651. - bpo-43795: :c:func:`PyCodec_Unregister` is now properly exported as a
  9652. function in the Windows Stable ABI DLL.
  9653. - bpo-44029: Remove deprecated ``Py_UNICODE`` APIs: ``PyUnicode_Encode``,
  9654. ``PyUnicode_EncodeUTF7``, ``PyUnicode_EncodeUTF8``,
  9655. ``PyUnicode_EncodeUTF16``, ``PyUnicode_EncodeUTF32``,
  9656. ``PyUnicode_EncodeLatin1``, ``PyUnicode_EncodeMBCS``,
  9657. ``PyUnicode_EncodeDecimal``, ``PyUnicode_EncodeRawUnicodeEscape``,
  9658. ``PyUnicode_EncodeCharmap``, ``PyUnicode_EncodeUnicodeEscape``,
  9659. ``PyUnicode_TransformDecimalToASCII``, ``PyUnicode_TranslateCharmap``,
  9660. ``PyUnicodeEncodeError_Create``, ``PyUnicodeTranslateError_Create``. See
  9661. :pep:`393` and :pep:`624` for reference.
  9662. - bpo-42035: Add a new :c:func:`PyType_GetName` function to get type's short
  9663. name.
  9664. What's New in Python 3.10.0 beta 1?
  9665. ===================================
  9666. *Release date: 2021-05-03*
  9667. Security
  9668. --------
  9669. - bpo-43434: Creating :class:`sqlite3.Connection` objects now also produces
  9670. ``sqlite3.connect`` and ``sqlite3.connect/handle`` :ref:`auditing events
  9671. <auditing>`. Previously these events were only produced by
  9672. :func:`sqlite3.connect` calls. Patch by Erlend E. Aasland.
  9673. - bpo-43998: The :mod:`ssl` module sets more secure cipher suites defaults.
  9674. Ciphers without forward secrecy and with SHA-1 MAC are disabled by
  9675. default. Security level 2 prohibits weak RSA, DH, and ECC keys with less
  9676. than 112 bits of security. :class:`~ssl.SSLContext` defaults to minimum
  9677. protocol version TLS 1.2. Settings are based on Hynek Schlawack's
  9678. research.
  9679. - bpo-43882: The presence of newline or tab characters in parts of a URL
  9680. could allow some forms of attacks.
  9681. Following the controlling specification for URLs defined by WHATWG
  9682. :func:`urllib.parse` now removes ASCII newlines and tabs from URLs,
  9683. preventing such attacks.
  9684. - bpo-43472: Ensures interpreter-level audit hooks receive the
  9685. ``cpython.PyInterpreterState_New`` event when called through the
  9686. ``_xxsubinterpreters`` module.
  9687. - bpo-43362: Fix invalid free in _sha3 module. The issue was introduced in
  9688. 3.10.0a1. Python 3.9 and earlier are not affected.
  9689. - bpo-43762: Add audit events for :func:`sqlite3.connect/handle`,
  9690. :meth:`sqlite3.Connection.enable_load_extension`, and
  9691. :meth:`sqlite3.Connection.load_extension`. Patch by Erlend E. Aasland.
  9692. - bpo-43756: Add new audit event ``glob.glob/2`` to incorporate the new
  9693. *root_dir* and *dir_fd* arguments added to :func:`glob.glob` and
  9694. :func:`glob.iglob`.
  9695. - bpo-36384: :mod:`ipaddress` module no longer accepts any leading zeros in
  9696. IPv4 address strings. Leading zeros are ambiguous and interpreted as octal
  9697. notation by some libraries. For example the legacy function
  9698. :func:`socket.inet_aton` treats leading zeros as octal notation. glibc
  9699. implementation of modern :func:`~socket.inet_pton` does not accept any
  9700. leading zeros. For a while the :mod:`ipaddress` module used to accept
  9701. ambiguous leading zeros.
  9702. - bpo-43075: Fix Regular Expression Denial of Service (ReDoS) vulnerability
  9703. in :class:`urllib.request.AbstractBasicAuthHandler`. The ReDoS-vulnerable
  9704. regex has quadratic worst-case complexity and it allows cause a denial of
  9705. service when identifying crafted invalid RFCs. This ReDoS issue is on the
  9706. client side and needs remote attackers to control the HTTP server.
  9707. - bpo-42800: Audit hooks are now fired for frame.f_code, traceback.tb_frame,
  9708. and generator code/frame attribute access.
  9709. - bpo-37363: Add audit events to the :mod:`http.client` module.
  9710. Core and Builtins
  9711. -----------------
  9712. - bpo-43977: Prevent classes being both a sequence and a mapping when
  9713. pattern matching.
  9714. - bpo-43977: Use :c:member:`~PyTypeObject.tp_flags` on the class object to
  9715. determine if the subject is a sequence or mapping when pattern matching.
  9716. Avoids the need to import :mod:`collections.abc` when pattern matching.
  9717. - bpo-43892: Restore proper validation of complex literal value patterns
  9718. when parsing :keyword:`!match` blocks.
  9719. - bpo-43933: Set frame.f_lineno to the line number of the 'with' kweyword
  9720. when executing the call to ``__exit__``.
  9721. - bpo-43933: If the current position in a frame has no line number then set
  9722. the f_lineno attribute to None, instead of -1, to conform to PEP 626. This
  9723. should not normally be possible, but might occur in some unusual
  9724. circumstances.
  9725. - bpo-43963: Importing the :mod:`_signal` module in a subinterpreter has no
  9726. longer side effects.
  9727. - bpo-42739: The internal representation of line number tables is changed to
  9728. not use sentinels, and an explicit length parameter is added to the out of
  9729. process API function ``PyLineTable_InitAddressRange``. This makes the
  9730. handling of line number tables more robust in some circumstances.
  9731. - bpo-43908: Make :mod:`re` types immutable. Patch by Erlend E. Aasland.
  9732. - bpo-43908: Make the :class:`array.array` type immutable. Patch by Erlend
  9733. E. Aasland.
  9734. - bpo-43901: Change class and module objects to lazy-create empty
  9735. annotations dicts on demand. The annotations dicts are stored in the
  9736. object's __dict__ for backwards compatibility.
  9737. - bpo-43892: Match patterns now use new dedicated AST nodes (``MatchValue``,
  9738. ``MatchSingleton``, ``MatchSequence``, ``MatchStar``, ``MatchMapping``,
  9739. ``MatchClass``) rather than reusing expression AST nodes. ``MatchAs`` and
  9740. ``MatchOr`` are now defined as pattern nodes rather than as expression
  9741. nodes. Patch by Nick Coghlan.
  9742. - bpo-42725: Usage of ``await``/``yield``/``yield from`` and named
  9743. expressions within an annotation is now forbidden when PEP 563 is
  9744. activated.
  9745. - bpo-43754: When performing structural pattern matching (:pep:`634`),
  9746. captured names are now left unbound until the *entire* pattern has matched
  9747. successfully.
  9748. - bpo-42737: Annotations for complex targets (everything beside simple
  9749. names) no longer cause any runtime effects with ``from __future__ import
  9750. annotations``.
  9751. - bpo-43914: :exc:`SyntaxError` exceptions raised by the interpreter will
  9752. highlight the full error range of the expression that consistutes the
  9753. syntax error itself, instead of just where the problem is detected. Patch
  9754. by Pablo Galindo.
  9755. - bpo-38605: Revert making ``from __future__ import annotations`` the
  9756. default. This follows the Steering Council decision to postpone PEP 563
  9757. changes to at least Python 3.11. See the original email for more
  9758. information regarding the decision:
  9759. https://mail.python.org/archives/list/python-dev@python.org/thread/CLVXXPQ2T2LQ5MP2Y53VVQFCXYWQJHKZ/.
  9760. Patch by Pablo Galindo.
  9761. - bpo-43475: Hashes of NaN values now depend on object identity. Formerly,
  9762. they always hashed to 0 even though NaN values are not equal to one
  9763. another. Having the same hash for unequal values caused pile-ups in hash
  9764. tables.
  9765. - bpo-43859: Improve the error message for :exc:`IndentationError`
  9766. exceptions. Patch by Pablo Galindo
  9767. - bpo-41323: Constant tuple folding in bytecode optimizer now reuses tuple
  9768. in constant table.
  9769. - bpo-43846: Data stack usage is much reduced for large literal and call
  9770. expressions.
  9771. - bpo-38530: When printing :exc:`NameError` raised by the interpreter,
  9772. :c:func:`PyErr_Display` will offer suggestions of similar variable names
  9773. in the function that the exception was raised from. Patch by Pablo Galindo
  9774. - bpo-43823: Improve syntax errors for invalid dictionary literals. Patch by
  9775. Pablo Galindo.
  9776. - bpo-43822: Improve syntax errors in the parser for missing commas between
  9777. expressions. Patch by Pablo Galindo.
  9778. - bpo-43798: :class:`ast.alias` nodes now include source location metadata
  9779. attributes e.g. lineno, col_offset.
  9780. - bpo-43797: Improve ``SyntaxError`` error messages for invalid comparisons.
  9781. Patch by Pablo Galindo.
  9782. - bpo-43760: Move the flag for checking whether tracing is enabled to the C
  9783. stack, from the heap. Should speed up dispatch in the interpreter.
  9784. - bpo-43682: Static methods (:func:`@staticmethod <staticmethod>`) and class
  9785. methods (:func:`@classmethod <classmethod>`) now inherit the method
  9786. attributes (``__module__``, ``__name__``, ``__qualname__``, ``__doc__``,
  9787. ``__annotations__``) and have a new ``__wrapped__`` attribute. Patch by
  9788. Victor Stinner.
  9789. - bpo-43751: Fixed a bug where ``anext(ait, default)`` would erroneously
  9790. return None.
  9791. - bpo-42128: :data:`~object.__match_args__` is no longer allowed to be a
  9792. list.
  9793. - bpo-43683: Add GEN_START opcode. Marks start of generator, including
  9794. async, or coroutine and handles sending values to a newly created
  9795. generator or coroutine.
  9796. - bpo-43105: Importlib now resolves relative paths when creating module spec
  9797. objects from file locations.
  9798. - bpo-43682: Static methods (:func:`@staticmethod <staticmethod>`) are now
  9799. callable as regular functions. Patch by Victor Stinner.
  9800. - bpo-42609: Prevented crashes in the AST validator and optimizer when
  9801. compiling some absurdly long expressions like ``"+0"*1000000``.
  9802. :exc:`RecursionError` is now raised instead.
  9803. - bpo-38530: When printing :exc:`AttributeError`, :c:func:`PyErr_Display`
  9804. will offer suggestions of similar attribute names in the object that the
  9805. exception was raised from. Patch by Pablo Galindo
  9806. Library
  9807. -------
  9808. - bpo-44015: In @dataclass(), raise a TypeError if KW_ONLY is specified more
  9809. than once.
  9810. - bpo-25478: Added a *total()* method to collections.Counter() to compute
  9811. the sum of the counts.
  9812. - bpo-43733: Change :class:`netrc.netrc` to use UTF-8 encoding before using
  9813. locale encoding.
  9814. - bpo-43979: Removed an unnecessary list comprehension before looping from
  9815. :func:`urllib.parse.parse_qsl`. Patch by Christoph Zwerschke and Donghee
  9816. Na.
  9817. - bpo-43993: Update bundled pip to 21.1.1.
  9818. - bpo-43957: [Enum] Deprecate ``TypeError`` when non-member is used in a
  9819. containment check; In 3.12 ``True`` or ``False`` will be returned instead,
  9820. and containment will return ``True`` if the value is either a member of
  9821. that enum or one of its members' value.
  9822. - bpo-42904: For backwards compatibility with previous minor versions of
  9823. Python, if :func:`typing.get_type_hints` receives no namespace dictionary
  9824. arguments, :func:`typing.get_type_hints` will search through the global
  9825. then local namespaces during evaluation of stringized type annotations
  9826. (string forward references) inside a class.
  9827. - bpo-43945: [Enum] Deprecate non-standard mixin format() behavior: in 3.12
  9828. the enum member, not the member's value, will be used for format() calls.
  9829. - bpo-41139: Deprecate undocumented ``cgi.log()`` API.
  9830. - bpo-43937: Fixed the :mod:`turtle` module working with non-default root
  9831. window.
  9832. - bpo-43930: Update bundled pip to 21.1 and setuptools to 56.0.0
  9833. - bpo-43907: Fix a bug in the pure-Python pickle implementation when using
  9834. protocol 5, where bytearray instances that occur several time in the
  9835. pickled object graph would incorrectly unpickle into repeated copies of
  9836. the bytearray object.
  9837. - bpo-43926: In ``importlib.metadata``, provide a uniform interface to
  9838. ``Description``, allow for any field to be encoded with multiline values,
  9839. remove continuation lines from multiline values, and add a ``.json``
  9840. property for easy access to the PEP 566 JSON-compatible form. Sync with
  9841. ``importlib_metadata 4.0``.
  9842. - bpo-43920: OpenSSL 3.0.0: :meth:`~ssl.SSLContext.load_verify_locations`
  9843. now returns a consistent error message when cadata contains no valid
  9844. certificate.
  9845. - bpo-43607: :mod:`urllib` can now convert Windows paths with ``\\?\``
  9846. prefixes into URL paths.
  9847. - bpo-43817: Add :func:`inspect.get_annotations`, which safely computes the
  9848. annotations defined on an object. It works around the quirks of accessing
  9849. the annotations from various types of objects, and makes very few
  9850. assumptions about the object passed in. :func:`inspect.get_annotations`
  9851. can also correctly un-stringize stringized annotations.
  9852. :func:`inspect.signature`, :func:`inspect.from_callable`, and
  9853. :func:`inspect.from_function` now call :func:`inspect.get_annotations` to
  9854. retrieve annotations. This means :func:`inspect.signature` and
  9855. :func:`inspect.from_callable` can now un-stringize stringized annotations,
  9856. too.
  9857. - bpo-43284: platform.win32_ver derives the windows version from
  9858. sys.getwindowsversion().platform_version which in turn derives the version
  9859. from kernel32.dll (which can be of a different version than Windows
  9860. itself). Therefore change the platform.win32_ver to determine the version
  9861. using the platform module's _syscmd_ver private function to return an
  9862. accurate version.
  9863. - bpo-42854: The :mod:`ssl` module now uses ``SSL_read_ex`` and
  9864. ``SSL_write_ex`` internally. The functions support reading and writing of
  9865. data larger than 2 GB. Writing zero-length data no longer fails with a
  9866. protocol violation error.
  9867. - bpo-42333: Port ``_ssl`` extension module to multiphase initialization.
  9868. - bpo-43880: :mod:`ssl` now raises DeprecationWarning for OP_NO_SSL/TLS*
  9869. options, old TLS versions, old protocols, and other features that have
  9870. been deprecated since Python 3.6, 3.7, or OpenSSL 1.1.0.
  9871. - bpo-41559: :pep:`612` is now implemented purely in Python; builtin
  9872. ``types.GenericAlias`` objects no longer include ``typing.ParamSpec`` in
  9873. ``__parameters__`` (with the exception of ``collections.abc.Callable``\ 's
  9874. ``GenericAlias``). This means previously invalid uses of ``ParamSpec``
  9875. (such as ``list[P]``) which worked in earlier versions of Python 3.10
  9876. alpha, will now raise ``TypeError`` during substitution.
  9877. - bpo-43867: The :mod:`multiprocessing` ``Server`` class now explicitly
  9878. catches :exc:`SystemExit` and closes the client connection in this case.
  9879. It happens when the ``Server.serve_client()`` method reaches the end of
  9880. file (EOF).
  9881. - bpo-40443: Remove unused imports: pyclbr no longer uses copy, and typing
  9882. no longer uses ast. Patch by Victor Stinner.
  9883. - bpo-43820: Remove an unneeded copy of the namespace passed to
  9884. dataclasses.make_dataclass().
  9885. - bpo-43787: Add ``__iter__()`` method to :class:`bz2.BZ2File`,
  9886. :class:`gzip.GzipFile`, and :class:`lzma.LZMAFile`. It makes iterating
  9887. them about 2x faster. Patch by Inada Naoki.
  9888. - bpo-43680: Deprecate io.OpenWrapper and _pyio.OpenWrapper: use io.open and
  9889. _pyio.open instead. Until Python 3.9, _pyio.open was not a static method
  9890. and builtins.open was set to OpenWrapper to not become a bound method when
  9891. set to a class variable. _io.open is a built-in function whereas
  9892. _pyio.open is a Python function. In Python 3.10, _pyio.open() is now a
  9893. static method, and builtins.open() is now io.open().
  9894. - bpo-43680: The Python :func:`_pyio.open` function becomes a static method
  9895. to behave as :func:`io.open` built-in function: don't become a bound
  9896. method when stored as a class variable. It becomes possible since static
  9897. methods are now callable in Python 3.10. Moreover,
  9898. :func:`_pyio.OpenWrapper` becomes a simple alias to :func:`_pyio.open`.
  9899. Patch by Victor Stinner.
  9900. - bpo-41515: Fix :exc:`KeyError` raised in :func:`typing.get_type_hints` due
  9901. to synthetic modules that don't appear in ``sys.modules``.
  9902. - bpo-43776: When :class:`subprocess.Popen` args are provided as a string or
  9903. as :class:`pathlib.Path`, the Popen instance repr now shows the right
  9904. thing.
  9905. - bpo-42248: [Enum] ensure exceptions raised in ``_missing__`` are released
  9906. - bpo-43744: fix issue with enum member name matching the start of a private
  9907. variable name
  9908. - bpo-43772: Fixed the return value of ``TypeVar.__ror__``. Patch by Jelle
  9909. Zijlstra.
  9910. - bpo-43764: Add match_args parameter to @dataclass decorator to allow
  9911. suppression of __match_args__ generation.
  9912. - bpo-43799: OpenSSL 3.0.0: define ``OPENSSL_API_COMPAT`` 1.1.1 to suppress
  9913. deprecation warnings. Python requires OpenSSL 1.1.1 APIs.
  9914. - bpo-43478: Mocks can no longer be used as the specs for other Mocks. As a
  9915. result, an already-mocked object cannot have an attribute mocked using
  9916. ``autospec=True`` or be the subject of a ``create_autospec(...)`` call.
  9917. This can uncover bugs in tests since these Mock-derived Mocks will always
  9918. pass certain tests (e.g. :func:`isinstance`) and builtin assert functions
  9919. (e.g. assert_called_once_with) will unconditionally pass.
  9920. - bpo-43794: Add :const:`ssl.OP_IGNORE_UNEXPECTED_EOF` constants (OpenSSL
  9921. 3.0.0)
  9922. - bpo-43785: Improve ``bz2.BZ2File`` performance by removing the RLock from
  9923. BZ2File. This makes BZ2File thread unsafe in the face of multiple
  9924. simultaneous readers or writers, just like its equivalent classes in
  9925. :mod:`gzip` and :mod:`lzma` have always been. Patch by Inada Naoki.
  9926. - bpo-43789: OpenSSL 3.0.0: Don't call the password callback function a
  9927. second time when first call has signaled an error condition.
  9928. - bpo-43788: The header files for :mod:`ssl` error codes are now OpenSSL
  9929. version-specific. Exceptions will now show correct reason and library
  9930. codes. The ``make_ssl_data.py`` script has been rewritten to use OpenSSL's
  9931. text file with error codes.
  9932. - bpo-43766: Implement :pep:`647` in the :mod:`typing` module by adding
  9933. :data:`TypeGuard`.
  9934. - bpo-25264: :func:`os.path.realpath` now accepts a *strict* keyword-only
  9935. argument. When set to ``True``, :exc:`OSError` is raised if a path doesn't
  9936. exist or a symlink loop is encountered.
  9937. - bpo-43780: In ``importlib.metadata``, incorporate changes from
  9938. importlib_metadata 3.10: Add mtime-based caching during distribution
  9939. discovery. Flagged use of dict result from ``entry_points()`` as
  9940. deprecated.
  9941. - The ``P.args`` and ``P.kwargs`` attributes of :class:`typing.ParamSpec`
  9942. are now instances of the new classes :class:`typing.ParamSpecArgs` and
  9943. :class:`typing.ParamSpecKwargs`, which enables a more useful ``repr()``.
  9944. Patch by Jelle Zijlstra.
  9945. - bpo-43731: Add an ``encoding`` parameter :func:`logging.fileConfig()`.
  9946. - bpo-43712: Add ``encoding`` and ``errors`` parameters to
  9947. :func:`fileinput.input` and :class:`fileinput.FileInput`.
  9948. - bpo-38659: A ``simple_enum`` decorator is added to the ``enum`` module to
  9949. convert a normal class into an Enum. ``test_simple_enum`` added to test
  9950. simple enums against a corresponding normal Enum. Standard library
  9951. modules updated to use ``simple_enum``.
  9952. - bpo-43764: Fix an issue where :data:`~object.__match_args__` generation
  9953. could fail for some :mod:`dataclasses`.
  9954. - bpo-43752: Fix :mod:`sqlite3` regression for zero-sized blobs with
  9955. converters, where ``b""`` was returned instead of ``None``. The regression
  9956. was introduced by PR 24723. Patch by Erlend E. Aasland.
  9957. - bpo-43655: :mod:`tkinter` dialog windows are now recognized as dialogs by
  9958. window managers on macOS and X Window.
  9959. - bpo-43723: The following ``threading`` methods are now deprecated and
  9960. should be replaced:
  9961. - ``currentThread`` => :func:`threading.current_thread`
  9962. - ``activeCount`` => :func:`threading.active_count`
  9963. - ``Condition.notifyAll`` => :meth:`threading.Condition.notify_all`
  9964. - ``Event.isSet`` => :meth:`threading.Event.is_set`
  9965. - ``Thread.setName`` => :attr:`threading.Thread.name`
  9966. - ``thread.getName`` => :attr:`threading.Thread.name`
  9967. - ``Thread.isDaemon`` => :attr:`threading.Thread.daemon`
  9968. - ``Thread.setDaemon`` => :attr:`threading.Thread.daemon`
  9969. Patch by Jelle Zijlstra.
  9970. - bpo-2135: Deprecate find_module() and find_loader() implementations in
  9971. importlib and zipimport.
  9972. - bpo-43534: :func:`turtle.textinput` and :func:`turtle.numinput` create now
  9973. a transient window working on behalf of the canvas window.
  9974. - bpo-43532: Add the ability to specify keyword-only fields to dataclasses.
  9975. These fields will become keyword-only arguments to the generated __init__.
  9976. - bpo-43522: Fix problem with
  9977. :attr:`~ssl.SSLContext.hostname_checks_common_name`. OpenSSL does not copy
  9978. hostflags from *struct SSL_CTX* to *struct SSL*.
  9979. - bpo-8978: Improve error message for :func:`tarfile.open` when :mod:`lzma`
  9980. / :mod:`bz2` are unavailable. Patch by Anthony Sottile.
  9981. - bpo-42967: Allow :class:`bytes` ``separator`` argument in
  9982. ``urllib.parse.parse_qs`` and ``urllib.parse.parse_qsl`` when parsing
  9983. :class:`str` query strings. Previously, this raised a ``TypeError``.
  9984. - bpo-43296: Improve :mod:`sqlite3` error handling: ``sqlite3_value_blob()``
  9985. errors that set ``SQLITE_NOMEM`` now raise :exc:`MemoryError`. Patch by
  9986. Erlend E. Aasland.
  9987. - bpo-43312: New functions :func:`sysconfig.get_preferred_scheme` and
  9988. :func:`sysconfig.get_default_scheme` are added to query a platform for its
  9989. preferred "user", "home", and "prefix" (default) scheme names.
  9990. - bpo-43265: Improve :meth:`sqlite3.Connection.backup` error handling. The
  9991. error message for non-existent target database names is now ``unknown
  9992. database <database name>`` instead of ``SQL logic error``. Patch by Erlend
  9993. E. Aasland.
  9994. - bpo-41282: Install schemes in ``distutils.command.install`` are now loaded
  9995. from :mod:`sysconfig`.
  9996. - bpo-41282: ``distutils.sysconfig`` has been merged to :mod:`sysconfig`.
  9997. - bpo-43176: Fixed processing of a dataclass that inherits from a frozen
  9998. dataclass with no fields. It is now correctly detected as an error.
  9999. - bpo-43080: :mod:`pprint` now has support for
  10000. :class:`dataclasses.dataclass`. Patch by Lewis Gaul.
  10001. - bpo-39950: Add ``pathlib.Path.hardlink_to()`` method that supersedes
  10002. ``link_to()``. The new method has the same argument order as
  10003. ``symlink_to()``.
  10004. - bpo-42904: :func:`typing.get_type_hints` now checks the local namespace of
  10005. a class when evaluating :pep:`563` annotations inside said class.
  10006. - bpo-42269: Add ``slots`` parameter to ``dataclasses.dataclass`` decorator
  10007. to automatically generate ``__slots__`` for class. Patch provided by Yurii
  10008. Karabas.
  10009. - bpo-39529: Deprecated use of :func:`asyncio.get_event_loop` without
  10010. running event loop. Emit deprecation warning for :mod:`asyncio` functions
  10011. which implicitly create a :class:`~asyncio.Future` or
  10012. :class:`~asyncio.Task` objects if there is no running event loop and no
  10013. explicit *loop* argument is passed: :func:`~asyncio.ensure_future`,
  10014. :func:`~asyncio.wrap_future`, :func:`~asyncio.gather`,
  10015. :func:`~asyncio.shield`, :func:`~asyncio.as_completed` and constructors of
  10016. :class:`~asyncio.Future`, :class:`~asyncio.Task`,
  10017. :class:`~asyncio.StreamReader`, :class:`~asyncio.StreamReaderProtocol`.
  10018. - bpo-18369: Certificate and PrivateKey classes were added to the ssl
  10019. module. Certificates and keys can now be loaded from memory buffer, too.
  10020. - bpo-41486: Use a new output buffer management code for :mod:`bz2` /
  10021. :mod:`lzma` / :mod:`zlib` modules, and add ``.readall()`` function to
  10022. ``_compression.DecompressReader`` class. These bring some performance
  10023. improvements. Patch by Ma Lin.
  10024. - bpo-31870: The :func:`ssl.get_server_certificate` function now has a
  10025. *timeout* parameter.
  10026. - bpo-41735: Fix thread locks in zlib module may go wrong in rare case.
  10027. Patch by Ma Lin.
  10028. - bpo-36470: Fix dataclasses with ``InitVar``\s and
  10029. :func:`~dataclasses.replace()`. Patch by Claudiu Popa.
  10030. - bpo-40849: Expose X509_V_FLAG_PARTIAL_CHAIN ssl flag
  10031. - bpo-35114: :func:`ssl.RAND_status` now returns a boolean value (as
  10032. documented) instead of ``1`` or ``0``.
  10033. - bpo-39906: :meth:`pathlib.Path.stat` and :meth:`~pathlib.Path.chmod` now
  10034. accept a *follow_symlinks* keyword-only argument for consistency with
  10035. corresponding functions in the :mod:`os` module.
  10036. - bpo-39899: :func:`os.path.expanduser()` now refuses to guess Windows home
  10037. directories if the basename of current user's home directory does not
  10038. match their username.
  10039. :meth:`pathlib.Path.expanduser()` and :meth:`~pathlib.Path.home()` now
  10040. consistently raise :exc:`RuntimeError` exception when a home directory
  10041. cannot be resolved. Previously a :exc:`KeyError` exception could be raised
  10042. on Windows when the ``"USERNAME"`` environment variable was unset.
  10043. - bpo-36076: Added SNI support to :func:`ssl.get_server_certificate`.
  10044. - bpo-38490: Covariance, Pearson's correlation, and simple linear regression
  10045. functionality was added to statistics module. Patch by Tymoteusz Wołodźko.
  10046. - bpo-33731: Provide a locale.localize() function, which converts a
  10047. normalized number string into a locale format.
  10048. - bpo-32745: Fix a regression in the handling of ctypes'
  10049. :data:`ctypes.c_wchar_p` type: embedded null characters would cause a
  10050. :exc:`ValueError` to be raised. Patch by Zackery Spytz.
  10051. Documentation
  10052. -------------
  10053. - bpo-43987: Add "Annotations Best Practices" document as a new HOWTO.
  10054. - bpo-43977: Document the new :c:macro:`Py_TPFLAGS_MAPPING` and
  10055. :c:macro:`Py_TPFLAGS_SEQUENCE` type flags.
  10056. - bpo-43959: The documentation on the PyContextVar C-API was clarified.
  10057. - bpo-43938: Update dataclasses documentation to express that
  10058. FrozenInstanceError is derived from AttributeError.
  10059. - bpo-43778: Fix the Sphinx glossary_search extension: create the _static/
  10060. sub-directory if it doesn't exist.
  10061. - bpo-43755: Update documentation to reflect that unparenthesized lambda
  10062. expressions can no longer be the expression part in an ``if`` clause in
  10063. comprehensions and generator expressions since Python 3.9.
  10064. - bpo-43739: Fixing the example code in Doc/extending/extending.rst to
  10065. declare and initialize the pmodule variable to be of the right type.
  10066. Tests
  10067. -----
  10068. - bpo-43961: Fix test_logging.test_namer_rotator_inheritance() on Windows:
  10069. use :func:`os.replace` rather than :func:`os.rename`. Patch by Victor
  10070. Stinner.
  10071. - bpo-43842: Fix a race condition in the SMTP test of test_logging. Don't
  10072. close a file descriptor (socket) from a different thread while
  10073. asyncore.loop() is polling the file descriptor. Patch by Victor Stinner.
  10074. - bpo-43843: :mod:`test.libregrtest` now marks a test as ENV_CHANGED
  10075. (altered the execution environment) if a thread raises an exception but
  10076. does not catch it. It sets a hook on :func:`threading.excepthook`. Use
  10077. ``--fail-env-changed`` option to mark the test as failed. Patch by Victor
  10078. Stinner.
  10079. - bpo-43811: Tests multiple OpenSSL versions on GitHub Actions. Use ccache
  10080. to speed up testing.
  10081. - bpo-43791: OpenSSL 3.0.0: Disable testing of legacy protocols TLS 1.0 and
  10082. 1.1. Tests are failing with TLSV1_ALERT_INTERNAL_ERROR.
  10083. Build
  10084. -----
  10085. - bpo-43567: Improved generated code refresh (AST/tokens/opcodes/keywords)
  10086. on Windows.
  10087. - bpo-43669: Implement :pep:`644`. Python now requires OpenSSL 1.1.1 or
  10088. newer.
  10089. Windows
  10090. -------
  10091. - bpo-35306: Adds additional arguments to :func:`os.startfile` function.
  10092. - bpo-43538: Avoid raising errors from :meth:`pathlib.Path.exists()` when
  10093. passed an invalid filename.
  10094. - bpo-38822: Fixed :func:`os.stat` failing on inaccessible directories with
  10095. a trailing slash, rather than falling back to the parent directory's
  10096. metadata. This implicitly affected :func:`os.path.exists` and
  10097. :func:`os.path.isdir`.
  10098. - bpo-26227: Fixed decoding of host names in :func:`socket.gethostbyaddr`
  10099. and :func:`socket.gethostbyname_ex`.
  10100. - bpo-40432: Updated pegen regeneration script on Windows to find and use
  10101. Python 3.8 or higher. Prior to this, pegen regeneration already required
  10102. 3.8 or higher, but the script may have used lower versions of Python.
  10103. - bpo-43745: Actually updates Windows release to OpenSSL 1.1.1k. Earlier
  10104. releases were mislabelled and actually included 1.1.1i again.
  10105. - bpo-43652: Update Tcl and Tk to 8.6.11 in Windows installer.
  10106. - bpo-43492: Upgrade Windows installer to use SQLite 3.35.5.
  10107. - bpo-30555: Fix ``WindowsConsoleIO`` errors in the presence of fd
  10108. redirection. Patch by Segev Finer.
  10109. macOS
  10110. -----
  10111. - bpo-42119: Fix check for macOS SDK paths when building Python. Narrow
  10112. search to match contents of SDKs, namely only files in
  10113. ``/System/Library``, ``/System/IOSSupport``, and ``/usr`` other than
  10114. ``/usr/local``. Previously, anything under ``/System`` was assumed to be
  10115. in an SDK which causes problems with the new file system layout in 10.15+
  10116. where user file systems may appear to be mounted under ``/System``. Paths
  10117. in ``/Library`` were also incorrectly treated as SDK locations.
  10118. - bpo-43568: Drop support for MACOSX_DEPLOYMENT_TARGET < 10.3
  10119. - bpo-44009: Provide "python3.x-intel64" executable to allow reliably
  10120. forcing macOS universal2 framework builds to run under Rosetta 2 Intel-64
  10121. emulation on Apple Silicon Macs. This can be useful for testing or when
  10122. universal2 wheels are not yet available.
  10123. - bpo-43851: Build SQLite with ``SQLITE_OMIT_AUTOINIT`` on macOS. Patch by
  10124. Erlend E. Aasland.
  10125. - bpo-43492: Update macOS installer to use SQLite 3.35.4.
  10126. - bpo-42235: ``Mac/BuildScript/build-installer.py`` will now use
  10127. "--enable-optimizations" and ``--with-lto`` when building on macOS 10.15
  10128. or later.
  10129. IDLE
  10130. ----
  10131. - bpo-37903: Add mouse actions to the shell sidebar. Left click and
  10132. optional drag selects one or more lines, as with the editor line number
  10133. sidebar. Right click after selecting raises a context menu with 'copy
  10134. with prompts'. This zips together prompts from the sidebar with lines
  10135. from the selected text.
  10136. - bpo-43981: Fix reference leak in test_sidebar and test_squeezer. Patches
  10137. by Terry Jan Reedy and Pablo Galindo
  10138. - bpo-37892: Indent IDLE Shell input with spaces instead of tabs
  10139. - bpo-43655: IDLE dialog windows are now recognized as dialogs by window
  10140. managers on macOS and X Window.
  10141. - bpo-37903: IDLE's shell now shows prompts in a separate side-bar.
  10142. C API
  10143. -----
  10144. - bpo-43916: Add a new :c:macro:`Py_TPFLAGS_DISALLOW_INSTANTIATION` type
  10145. flag to disallow creating type instances. Patch by Victor Stinner.
  10146. - bpo-43774: Remove the now unused ``PYMALLOC_DEBUG`` macro. Debug hooks on
  10147. memory allocators are now installed by default if Python is built in debug
  10148. mode (if ``Py_DEBUG`` macro is defined). Moreover, they can now be used on
  10149. Python build in release mode (ex: using ``PYTHONMALLOC=debug`` environment
  10150. variable).
  10151. - bpo-43962: _PyInterpreterState_IDIncref() now calls
  10152. _PyInterpreterState_IDInitref() and always increments id_refcount.
  10153. Previously, calling _xxsubinterpreters.get_current() could create an
  10154. id_refcount inconsistency when a _xxsubinterpreters.InterpreterID object
  10155. was deallocated. Patch by Victor Stinner.
  10156. - bpo-28254: Add new C-API functions to control the state of the garbage
  10157. collector: :c:func:`PyGC_Enable()`, :c:func:`PyGC_Disable()`,
  10158. :c:func:`PyGC_IsEnabled()`, corresponding to the functions in the
  10159. :mod:`gc` module.
  10160. - bpo-43908: Introduce :c:macro:`Py_TPFLAGS_IMMUTABLETYPE` flag for
  10161. immutable type objects, and modify :c:func:`PyType_Ready` to set it for
  10162. static types. Patch by Erlend E. Aasland.
  10163. - bpo-43795: :c:func:`PyMem_Calloc` is now available in the limited C API
  10164. (``Py_LIMITED_API``).
  10165. - bpo-43868: :c:func:`PyOS_ReadlineFunctionPointer` is no longer exported by
  10166. limited C API headers and by ``python3.dll`` on Windows. Like any function
  10167. that takes ``FILE*``, it is not part of the stable ABI.
  10168. - bpo-43795: Stable ABI and limited API definitions are generated from a
  10169. central manifest (:pep:`652`).
  10170. - bpo-43753: Add the :c:func:`Py_Is(x, y) <Py_Is>` function to test if the
  10171. *x* object is the *y* object, the same as ``x is y`` in Python. Add also
  10172. the :c:func:`Py_IsNone`, :c:func:`Py_IsTrue`, :c:func:`Py_IsFalse`
  10173. functions to test if an object is, respectively, the ``None`` singleton,
  10174. the ``True`` singleton or the ``False`` singleton. Patch by Victor
  10175. Stinner.
  10176. What's New in Python 3.10.0 alpha 7?
  10177. ====================================
  10178. *Release date: 2021-04-05*
  10179. Security
  10180. --------
  10181. - bpo-42988: CVE-2021-3426: Remove the ``getfile`` feature of the
  10182. :mod:`pydoc` module which could be abused to read arbitrary files on the
  10183. disk (directory traversal vulnerability). Moreover, even source code of
  10184. Python modules can contain sensitive data like passwords. Vulnerability
  10185. reported by David Schwörer.
  10186. - bpo-43285: :mod:`ftplib` no longer trusts the IP address value returned
  10187. from the server in response to the PASV command by default. This prevents
  10188. a malicious FTP server from using the response to probe IPv4 address and
  10189. port combinations on the client network.
  10190. Code that requires the former vulnerable behavior may set a
  10191. ``trust_server_pasv_ipv4_address`` attribute on their :class:`ftplib.FTP`
  10192. instances to ``True`` to re-enable it.
  10193. - bpo-43439: Add audit hooks for :func:`gc.get_objects`,
  10194. :func:`gc.get_referrers` and :func:`gc.get_referents`. Patch by Pablo
  10195. Galindo.
  10196. Core and Builtins
  10197. -----------------
  10198. - bpo-27129: Update CPython bytecode magic number.
  10199. - bpo-43672: Raise ImportWarning when calling find_loader().
  10200. - bpo-43660: Fix crash that happens when replacing ``sys.stderr`` with a
  10201. callable that can remove the object while an exception is being printed.
  10202. Patch by Pablo Galindo.
  10203. - bpo-27129: The bytecode interpreter uses instruction, rather byte, offsets
  10204. internally. This reduces the number of EXTENDED_ARG instructions needed
  10205. and streamlines instruction dispatch a bit.
  10206. - bpo-40645: Fix reference leak in the :mod:`_hashopenssl` extension. Patch
  10207. by Pablo Galindo.
  10208. - bpo-42134: Calls to find_module() by the import system now raise
  10209. ImportWarning.
  10210. - bpo-41064: Improve the syntax error for invalid usage of double starred
  10211. elements ('**') in f-strings. Patch by Pablo Galindo.
  10212. - bpo-43575: Speed up calls to ``map()`` by using the :pep:`590`
  10213. ``vectorcall`` calling convention. Patch by Donghee Na.
  10214. - bpo-42137: The import system now prefers using ``__spec__`` for
  10215. ``ModuleType.__repr__`` over ``module_repr()``.
  10216. - bpo-43452: Added micro-optimizations to ``_PyType_Lookup()`` to improve
  10217. cache lookup performance in the common case of cache hits.
  10218. - bpo-43555: Report the column offset for :exc:`SyntaxError` for invalid
  10219. line continuation characters. Patch by Pablo Galindo.
  10220. - bpo-43517: Fix misdetection of circular imports when using ``from pkg.mod
  10221. import attr``, which caused false positives in non-trivial multi-threaded
  10222. code.
  10223. - bpo-43497: Emit SyntaxWarnings for assertions with tuple constants, this
  10224. is a regression introduced in python3.7
  10225. - bpo-39316: Tracing now has correct line numbers for attribute accesses
  10226. when the attribute is on a different line from the object. Improves
  10227. debugging and profiling for multi-line method chains.
  10228. - bpo-35883: Python no longer fails at startup with a fatal error if a
  10229. command line argument contains an invalid Unicode character. The
  10230. :c:func:`Py_DecodeLocale` function now escapes byte sequences which would
  10231. be decoded as Unicode characters outside the [U+0000; U+10ffff] range.
  10232. - bpo-43410: Fix a bug that was causing the parser to crash when emitting
  10233. syntax errors when reading input from stdin. Patch by Pablo Galindo
  10234. - bpo-43406: Fix a possible race condition where ``PyErr_CheckSignals``
  10235. tries to execute a non-Python signal handler.
  10236. - bpo-42128: Add ``__match_args__`` to :ref:`struct sequence objects
  10237. <struct-sequence-objects>`. Patch by Pablo Galindo.
  10238. - bpo-43390: CPython now sets the ``SA_ONSTACK`` flag in ``PyOS_setsig`` for
  10239. the VM's default signal handlers. This is friendlier to other in-process
  10240. code that an extension module or embedding use could pull in (such as
  10241. Golang's cgo) where tiny thread stacks are the norm and ``sigaltstack()``
  10242. has been used to provide for signal handlers. This is a no-op change for
  10243. the vast majority of processes that don't use sigaltstack.
  10244. - bpo-43287: Speed up calls to ``filter()`` by using the :pep:`590`
  10245. ``vectorcall`` calling convention. Patch by Donghee Na.
  10246. - bpo-37448: Add a radix tree based memory map to track in-use obmalloc
  10247. arenas. Use to replace the old implementation of address_in_range(). The
  10248. radix tree approach makes it easy to increase pool sizes beyond the OS
  10249. page size. Boosting the pool and arena size allows obmalloc to handle a
  10250. significantly higher percentage of requests from its ultra-fast paths.
  10251. It also has the advantage of eliminating the memory unsanitary behavior of
  10252. the previous address_in_range(). The old address_in_range() was marked
  10253. with the annotations _Py_NO_SANITIZE_ADDRESS, _Py_NO_SANITIZE_THREAD, and
  10254. _Py_NO_SANITIZE_MEMORY. Those annotations are no longer needed.
  10255. To disable the radix tree map, set a preprocessor flag as follows:
  10256. ``-DWITH_PYMALLOC_RADIX_TREE=0``.
  10257. Co-authored-by: Tim Peters <tim.peters@gmail.com>
  10258. - bpo-29988: Only handle asynchronous exceptions and requests to drop the
  10259. GIL when returning from a call or on the back edges of loops. Makes sure
  10260. that :meth:`~object.__exit__` is always called in with statements, even
  10261. for interrupts.
  10262. Library
  10263. -------
  10264. - bpo-43720: Document various stdlib deprecations in imp, pkgutil, and
  10265. importlib.util for removal in Python 3.12.
  10266. - bpo-43433: :class:`xmlrpc.client.ServerProxy` no longer ignores query and
  10267. fragment in the URL of the server.
  10268. - bpo-31956: The :meth:`~array.array.index` method of :class:`array.array`
  10269. now has optional *start* and *stop* parameters.
  10270. - bpo-40066: Enum: adjust ``repr()`` to show only enum and member name (not
  10271. value, nor angle brackets) and ``str()`` to show only member name. Update
  10272. and improve documentation to match.
  10273. - bpo-42136: Deprecate all module_repr() methods found in importlib as their
  10274. use is being phased out by Python 3.12.
  10275. - bpo-35930: Raising an exception raised in a "future" instance will create
  10276. reference cycles.
  10277. - bpo-41369: Finish updating the vendored libmpdec to version 2.5.1. Patch
  10278. by Stefan Krah.
  10279. - bpo-43422: Revert the _decimal C API which was added in bpo-41324.
  10280. - bpo-43577: Fix deadlock when using :class:`ssl.SSLContext` debug callback
  10281. with :meth:`ssl.SSLContext.sni_callback`.
  10282. - bpo-43571: It's now possible to create MPTCP sockets with IPPROTO_MPTCP
  10283. - bpo-43542: ``image/heic`` and ``image/heif`` were added to
  10284. :mod:`mimetypes`.
  10285. - bpo-40645: The :mod:`hmac` module now uses OpenSSL's HMAC implementation
  10286. when digestmod argument is a hash name or builtin hash function.
  10287. - bpo-43510: Implement :pep:`597`: Add ``EncodingWarning`` warning, ``-X
  10288. warn_default_encoding`` option, :envvar:`PYTHONWARNDEFAULTENCODING`
  10289. environment variable and ``encoding="locale"`` argument value.
  10290. - bpo-43521: ``ast.unparse`` can now render NaNs and empty sets.
  10291. - bpo-42914: :func:`pprint.pprint` gains a new boolean
  10292. ``underscore_numbers`` optional argument to emit integers with thousands
  10293. separated by an underscore character for improved readability (for example
  10294. ``1_000_000`` instead of ``1000000``).
  10295. - bpo-41361: :meth:`~collections.deque.rotate` calls are now slightly faster
  10296. due to faster argument parsing.
  10297. - bpo-43423: :func:`subprocess.communicate` no longer raises an IndexError
  10298. when there is an empty stdout or stderr IO buffer during a timeout on
  10299. Windows.
  10300. - bpo-27820: Fixed long-standing bug of smtplib.SMTP where doing AUTH LOGIN
  10301. with initial_response_ok=False will fail.
  10302. The cause is that SMTP.auth_login _always_ returns a password if provided
  10303. with a challenge string, thus non-compliant with the standard for AUTH
  10304. LOGIN.
  10305. Also fixes bug with the test for smtpd.
  10306. - bpo-43445: Add frozen modules to :data:`sys.stdlib_module_names`. For
  10307. example, add ``"_frozen_importlib"`` and ``"_frozen_importlib_external"``
  10308. names.
  10309. - bpo-43245: Add keyword arguments support to ``ChainMap.new_child()``.
  10310. - bpo-29982: Add optional parameter *ignore_cleanup_errors* to
  10311. :func:`tempfile.TemporaryDirectory` and allow multiple :func:`cleanup`
  10312. attempts. Contributed by C.A.M. Gerlach.
  10313. - bpo-43428: Include changes from `importlib_metadata 3.7
  10314. <https://importlib-metadata.readthedocs.io/en/latest/history.html#v3-7-0>`_:
  10315. Performance enhancements to distribution discovery.
  10316. ``entry_points`` only returns unique distributions.
  10317. Introduces new ``EntryPoints`` object for containing a set of entry points
  10318. with convenience methods for selecting entry points by group or name.
  10319. ``entry_points`` now returns this object if selection parameters are
  10320. supplied but continues to return a dict object for compatibility. Users
  10321. are encouraged to rely on the selection interface. The dict object result
  10322. is likely to be deprecated in the future.
  10323. Added packages_distributions function to return a mapping of packages to
  10324. the distributions that provide them.
  10325. - bpo-43332: Improves the networking efficiency of :mod:`http.client` when
  10326. using a proxy via :meth:`~HTTPConnection.set_tunnel`. Fewer small send
  10327. calls are made during connection setup.
  10328. - bpo-43420: Improve performance of :class:`fractions.Fraction` arithmetics
  10329. for large components. Contributed by Sergey B. Kirpichev.
  10330. - bpo-43356: Allow passing a signal number to ``_thread.interrupt_main()``.
  10331. - bpo-43399: Fix ``ElementTree.extend`` not working on iterators when using
  10332. the Python implementation
  10333. - bpo-43369: Improve :mod:`sqlite3` error handling: If
  10334. ``sqlite3_column_text()`` and ``sqlite3_column_blob()`` set
  10335. ``SQLITE_NOMEM``, :exc:`MemoryError` is now raised. Patch by Erlend E.
  10336. Aasland.
  10337. - bpo-43368: Fix a regression introduced in PR 24562, where an empty
  10338. bytestring was fetched as ``None`` instead of ``b''`` in :mod:`sqlite3`.
  10339. Patch by Mariusz Felisiak.
  10340. - bpo-41282: Fixed stacklevel of ``DeprecationWarning`` emitted from
  10341. ``import distutils``.
  10342. - bpo-42129: ``importlib.resources`` now honors namespace packages, merging
  10343. resources from each location in the namespace as introduced in
  10344. ``importlib_resources`` 3.2 and including incidental changes through
  10345. 5.0.3.
  10346. - bpo-43295: :meth:`datetime.datetime.strptime` now raises ``ValueError``
  10347. instead of ``IndexError`` when matching ``'z'`` with the ``%z`` format
  10348. specifier.
  10349. - bpo-43125: Return empty string if base64mime.body_encode receive empty
  10350. bytes
  10351. - bpo-43084: :func:`curses.window.enclose` returns now ``True`` or ``False``
  10352. (as was documented) instead of ``1`` or ``0``.
  10353. - bpo-42994: Add MIME types for opus, AAC, 3gpp and 3gpp2
  10354. - bpo-14678: Add an invalidate_caches() method to the zipimport.zipimporter
  10355. class to support importlib.invalidate_caches(). Patch by Desmond Cheong.
  10356. - bpo-42782: Fail fast in :func:`shutil.move()` to avoid creating
  10357. destination directories on failure.
  10358. - bpo-40066: Enum's ``repr()`` and ``str()`` have changed: ``repr()`` is now
  10359. *EnumClass.MemberName* and ``str()`` is *MemberName*. Additionally,
  10360. stdlib Enum's whose contents are available as module attributes, such as
  10361. ``RegexFlag.IGNORECASE``, have their ``repr()`` as *module.name*, e.g.
  10362. ``re.IGNORECASE``.
  10363. - bpo-26053: Fixed bug where the :mod:`pdb` interactive run command echoed
  10364. the args from the shell command line, even if those have been overridden
  10365. at the pdb prompt.
  10366. - bpo-24160: Fixed bug where breakpoints did not persist across multiple
  10367. debugger sessions in :mod:`pdb`'s interactive mode.
  10368. - bpo-40701: When the :data:`tempfile.tempdir` global variable is set to a
  10369. value of type bytes, it is now handled consistently. Previously
  10370. exceptions could be raised from some tempfile APIs when the directory did
  10371. not already exist in this situation. Also ensures that the
  10372. :func:`tempfile.gettempdir()` and :func:`tempfile.gettempdirb()` functions
  10373. *always* return ``str`` and ``bytes`` respectively.
  10374. - bpo-39342: Expose ``X509_V_FLAG_ALLOW_PROXY_CERTS`` as
  10375. :const:`~ssl.VERIFY_ALLOW_PROXY_CERTS` to allow proxy certificate
  10376. validation as explained in
  10377. https://www.openssl.org/docs/man1.1.1/man7/proxy-certificates.html.
  10378. - bpo-31861: Add builtins.aiter and builtins.anext. Patch by Joshua Bronson
  10379. (@jab), Daniel Pope (@lordmauve), and Justin Wang (@justin39).
  10380. Documentation
  10381. -------------
  10382. - bpo-43199: Answer "Why is there no goto?" in the Design and History FAQ.
  10383. - bpo-43407: Clarified that a result from :func:`time.monotonic`,
  10384. :func:`time.perf_counter`, :func:`time.process_time`, or
  10385. :func:`time.thread_time` can be compared with the result from any
  10386. following call to the same function - not just the next immediate call.
  10387. - bpo-43354: Fix type documentation for ``Fault.faultCode``; the type has to
  10388. be ``int`` instead of ``str``.
  10389. - bpo-41933: Clarified wording of s * n in the Common Sequence Operations
  10390. Tests
  10391. -----
  10392. - bpo-37945: Fix test_getsetlocale_issue1813() of test_locale: skip the test
  10393. if ``setlocale()`` fails. Patch by Victor Stinner.
  10394. - bpo-41561: Add workaround for Ubuntu's custom OpenSSL security level
  10395. policy.
  10396. Build
  10397. -----
  10398. - bpo-43179: Introduce and correctly use ALIGNOF_X in place of SIZEOF_X for
  10399. alignment-related code in optimized string routines. Patch by Jessica
  10400. Clarke.
  10401. - bpo-43631: Update macOS, Windows, and CI to OpenSSL 1.1.1k.
  10402. - bpo-43617: Improve configure.ac: Check for presence of autoconf-archive
  10403. package and remove our copies of M4 macros.
  10404. - bpo-43466: The ``configure`` script now supports ``--with-openssl-rpath``
  10405. option.
  10406. - bpo-43372: Use ``_freeze_importlib`` to generate code for the
  10407. ``__hello__`` module. This approach ensures the code matches the
  10408. interpreter version. Previously, PYTHON_FOR_REGEN was used to generate
  10409. the code, which might be wrong. The marshal format for code objects has
  10410. changed with bpo-42246, commit 877df851. Update the code and the expected
  10411. code sizes in ctypes test_frozentable.
  10412. Windows
  10413. -------
  10414. - bpo-43440: Build :mod:`sqlite3` with the ``R*Tree`` module enabled. Patch
  10415. by Erlend E. Aasland.
  10416. IDLE
  10417. ----
  10418. - bpo-42225: Document that IDLE can fail on Unix either from misconfigured
  10419. IP masquerade rules or failure displaying complex colored (non-ascii)
  10420. characters.
  10421. C API
  10422. -----
  10423. - bpo-43688: The limited C API is now supported if Python is built in debug
  10424. mode (if the ``Py_DEBUG`` macro is defined). In the limited C API, the
  10425. :c:func:`Py_INCREF` and :c:func:`Py_DECREF` functions are now implemented
  10426. as opaque function calls, rather than accessing directly the
  10427. :c:member:`PyObject.ob_refcnt` member, if Python is built in debug mode
  10428. and the ``Py_LIMITED_API`` macro targets Python 3.10 or newer. It became
  10429. possible to support the limited C API in debug mode because the
  10430. :c:type:`PyObject` structure is the same in release and debug mode since
  10431. Python 3.8 (see :issue:`36465`).
  10432. The limited C API is still not supported in the ``--with-trace-refs``
  10433. special build (``Py_TRACE_REFS`` macro).
  10434. Patch by Victor Stinner.
  10435. - bpo-43244: Remove the ``pyarena.h`` header file with functions:
  10436. * ``PyArena_New()``
  10437. * ``PyArena_Free()``
  10438. * ``PyArena_Malloc()``
  10439. * ``PyArena_AddPyObject()``
  10440. These functions were undocumented, excluded from the limited C API, and
  10441. were only used internally by the compiler. Patch by Victor Stinner.
  10442. - bpo-43244: Remove the compiler and parser functions using ``struct _mod``
  10443. type, because the public AST C API was removed:
  10444. * ``PyAST_Compile()``
  10445. * ``PyAST_CompileEx()``
  10446. * ``PyAST_CompileObject()``
  10447. * ``PyFuture_FromAST()``
  10448. * ``PyFuture_FromASTObject()``
  10449. * ``PyParser_ASTFromFile()``
  10450. * ``PyParser_ASTFromFileObject()``
  10451. * ``PyParser_ASTFromFilename()``
  10452. * ``PyParser_ASTFromString()``
  10453. * ``PyParser_ASTFromStringObject()``
  10454. These functions were undocumented and excluded from the limited C API.
  10455. Patch by Victor Stinner.
  10456. - bpo-43244: Remove ``ast.h``, ``asdl.h``, and ``Python-ast.h`` header
  10457. files. These functions were undocumented and excluded from the limited C
  10458. API. Most names defined by these header files were not prefixed by ``Py``
  10459. and so could create names conflicts. For example, ``Python-ast.h`` defined
  10460. a ``Yield`` macro which was conflict with the ``Yield`` name used by the
  10461. Windows ``<winbase.h>`` header. Use the Python :mod:`ast` module instead.
  10462. Patch by Victor Stinner.
  10463. - bpo-43541: Fix a ``PyEval_EvalCodeEx()`` regression: fix reference
  10464. counting on builtins. Patch by Victor Stinner.
  10465. - bpo-43244: Remove the ``symtable.h`` header file and the undocumented
  10466. functions:
  10467. * ``PyST_GetScope()``
  10468. * ``PySymtable_Build()``
  10469. * ``PySymtable_BuildObject()``
  10470. * ``PySymtable_Free()``
  10471. * ``Py_SymtableString()``
  10472. * ``Py_SymtableStringObject()``
  10473. The ``Py_SymtableString()`` function was part the stable ABI by mistake
  10474. but it could not be used, because the ``symtable.h`` header file was
  10475. excluded from the limited C API.
  10476. The Python :mod:`symtable` module remains available and is unchanged.
  10477. Patch by Victor Stinner.
  10478. - bpo-43244: Remove the ``PyAST_Validate()`` function. It is no longer
  10479. possible to build a AST object (``mod_ty`` type) with the public C API.
  10480. The function was already excluded from the limited C API (:pep:`384`).
  10481. Patch by Victor Stinner.
  10482. What's New in Python 3.10.0 alpha 6?
  10483. ====================================
  10484. *Release date: 2021-03-01*
  10485. Security
  10486. --------
  10487. - bpo-42967: Fix web cache poisoning vulnerability by defaulting the query
  10488. args separator to ``&``, and allowing the user to choose a custom
  10489. separator.
  10490. Core and Builtins
  10491. -----------------
  10492. - bpo-43321: Fix ``SystemError`` raised when ``PyArg_Parse*()`` is used with
  10493. ``#`` but without ``PY_SSIZE_T_CLEAN`` defined.
  10494. - bpo-36346: ``PyArg_Parse*()`` functions now emits ``DeprecationWarning``
  10495. when ``u`` or ``Z`` format is used. See :pep:`623` for detail.
  10496. - bpo-43277: Add a new :c:func:`PySet_CheckExact` function to the C-API to
  10497. check if an object is an instance of :class:`set` but not an instance of a
  10498. subtype. Patch by Pablo Galindo.
  10499. - bpo-42990: The :data:`types.FunctionType` constructor now inherits the
  10500. current builtins if the *globals* dictionary has no ``"__builtins__"``
  10501. key, rather than using ``{"None": None}`` as builtins: same behavior as
  10502. :func:`eval` and :func:`exec` functions. Defining a function with ``def
  10503. function(...): ...`` in Python is not affected, globals cannot be
  10504. overridden with this syntax: it also inherits the current builtins. Patch
  10505. by Victor Stinner.
  10506. - bpo-42990: Functions have a new ``__builtins__`` attribute which is used
  10507. to look for builtin symbols when a function is executed, instead of
  10508. looking into ``__globals__['__builtins__']``. Patch by Mark Shannon and
  10509. Victor Stinner.
  10510. - bpo-43149: Improve the error message in the parser for exception groups
  10511. without parentheses. Patch by Pablo Galindo.
  10512. - bpo-43121: Fixed an incorrect :exc:`SyntaxError` message for missing comma
  10513. in literals. Patch by Pablo Galindo.
  10514. - bpo-42819: :mod:`readline`: Explicitly disable bracketed paste in the
  10515. interactive interpreter, even if it's set in the inputrc, is enabled by
  10516. default (eg GNU Readline 8.1), or a user calls
  10517. ``readline.read_init_file()``. The Python REPL has not implemented
  10518. bracketed paste support. Also, bracketed mode writes the ``"\x1b[?2004h"``
  10519. escape sequence into stdout which causes test failures in applications
  10520. that don't support it. It can still be explicitly enabled by calling
  10521. ``readline.parse_and_bind("set enable-bracketed-paste on")``. Patch by
  10522. Dustin Rodrigues.
  10523. - bpo-42808: Simple calls to ``type(object)`` are now faster due to the
  10524. ``vectorcall`` calling convention. Patch by Dennis Sweeney.
  10525. - bpo-42217: Make the compiler merges same co_code and co_linetable objects
  10526. in a module like already did for co_consts.
  10527. - bpo-41972: Substring search functions such as ``str1 in str2`` and
  10528. ``str2.find(str1)`` now sometimes use the "Two-Way" string comparison
  10529. algorithm to avoid quadratic behavior on long strings.
  10530. - bpo-42128: Implement :pep:`634` (structural pattern matching). Patch by
  10531. Brandt Bucher.
  10532. - bpo-40692: In the :class:`concurrent.futures.ProcessPoolExecutor`,
  10533. validate that :func:`multiprocess.synchronize` is available on a given
  10534. platform and rely on that check in the :mod:`concurrent.futures` test
  10535. suite so we can run tests that are unrelated to
  10536. :class:`ProcessPoolExecutor` on those platforms.
  10537. - bpo-38302: If :func:`object.__ipow__` returns :data:`NotImplemented`, the
  10538. operator will correctly fall back to :func:`object.__pow__` and
  10539. :func:`object.__rpow__` as expected.
  10540. Library
  10541. -------
  10542. - bpo-43316: The ``python -m gzip`` command line application now properly
  10543. fails when detecting an unsupported extension. It exits with a non-zero
  10544. exit code and prints an error message to stderr.
  10545. - bpo-43317: Set the chunk size for the ``gzip`` module main function to
  10546. io.DEFAULT_BUFFER_SIZE. This is slightly faster than the 1024 bytes
  10547. constant that was used previously.
  10548. - bpo-43146: Handle None in single-arg versions of
  10549. :func:`~traceback.print_exception` and
  10550. :func:`~traceback.format_exception`.
  10551. - bpo-43260: Fix TextIOWrapper can not flush internal buffer forever after
  10552. very large text is written.
  10553. - bpo-43258: Prevent needless allocation of :mod:`sqlite3` aggregate
  10554. function context when no rows match an aggregate query. Patch by Erlend E.
  10555. Aasland.
  10556. - bpo-43251: Improve :mod:`sqlite3` error handling:
  10557. ``sqlite3_column_name()`` failures now result in :exc:`MemoryError`. Patch
  10558. by Erlend E. Aasland.
  10559. - bpo-40956: Fix segfault in :meth:`sqlite3.Connection.backup` if no
  10560. argument was provided. The regression was introduced by PR 23838. Patch by
  10561. Erlend E. Aasland.
  10562. - bpo-43172: The readline module now passes its tests when built directly
  10563. against libedit. Existing irreconcilable API differences remain in
  10564. :func:`readline.get_begidx` and :func:`readline.get_endidx` behavior based
  10565. on libreadline vs libedit use.
  10566. - bpo-43163: Fix a bug in :mod:`codeop` that was causing it to not ask for
  10567. more input when multi-line snippets have unclosed parentheses. Patch by
  10568. Pablo Galindo
  10569. - bpo-43162: deprecate unsupported ability to access enum members as
  10570. attributes of other enum members
  10571. - bpo-43146: Fix recent regression in None argument handling in
  10572. :mod:`~traceback` module functions.
  10573. - bpo-43102: The namedtuple __new__ method had its __builtins__ set to None
  10574. instead of an actual dictionary. This created problems for introspection
  10575. tools.
  10576. - bpo-43106: Added :const:`~os.O_EVTONLY`, :const:`~os.O_FSYNC`,
  10577. :const:`~os.O_SYMLINK` and :const:`~os.O_NOFOLLOW_ANY` for macOS. Patch by
  10578. Donghee Na.
  10579. - bpo-42960: Adds :const:`resource.RLIMIT_KQUEUES` constant from FreeBSD to
  10580. the :mod:`resource` module.
  10581. - bpo-42151: Make the pure Python implementation of
  10582. :mod:`xml.etree.ElementTree` behave the same as the C implementation
  10583. (:mod:`_elementree`) regarding default attribute values (by not setting
  10584. ``specified_attributes=1``).
  10585. - bpo-29753: In ctypes, now packed bitfields are calculated properly and the
  10586. first item of packed bitfields is now shrank correctly.
  10587. Documentation
  10588. -------------
  10589. - bpo-27646: Clarify that 'yield from <expr>' works with any iterable, not
  10590. just iterators.
  10591. - bpo-36346: Update some deprecated unicode APIs which are documented as
  10592. "will be removed in 4.0" to "3.12". See :pep:`623` for detail.
  10593. Tests
  10594. -----
  10595. - bpo-43288: Fix test_importlib to correctly skip Unicode file tests if the
  10596. filesystem does not support them.
  10597. Build
  10598. -----
  10599. - bpo-43174: Windows build now uses ``/utf-8`` compiler option.
  10600. - bpo-43103: Add a new configure ``--without-static-libpython`` option to
  10601. not build the ``libpythonMAJOR.MINOR.a`` static library and not install
  10602. the ``python.o`` object file.
  10603. - bpo-13501: The configure script can now use *libedit* instead of
  10604. *readline* with the command line option ``--with-readline=editline``.
  10605. - bpo-42603: Make configure script use pkg-config to detect the location of
  10606. Tcl/Tk headers and libraries, used to build tkinter.
  10607. On macOS, a Tcl/Tk configuration provided by pkg-config will be preferred
  10608. over Tcl/Tk frameworks installed in ``/{System/,}Library/Frameworks``. If
  10609. both exist and the latter is preferred, the appropriate ``--with-tcltk-*``
  10610. configuration options need to be explicitly set.
  10611. - bpo-39448: Add the "regen-frozen" makefile target that regenerates the
  10612. code for the frozen ``__hello__`` module.
  10613. Windows
  10614. -------
  10615. - bpo-43155: :c:func:`PyCMethod_New` is now present in ``python3.lib``.
  10616. macOS
  10617. -----
  10618. - bpo-41837: Update macOS installer build to use OpenSSL 1.1.1j.
  10619. IDLE
  10620. ----
  10621. - bpo-43283: Document why printing to IDLE's Shell is often slower than
  10622. printing to a system terminal and that it can be made faster by
  10623. pre-formatting a single string before printing.
  10624. C API
  10625. -----
  10626. - bpo-43278: Always put compiler and system information on the first line of
  10627. the REPL welcome message.
  10628. - bpo-43270: Remove the private ``_PyErr_OCCURRED()`` macro: use the public
  10629. :c:func:`PyErr_Occurred` function instead.
  10630. - bpo-35134: Move odictobject.h, parser_interface.h, picklebufobject.h,
  10631. pydebug.h, and pyfpe.h into the cpython/ directory. They must not be
  10632. included directly, as they are already included by Python.h: :ref:`Include
  10633. Files <api-includes>`.
  10634. - bpo-35134: Move pyarena.h, pyctype.h, and pytime.h into the cpython/
  10635. directory. They must not be included directly, as they are already
  10636. included by Python.h: :ref:`Include Files <api-includes>`.
  10637. - bpo-40170: :c:func:`PyExceptionClass_Name` is now always declared as a
  10638. function, in order to hide implementation details. The macro accessed
  10639. :c:member:`PyTypeObject.tp_name` directly. Patch by Erlend E. Aasland.
  10640. - bpo-43239: The :c:func:`PyCFunction_New` function is now exported in the
  10641. ABI when compiled with ``-fvisibility=hidden``.
  10642. - bpo-40170: :c:func:`PyIter_Check` is now always declared as a function, in
  10643. order to hide implementation details. The macro accessed
  10644. :c:member:`PyTypeObject.tp_iternext` directly. Patch by Erlend E. Aasland.
  10645. - bpo-40170: Convert :c:func:`PyDescr_IsData` macro to a function to hide
  10646. implementation details: The macro accessed
  10647. :c:member:`PyTypeObject.tp_descr_set` directly. Patch by Erlend E.
  10648. Aasland.
  10649. - bpo-43181: Convert :c:func:`PyObject_TypeCheck` macro to a static inline
  10650. function. Patch by Erlend E. Aasland.
  10651. What's New in Python 3.10.0 alpha 5?
  10652. ====================================
  10653. *Release date: 2021-02-02*
  10654. Security
  10655. --------
  10656. - bpo-42938: Avoid static buffers when computing the repr of
  10657. :class:`ctypes.c_double` and :class:`ctypes.c_longdouble` values.
  10658. Core and Builtins
  10659. -----------------
  10660. - bpo-42990: Refactor the ``PyEval_`` family of functions.
  10661. * An new function ``_PyEval_Vector`` is added to simplify calls to Python from C.
  10662. * ``_PyEval_EvalCodeWithName`` is removed
  10663. * ``PyEval_EvalCodeEx`` is retained as part of the API, but is not used internally
  10664. - bpo-38631: Replace :c:func:`Py_FatalError` calls in the compiler with
  10665. regular :exc:`SystemError` exceptions. Patch by Victor Stinner.
  10666. - bpo-42997: Improve error message for missing ":" before blocks. Patch by
  10667. Pablo Galindo.
  10668. - bpo-43017: Improve error message in the parser when using un-parenthesised
  10669. tuples in comprehensions. Patch by Pablo Galindo.
  10670. - bpo-42986: Fix parser crash when reporting syntax errors in f-string with
  10671. newlines. Patch by Pablo Galindo.
  10672. - bpo-40176: Syntax errors for unterminated string literals now point to the
  10673. start of the string instead of reporting EOF/EOL.
  10674. - bpo-42927: The inline cache for ``LOAD_ATTR`` now also optimizes access to
  10675. attributes defined by ``__slots__``. This makes reading such attribute up
  10676. to 30% faster.
  10677. - bpo-42864: Improve error messages in the parser when parentheses are not
  10678. closed. Patch by Pablo Galindo.
  10679. - bpo-42924: Fix ``bytearray`` repetition incorrectly copying data from the
  10680. start of the buffer, even if the data is offset within the buffer (e.g.
  10681. after reassigning a slice at the start of the ``bytearray`` to a shorter
  10682. byte string).
  10683. - bpo-42882: Fix the :c:func:`_PyUnicode_FromId` function
  10684. (_Py_IDENTIFIER(var) API) when :c:func:`Py_Initialize` /
  10685. :c:func:`Py_Finalize` is called multiple times: preserve
  10686. ``_PyRuntime.unicode_ids.next_index`` value.
  10687. - bpo-42827: Fix a crash when working out the error line of a
  10688. :exc:`SyntaxError` in some multi-line expressions.
  10689. - bpo-42823: frame.f_lineno is correct even if frame.f_trace is set to True
  10690. - bpo-37324: Remove deprecated aliases to
  10691. :ref:`collections-abstract-base-classes` from the :mod:`collections`
  10692. module.
  10693. - bpo-41994: Fixed possible leak in ``import`` when ``sys.modules`` is not a
  10694. ``dict``.
  10695. - bpo-27772: In string formatting, preceding the *width* field by ``'0'`` no
  10696. longer affects the default alignment for strings.
  10697. Library
  10698. -------
  10699. - bpo-43108: Fixed a reference leak in the :mod:`curses` module. Patch by
  10700. Pablo Galindo
  10701. - bpo-43077: Update the bundled pip to 21.0.1 and setuptools to 52.0.0.
  10702. - bpo-41282: Deprecate ``distutils`` in documentation and add warning on
  10703. import.
  10704. - bpo-43014: Improve performance of :mod:`tokenize` by 20-30%. Patch by
  10705. Anthony Sottile.
  10706. - bpo-42323: Fix :func:`math.nextafter` for NaN on AIX.
  10707. - bpo-42955: Add :data:`sys.stdlib_module_names`, containing the list of the
  10708. standard library module names. Patch by Victor Stinner.
  10709. - bpo-42944: Fix ``random.Random.sample`` when ``counts`` argument is not
  10710. ``None``.
  10711. - bpo-42934: Use :class:`~traceback.TracebackException`'s new ``compact``
  10712. param in :class:`~unittest.TestResult` to reduce time and memory consumed
  10713. by traceback formatting.
  10714. - bpo-42931: Add :func:`randbytes` to ``random.__all__``.
  10715. - bpo-38250: [Enum] Flags consisting of a single bit are now considered
  10716. canonical, and will be the only flags returned from listing and iterating
  10717. over a Flag class or a Flag member. Multi-bit flags are considered
  10718. aliases; they will be returned from lookups and operations that result in
  10719. their value. Iteration for both Flag and Flag members is in definition
  10720. order.
  10721. - bpo-42877: Added the ``compact`` parameter to the constructor of
  10722. :class:`traceback.TracebackException` to reduce time and memory for use
  10723. cases that only need to call :func:`TracebackException.format` and
  10724. :func:`TracebackException.format_exception_only`.
  10725. - bpo-42923: The :c:func:`Py_FatalError` function and the
  10726. :mod:`faulthandler` module now dump the list of extension modules on a
  10727. fatal error.
  10728. - bpo-42848: Removed recursion from :class:`~traceback.TracebackException`
  10729. to allow it to handle long exception chains.
  10730. - bpo-42901: [Enum] move member creation from ``EnumMeta.__new__`` to
  10731. ``_proto_member.__set_name__``, allowing members to be created and visible
  10732. in ``__init_subclass__``.
  10733. - bpo-42780: Fix os.set_inheritable() for O_PATH file descriptors on Linux.
  10734. - bpo-42866: Fix a reference leak in the ``getcodec()`` function of CJK
  10735. codecs. Patch by Victor Stinner.
  10736. - bpo-42846: Convert the 6 CJK codec extension modules (_codecs_cn,
  10737. _codecs_hk, _codecs_iso2022, _codecs_jp, _codecs_kr and _codecs_tw) to the
  10738. multiphase initialization API (:pep:`489`). Patch by Victor Stinner.
  10739. - bpo-42851: remove __init_subclass__ support for Enum members
  10740. - bpo-42834: Make internal caches of the ``_json`` module compatible with
  10741. subinterpreters.
  10742. - bpo-41748: Fix HTMLParser parsing rules for element attributes containing
  10743. commas with spaces. Patch by Karl Dubost.
  10744. - bpo-40810: Require SQLite 3.7.15 or newer. Patch by Erlend E. Aasland.
  10745. - bpo-1635741: Convert the _multibytecodec extension module (CJK codecs) to
  10746. multi-phase initialization (:pep:`489`). Patch by Erlend E. Aasland.
  10747. - bpo-42802: The distutils ``bdist_wininst`` command deprecated in Python
  10748. 3.8 has been removed. The distutils ``bdist_wheel`` command is now
  10749. recommended to distribute binary packages on Windows.
  10750. - bpo-24464: The undocumented built-in function
  10751. ``sqlite3.enable_shared_cache`` is now deprecated, scheduled for removal
  10752. in Python 3.12. Its use is strongly discouraged by the SQLite3
  10753. documentation. Patch by Erlend E. Aasland.
  10754. - bpo-42384: Make pdb populate sys.path[0] exactly the same as regular
  10755. python execution.
  10756. - bpo-42383: Fix pdb: previously pdb would fail to restart the debugging
  10757. target if it was specified using a relative path and the current directory
  10758. changed.
  10759. - bpo-42005: Fix CLI of :mod:`cProfile` and :mod:`profile` to catch
  10760. :exc:`BrokenPipeError`.
  10761. - bpo-41604: Don't decrement the reference count of the previous user_ptr
  10762. when set_panel_userptr fails.
  10763. - bpo-41149: Allow executing callables that have a boolean value of
  10764. ``False`` when passed to :class:`Threading.thread` as the target. Patch
  10765. contributed by Barney Stratford.
  10766. - bpo-38307: Add an 'end_lineno' attribute to the Class and Function objects
  10767. that appear in the tree returned by pyclbr functions. This and the
  10768. existing 'lineno' attribute define the extent of class and def statements.
  10769. Patch by Aviral Srivastava.
  10770. - bpo-39273: The ``BUTTON5_*`` constants are now exposed in the
  10771. :mod:`curses` module if available.
  10772. - bpo-33289: Correct call to :mod:`tkinter.colorchooser` to return RGB
  10773. triplet of ints instead of floats. Patch by Cheryl Sabella.
  10774. Documentation
  10775. -------------
  10776. - bpo-40304: Fix doc for type(name, bases, dict). Patch by Boris
  10777. Verkhovskiy and Éric Araujo.
  10778. - bpo-42811: Updated importlib.util.resolve_name() doc to use
  10779. __spec__.parent instead of __package__. (Thanks Yair Frid.)
  10780. Tests
  10781. -----
  10782. - bpo-40823: Use :meth:`unittest.TestLoader().loadTestsFromTestCase` instead
  10783. of :meth:`unittest.makeSuite` in :mod:`sqlite3` tests. Patch by Erlend E.
  10784. Aasland.
  10785. - bpo-40810: In :mod:`sqlite3`, fix ``CheckTraceCallbackContent`` for SQLite
  10786. pre 3.7.15.
  10787. Build
  10788. -----
  10789. - bpo-43031: Pass ``--timeout=$(TESTTIMEOUT)`` option to the default profile
  10790. task ``./python -m test --pgo`` command.
  10791. - bpo-36143: ``make regen-all`` now also runs ``regen-keyword``. Patch by
  10792. Victor Stinner.
  10793. - bpo-42874: Removed the grep -q and -E flags in the tzpath validation
  10794. section of the configure script to better accommodate users of some
  10795. platforms (specifically Solaris 10).
  10796. - bpo-31904: Add library search path by wr-cc in add_cross_compiling_paths()
  10797. for VxWorks.
  10798. - bpo-42856: Add ``--with-wheel-pkg-dir=PATH`` option to the ``./configure``
  10799. script. If specified, the :mod:`ensurepip` module looks for ``setuptools``
  10800. and ``pip`` wheel packages in this directory: if both are present, these
  10801. wheel packages are used instead of ensurepip bundled wheel packages.
  10802. Some Linux distribution packaging policies recommend against bundling
  10803. dependencies. For example, Fedora installs wheel packages in the
  10804. ``/usr/share/python-wheels/`` directory and don't install the
  10805. ``ensurepip._bundled`` package.
  10806. Windows
  10807. -------
  10808. - bpo-41837: Updated Windows installer to include OpenSSL 1.1.1i
  10809. - bpo-42584: Upgrade Windows installer to use SQLite 3.34.0.
  10810. macOS
  10811. -----
  10812. - bpo-42504: Ensure that the value of
  10813. sysconfig.get_config_var('MACOSX_DEPLOYMENT_TARGET') is always a string,
  10814. even in when the value is parsable as an integer.
  10815. IDLE
  10816. ----
  10817. - bpo-43008: Make IDLE invoke :func:`sys.excepthook` in normal, 2-process
  10818. mode. Patch by Ken Hilton.
  10819. - bpo-33065: Fix problem debugging user classes with __repr__ method.
  10820. - bpo-23544: Disable Debug=>Stack Viewer when user code is running or
  10821. Debugger is active, to prevent hang or crash. Patch by Zackery Spytz.
  10822. - bpo-32631: Finish zzdummy example extension module: make menu entries
  10823. work; add docstrings and tests with 100% coverage.
  10824. C API
  10825. -----
  10826. - bpo-42979: When Python is built in debug mode (with C assertions), calling
  10827. a type slot like ``sq_length`` (``__len__()`` in Python) now fails with a
  10828. fatal error if the slot succeeded with an exception set, or failed with no
  10829. exception set. The error message contains the slot, the type name, and the
  10830. current exception (if an exception is set). Patch by Victor Stinner.
  10831. - bpo-43030: Fixed a compiler warning in :c:func:`Py_UNICODE_ISSPACE()` on
  10832. platforms with signed :c:type:`wchar_t`.
  10833. What's New in Python 3.10.0 alpha 4?
  10834. ====================================
  10835. *Release date: 2021-01-04*
  10836. Core and Builtins
  10837. -----------------
  10838. - bpo-42814: Fix undefined behavior in ``Objects/genericaliasobject.c``.
  10839. - bpo-42806: Fix the column offsets for f-strings :mod:`ast` nodes
  10840. surrounded by parentheses and for nodes that spawn multiple lines. Patch
  10841. by Pablo Galindo.
  10842. - bpo-40631: Fix regression where a single parenthesized starred expression
  10843. was a valid assignment target.
  10844. - bpo-27794: Improve the error message for failed writes/deletes to property
  10845. objects. When possible, the attribute name is now shown. Patch provided by
  10846. Yurii Karabas.
  10847. - bpo-42745: Make the type attribute lookup cache per-interpreter. Patch by
  10848. Victor Stinner.
  10849. - bpo-42246: Jumps to jumps are not eliminated when it would break PEP 626.
  10850. - bpo-42246: Make sure that the ``f_lasti`` and ``f_lineno`` attributes of a
  10851. frame are set correctly when an exception is raised or re-raised. Required
  10852. for PEP 626.
  10853. - bpo-32381: The coding cookie (ex: ``# coding: latin1``) is now ignored in
  10854. the command passed to the :option:`-c` command line option. Patch by
  10855. Victor Stinner.
  10856. - bpo-30858: Improve error location in expressions that contain assignments.
  10857. Patch by Pablo Galindo and Lysandros Nikolaou.
  10858. - bpo-42615: Remove jump commands made redundant by the deletion of
  10859. unreachable bytecode blocks
  10860. - bpo-42639: Make the :mod:`atexit` module state per-interpreter. It is now
  10861. safe have more than one :mod:`atexit` module instance. Patch by Donghee Na
  10862. and Victor Stinner.
  10863. - bpo-32381: Fix encoding name when running a ``.pyc`` file on Windows:
  10864. :c:func:`PyRun_SimpleFileExFlags()` now uses the correct encoding to
  10865. decode the filename.
  10866. - bpo-42195: The ``__args__`` of the parameterized generics for
  10867. :data:`typing.Callable` and :class:`collections.abc.Callable` are now
  10868. consistent. The ``__args__`` for :class:`collections.abc.Callable` are
  10869. now flattened while :data:`typing.Callable`'s have not changed. To allow
  10870. this change, :class:`types.GenericAlias` can now be subclassed and
  10871. ``collections.abc.Callable``'s ``__class_getitem__`` will now return a
  10872. subclass of ``types.GenericAlias``. Tests for typing were also updated to
  10873. not subclass things like ``Callable[..., T]`` as that is not a valid base
  10874. class. Finally, both ``Callable``\ s no longer validate their
  10875. ``argtypes``, in ``Callable[[argtypes], resulttype]`` to prepare for
  10876. :pep:`612`. Patch by Ken Jin.
  10877. - bpo-40137: Convert functools module to use
  10878. :c:func:`PyType_FromModuleAndSpec`.
  10879. - bpo-40077: Convert :mod:`array` to use heap types, and establish module
  10880. state for these.
  10881. - bpo-42008: Fix _random.Random() seeding.
  10882. - bpo-1635741: Port the :mod:`pyexpat` extension module to multi-phase
  10883. initialization (:pep:`489`).
  10884. - bpo-40521: Make the Unicode dictionary of interned strings compatible with
  10885. subinterpreters. Patch by Victor Stinner.
  10886. - bpo-39465: Make :c:func:`_PyUnicode_FromId` function compatible with
  10887. subinterpreters. Each interpreter now has an array of identifier objects
  10888. (interned strings decoded from UTF-8). Patch by Victor Stinner.
  10889. Library
  10890. -------
  10891. - bpo-42257: Handle empty string in variable executable in
  10892. platform.libc_ver()
  10893. - bpo-42772: randrange() now raises a TypeError when step is specified
  10894. without a stop argument. Formerly, it silently ignored the step argument.
  10895. - bpo-42759: Fixed equality comparison of :class:`tkinter.Variable` and
  10896. :class:`tkinter.font.Font`. Objects which belong to different Tcl
  10897. interpreters are now always different, even if they have the same name.
  10898. - bpo-42756: Configure LMTP Unix-domain socket to use socket global default
  10899. timeout when a timeout is not explicitly provided.
  10900. - bpo-23328: Allow / character in username, password fields on _PROXY
  10901. envars.
  10902. - bpo-42740: :func:`typing.get_args` and :func:`typing.get_origin` now
  10903. support :pep:`604` union types and :pep:`612` additions to ``Callable``.
  10904. - bpo-42655: :mod:`subprocess` *extra_groups* is now correctly passed into
  10905. setgroups() system call.
  10906. - bpo-42727: ``EnumMeta.__prepare__`` now accepts ``**kwds`` to properly
  10907. support ``__init_subclass__``
  10908. - bpo-38308: Add optional *weights* to *statistics.harmonic_mean()*.
  10909. - bpo-42721: When simple query dialogs (:mod:`tkinter.simpledialog`),
  10910. message boxes (:mod:`tkinter.messagebox`) or color choose dialog
  10911. (:mod:`tkinter.colorchooser`) are created without arguments *master* and
  10912. *parent*, and the default root window is not yet created, and
  10913. :func:`~tkinter.NoDefaultRoot` was not called, a new temporal hidden root
  10914. window will be created automatically. It will not be set as the default
  10915. root window and will be destroyed right after closing the dialog window.
  10916. It will help to use these simple dialog windows in programs which do not
  10917. need other GUI.
  10918. - bpo-25246: Optimized :meth:`collections.deque.remove`.
  10919. - bpo-35728: Added a root parameter to :func:`tkinter.font.nametofont`.
  10920. - bpo-15303: :mod:`tkinter` supports now widgets with boolean value False.
  10921. - bpo-42681: Fixed range checks for color and pair numbers in :mod:`curses`.
  10922. - bpo-42685: Improved placing of simple query windows in Tkinter (such as
  10923. :func:`tkinter.simpledialog.askinteger`). They are now centered at the
  10924. center of the parent window if it is specified and shown, otherwise at the
  10925. center of the screen.
  10926. - bpo-9694: Argparse help no longer uses the confusing phrase, "optional
  10927. arguments". It uses "options" instead.
  10928. - bpo-1635741: Port the :mod:`_thread` extension module to the multiphase
  10929. initialization API (:pep:`489`) and convert its static types to heap
  10930. types.
  10931. - bpo-37961: Fix crash in :func:`tracemalloc.Traceback.__repr__` (regressed
  10932. in Python 3.9).
  10933. - bpo-42630: :mod:`tkinter` functions and constructors which need a default
  10934. root window raise now :exc:`RuntimeError` with descriptive message instead
  10935. of obscure :exc:`AttributeError` or :exc:`NameError` if it is not created
  10936. yet or cannot be created automatically.
  10937. - bpo-42639: :func:`atexit._run_exitfuncs` now logs callback exceptions
  10938. using :data:`sys.unraisablehook`, rather than logging them directly into
  10939. :data:`sys.stderr` and raise the last exception.
  10940. - bpo-42644: ``logging.disable`` will now validate the types and value of
  10941. its parameter. It also now accepts strings representing the levels (as
  10942. does ``loging.setLevel``) instead of only the numerical values.
  10943. - bpo-42639: At Python exit, if a callback registered with
  10944. :func:`atexit.register` fails, its exception is now logged. Previously,
  10945. only some exceptions were logged, and the last exception was always
  10946. silently ignored.
  10947. - bpo-36541: Fixed lib2to3.pgen2 to be able to parse PEP-570 positional only
  10948. argument syntax.
  10949. - bpo-42382: In ``importlib.metadata``: - ``EntryPoint`` objects now expose
  10950. a ``.dist`` object referencing the ``Distribution`` when constructed from
  10951. a ``Distribution``. - Add support for package discovery under package
  10952. normalization rules. - The object returned by ``metadata()`` now has a
  10953. formally defined protocol called ``PackageMetadata`` with declared support
  10954. for the ``.get_all()`` method. - Synced with importlib_metadata 3.3.
  10955. - bpo-41877: A check is added against misspellings of autospect, auto_spec
  10956. and set_spec being passed as arguments to patch, patch.object and
  10957. create_autospec.
  10958. - bpo-39717: [tarfile] update nested exception raising to use ``from None``
  10959. or ``from e``
  10960. - bpo-41877: AttributeError for suspected misspellings of assertions on
  10961. mocks are now pointing out that the cause are misspelled assertions and
  10962. also what to do if the misspelling is actually an intended attribute name.
  10963. The unittest.mock document is also updated to reflect the current set of
  10964. recognised misspellings.
  10965. - bpo-41559: Implemented :pep:`612`: added ``ParamSpec`` and ``Concatenate``
  10966. to :mod:`typing`. Patch by Ken Jin.
  10967. - bpo-42385: StrEnum: fix _generate_next_value_ to return a str
  10968. - bpo-31904: Define THREAD_STACK_SIZE for VxWorks.
  10969. - bpo-34750: [Enum] ``_EnumDict.update()`` is now supported.
  10970. - bpo-42517: Enum: private names do not become members / do not generate
  10971. errors -- they remain normal attributes
  10972. - bpo-42678: ``Enum``: call ``__init_subclass__`` after members have been
  10973. added
  10974. - bpo-28964: :func:`ast.literal_eval` adds line number information (if
  10975. available) in error message for malformed nodes.
  10976. - bpo-42470: :func:`random.sample` no longer warns on a sequence which is
  10977. also a set.
  10978. - bpo-31904: :func:`posixpath.expanduser` returns the input *path* unchanged
  10979. if user home directory is None on VxWorks.
  10980. - bpo-42388: Fix subprocess.check_output(..., input=None) behavior when
  10981. text=True to be consistent with that of the documentation and
  10982. universal_newlines=True.
  10983. - bpo-34463: Fixed discrepancy between :mod:`traceback` and the interpreter
  10984. in formatting of SyntaxError with lineno not set (:mod:`traceback` was
  10985. changed to match interpreter).
  10986. - bpo-42393: Raise :exc:`OverflowError` instead of silent truncation in
  10987. :meth:`socket.ntohs` and :meth:`socket.htons`. Silent truncation was
  10988. deprecated in Python 3.7. Patch by Erlend E. Aasland
  10989. - bpo-42222: Harmonized :func:`random.randrange` argument handling to match
  10990. :func:`range`.
  10991. * The integer test and conversion in ``randrange()`` now uses
  10992. :func:`operator.index`.
  10993. * Non-integer arguments to ``randrange()`` are deprecated.
  10994. * The ``ValueError`` is deprecated in favor of a ``TypeError``.
  10995. * It now runs a little faster than before.
  10996. (Contributed by Raymond Hettinger and Serhiy Storchaka.)
  10997. - bpo-42163: Restore compatibility for ``uname_result`` around deepcopy and
  10998. _replace.
  10999. - bpo-42090: ``zipfile.Path.joinpath`` now accepts arbitrary arguments, same
  11000. as ``pathlib.Path.joinpath``.
  11001. - bpo-1635741: Port the _csv module to the multi-phase initialization API
  11002. (:pep:`489`).
  11003. - bpo-42059: :class:`typing.TypedDict` types created using the alternative
  11004. call-style syntax now correctly respect the ``total`` keyword argument
  11005. when setting their ``__required_keys__`` and ``__optional_keys__`` class
  11006. attributes.
  11007. - bpo-41960: Add ``globalns`` and ``localns`` parameters to the
  11008. :func:`inspect.signature` and :meth:`inspect.Signature.from_callable`.
  11009. - bpo-41907: fix ``format()`` behavior for ``IntFlag``
  11010. - bpo-41891: Ensure asyncio.wait_for waits for task completion
  11011. - bpo-24792: Fixed bug where :mod:`zipimporter` sometimes reports an
  11012. incorrect cause of import errors.
  11013. - bpo-31904: Fix site and sysconfig modules for VxWorks RTOS which has no
  11014. home directories.
  11015. - bpo-41462: Add :func:`os.set_blocking()` support for VxWorks RTOS.
  11016. - bpo-40219: Lowered :class:`tkinter.ttk.LabeledScale` dummy widget to
  11017. prevent hiding part of the content label.
  11018. - bpo-37193: Fixed memory leak in ``socketserver.ThreadingMixIn`` introduced
  11019. in Python 3.7.
  11020. - bpo-39068: Fix initialization race condition in :func:`a85encode` and
  11021. :func:`b85encode` in :mod:`base64`. Patch by Brandon Stansbury.
  11022. Documentation
  11023. -------------
  11024. - bpo-17140: Add documentation for the
  11025. :class:`multiprocessing.pool.ThreadPool` class.
  11026. - bpo-34398: Prominently feature listings from the glossary in documentation
  11027. search results. Patch by Ammar Askar.
  11028. Tests
  11029. -----
  11030. - bpo-42794: Update test_nntplib to use official group name of news.aioe.org
  11031. for testing. Patch by Donghee Na.
  11032. - bpo-31904: Skip some asyncio tests on VxWorks.
  11033. - bpo-42641: Enhance ``test_select.test_select()``: it now takes 500
  11034. milliseconds rather than 10 seconds. Use Python rather than a shell to
  11035. make the test more portable.
  11036. - bpo-31904: Skip some tests in _test_all_chown_common() on VxWorks.
  11037. - bpo-42199: Fix bytecode helper assertNotInBytecode.
  11038. - bpo-41443: Add more attribute checking in test_posix.py
  11039. - bpo-31904: Disable os.popen and impacted tests on VxWorks
  11040. - bpo-41439: Port test_ssl and test_uuid to VxWorks RTOS.
  11041. Build
  11042. -----
  11043. - bpo-42692: Fix __builtin_available check on older compilers. Patch by
  11044. Joshua Root.
  11045. - bpo-27640: Added ``--disable-test-modules`` option to the ``configure``
  11046. script: don't build nor install test modules. Patch by Xavier de Gaye,
  11047. Thomas Petazzoni and Peixing Xin.
  11048. - bpo-42604: Now all platforms use a value for the "EXT_SUFFIX" build
  11049. variable derived from SOABI (for instance in freeBSD, "EXT_SUFFIX" is now
  11050. ".cpython-310d.so" instead of ".so"). Previously only Linux, Mac and
  11051. VxWorks were using a value for "EXT_SUFFIX" that included "SOABI".
  11052. - bpo-42598: Fix implicit function declarations in configure which could
  11053. have resulted in incorrect configuration checks. Patch contributed by
  11054. Joshua Root.
  11055. - bpo-31904: Enable libpython3.so for VxWorks.
  11056. - bpo-29076: Add fish shell support to macOS installer.
  11057. macOS
  11058. -----
  11059. - bpo-42361: Update macOS installer build to use Tcl/Tk 8.6.11 (rc2,
  11060. expected to be final release).
  11061. - bpo-41837: Update macOS installer build to use OpenSSL 1.1.1i.
  11062. - bpo-42584: Update macOS installer to use SQLite 3.34.0.
  11063. Tools/Demos
  11064. -----------
  11065. - bpo-42726: Fixed Python 3 compatibility issue with gdb/libpython.py
  11066. handling of attribute dictionaries.
  11067. - bpo-42613: Fix ``freeze.py`` tool to use the prope config and library
  11068. directories. Patch by Victor Stinner.
  11069. C API
  11070. -----
  11071. - bpo-42591: Export the :c:func:`Py_FrozenMain` function: fix a Python 3.9.0
  11072. regression. Python 3.9 uses ``-fvisibility=hidden`` and the function was
  11073. not exported explicitly and so not exported.
  11074. - bpo-32381: Remove the private :c:func:`_Py_fopen` function which is no
  11075. longer needed. Use :c:func:`_Py_wfopen` or :c:func:`_Py_fopen_obj`
  11076. instead. Patch by Victor Stinner.
  11077. - bpo-1635741: Port :mod:`resource` extension module to module state
  11078. - bpo-42111: Update the ``xxlimited`` module to be a better example of how
  11079. to use the limited C API.
  11080. - bpo-40052: Fix an alignment build warning/error in function
  11081. ``PyVectorcall_Function()``. Patch by Andreas Schneider, Antoine Pitrou
  11082. and Petr Viktorin.
  11083. What's New in Python 3.10.0 alpha 3?
  11084. ====================================
  11085. *Release date: 2020-12-07*
  11086. Security
  11087. --------
  11088. - bpo-40791: Add ``volatile`` to the accumulator variable in
  11089. ``hmac.compare_digest``, making constant-time-defeating optimizations less
  11090. likely.
  11091. Core and Builtins
  11092. -----------------
  11093. - bpo-42576: ``types.GenericAlias`` will now raise a ``TypeError`` when
  11094. attempting to initialize with a keyword argument. Previously, this would
  11095. cause the interpreter to crash if the interpreter was compiled with debug
  11096. symbols. This does not affect interpreters compiled for release. Patch by
  11097. Ken Jin.
  11098. - bpo-42536: Several built-in and standard library types now ensure that
  11099. their internal result tuples are always tracked by the :term:`garbage
  11100. collector <garbage collection>`:
  11101. - :meth:`collections.OrderedDict.items() <collections.OrderedDict>`
  11102. - :meth:`dict.items`
  11103. - :func:`enumerate`
  11104. - :func:`functools.reduce`
  11105. - :func:`itertools.combinations`
  11106. - :func:`itertools.combinations_with_replacement`
  11107. - :func:`itertools.permutations`
  11108. - :func:`itertools.product`
  11109. - :func:`itertools.zip_longest`
  11110. - :func:`zip`
  11111. Previously, they could have become untracked by a prior garbage
  11112. collection. Patch by Brandt Bucher.
  11113. - bpo-42500: Improve handling of exceptions near recursion limit. Converts a
  11114. number of Fatal Errors in RecursionErrors.
  11115. - bpo-42246: PEP 626: After a return, the f_lineno attribute of a frame is
  11116. always the last line executed.
  11117. - bpo-42435: Speed up comparison of bytes objects with non-bytes objects
  11118. when option :option:`-b` is specified. Speed up comparison of bytarray
  11119. objects with non-buffer object.
  11120. - bpo-1635741: Port the ``_warnings`` extension module to the multi-phase
  11121. initialization API (:pep:`489`). Patch by Victor Stinner.
  11122. - bpo-41686: On Windows, the ``SIGINT`` event, ``_PyOS_SigintEvent()``, is
  11123. now created even if Python is configured to not install signal handlers
  11124. (if :c:member:`PyConfig.install_signal_handlers` equals to 0, or
  11125. ``Py_InitializeEx(0)``).
  11126. - bpo-42381: Allow assignment expressions in set literals and set
  11127. comprehensions as per PEP 572. Patch by Pablo Galindo.
  11128. - bpo-42202: Change function parameters annotations internal representation
  11129. to tuple of strings. Patch provided by Yurii Karabas.
  11130. - bpo-42374: Fix a regression introduced by the new parser, where an
  11131. unparenthesized walrus operator was not allowed within generator
  11132. expressions.
  11133. - bpo-42316: Allow an unparenthesized walrus in subscript indexes.
  11134. - bpo-42349: Make sure that the compiler front-end produces a well-formed
  11135. control flow graph. Be be more aggressive in the compiler back-end, as it
  11136. is now safe to do so.
  11137. - bpo-42296: On Windows, fix a regression in signal handling which prevented
  11138. to interrupt a program using CTRL+C. The signal handler can be run in a
  11139. thread different than the Python thread, in which case the test deciding
  11140. if the thread can handle signals is wrong.
  11141. - bpo-42332: :class:`types.GenericAlias` objects can now be the targets of
  11142. weakrefs.
  11143. - bpo-42282: Optimise constant subexpressions that appear as part of named
  11144. expressions (previously the AST optimiser did not descend into named
  11145. expressions). Patch by Nick Coghlan.
  11146. - bpo-42266: Fixed a bug with the LOAD_ATTR opcode cache that was not
  11147. respecting monkey-patching a class-level attribute to make it a
  11148. descriptor. Patch by Pablo Galindo.
  11149. - bpo-40077: Convert :mod:`queue` to use heap types.
  11150. - bpo-42246: Improved accuracy of line tracing events and f_lineno attribute
  11151. of Frame objects. See PEP 626 for details.
  11152. - bpo-40077: Convert :mod:`mmap` to use heap types.
  11153. - bpo-42233: Allow ``GenericAlias`` objects to use :ref:`union type
  11154. expressions <types-union>`. This allows expressions like ``list[int] |
  11155. dict[float, str]`` where previously a ``TypeError`` would have been
  11156. thrown. This also fixes union type expressions not de-duplicating
  11157. ``GenericAlias`` objects. (Contributed by Ken Jin in :issue:`42233`.)
  11158. - bpo-26131: The import system triggers a ``ImportWarning`` when it falls
  11159. back to using ``load_module()``.
  11160. Library
  11161. -------
  11162. - bpo-5054: CGIHTTPRequestHandler.run_cgi() HTTP_ACCEPT improperly parsed.
  11163. Replace the special purpose getallmatchingheaders with generic get_all
  11164. method and add relevant tests.
  11165. Original Patch by Martin Panter. Modified by Senthil Kumaran.
  11166. - bpo-42562: Fix issue when dis failed to parse function that has no line
  11167. numbers. Patch provided by Yurii Karabas.
  11168. - bpo-17735: :func:`inspect.findsource` now raises :exc:`OSError` instead of
  11169. :exc:`IndexError` when :attr:`co_lineno` of a code object is greater than
  11170. the file length. This can happen, for example, when a file is edited after
  11171. it was imported. PR by Irit Katriel.
  11172. - bpo-42116: Fix handling of trailing comments by :func:`inspect.getsource`.
  11173. - bpo-42532: Remove unexpected call of ``__bool__`` when passing a
  11174. ``spec_arg`` argument to a Mock.
  11175. - bpo-38200: Added itertools.pairwise()
  11176. - bpo-41818: Fix test_master_read() so that it succeeds on all platforms
  11177. that either raise OSError or return b"" upon reading from master.
  11178. - bpo-42487: ChainMap.__iter__ no longer calls __getitem__ on underlying
  11179. maps
  11180. - bpo-42482: :class:`~traceback.TracebackException` no longer holds a
  11181. reference to the exception's traceback object. Consequently, instances of
  11182. TracebackException for equivalent but non-equal exceptions now compare as
  11183. equal.
  11184. - bpo-41818: Make test_openpty() avoid unexpected success due to number of
  11185. rows and/or number of columns being == 0.
  11186. - bpo-42392: Remove loop parameter from ``asyncio.subprocess`` and
  11187. ``asyncio.tasks`` functions. Patch provided by Yurii Karabas.
  11188. - bpo-42392: Remove loop parameter from ``asyncio.open_connection`` and
  11189. ``asyncio.start_server`` functions. Patch provided by Yurii Karabas.
  11190. - bpo-28468: Add :func:`platform.freedesktop_os_release` function to parse
  11191. freedesktop.org ``os-release`` files.
  11192. - bpo-42299: Removed the ``formatter`` module, which was deprecated in
  11193. Python 3.4. It is somewhat obsolete, little used, and not tested. It was
  11194. originally scheduled to be removed in Python 3.6, but such removals were
  11195. delayed until after Python 2.7 EOL. Existing users should copy whatever
  11196. classes they use into their code. Patch by Donghee Na and and Terry J.
  11197. Reedy.
  11198. - bpo-26131: Deprecate zipimport.zipimporter.load_module() in favour of
  11199. exec_module().
  11200. - bpo-41818: Updated tests for the pty library. test_basic() has been
  11201. changed to test_openpty(); this additionally checks if slave termios and
  11202. slave winsize are being set properly by pty.openpty(). In order to add
  11203. support for FreeBSD, NetBSD, OpenBSD, and Darwin, this also adds
  11204. test_master_read(), which demonstrates that pty.spawn() should not depend
  11205. on an OSError to exit from its copy loop.
  11206. - bpo-42392: Remove loop parameter from ``__init__`` in all
  11207. ``asyncio.locks`` and ``asyncio.Queue`` classes. Patch provided by Yurii
  11208. Karabas.
  11209. - bpo-15450: Make :class:`filecmp.dircmp` respect subclassing. Now the
  11210. :attr:`filecmp.dircmp.subdirs` behaves as expected when subclassing
  11211. dircmp.
  11212. - bpo-42413: The exception :exc:`socket.timeout` is now an alias of
  11213. :exc:`TimeoutError`.
  11214. - bpo-31904: Support signal module on VxWorks.
  11215. - bpo-42406: We fixed an issue in ``pickle.whichmodule`` in which importing
  11216. ``multiprocessing`` could change the how pickle identifies which module an
  11217. object belongs to, potentially breaking the unpickling of those objects.
  11218. - bpo-42403: Simplify the :mod:`importlib` external bootstrap code:
  11219. ``importlib._bootstrap_external`` now uses regular imports to import
  11220. builtin modules. When it is imported, the builtin :func:`__import__()`
  11221. function is already fully working and so can be used to import builtin
  11222. modules like :mod:`sys`. Patch by Victor Stinner.
  11223. - bpo-1635741: Convert _sre module types to heap types (PEP 384). Patch by
  11224. Erlend E. Aasland.
  11225. - bpo-42375: subprocess module update for DragonFlyBSD support.
  11226. - bpo-41713: Port the ``_signal`` extension module to the multi-phase
  11227. initialization API (:pep:`489`). Patch by Victor Stinner and Mohamed
  11228. Koubaa.
  11229. - bpo-37205: :func:`time.time()`, :func:`time.perf_counter()` and
  11230. :func:`time.monotonic()` functions can no longer fail with a Python fatal
  11231. error, instead raise a regular Python exception on failure.
  11232. - bpo-42328: Fixed :meth:`tkinter.ttk.Style.map`. The function accepts now
  11233. the representation of the default state as empty sequence (as returned by
  11234. ``Style.map()``). The structure of the result is now the same on all
  11235. platform and does not depend on the value of ``wantobjects``.
  11236. - bpo-42345: Fix various issues with ``typing.Literal`` parameter handling
  11237. (flatten, deduplicate, use type to cache key). Patch provided by Yurii
  11238. Karabas.
  11239. - bpo-37205: :func:`time.perf_counter()` on Windows and
  11240. :func:`time.monotonic()` on macOS are now system-wide. Previously, they
  11241. used an offset computed at startup to reduce the precision loss caused by
  11242. the float type. Use :func:`time.perf_counter_ns()` and
  11243. :func:`time.monotonic_ns()` added in Python 3.7 to avoid this precision
  11244. loss.
  11245. - bpo-42318: Fixed support of non-BMP characters in :mod:`tkinter` on macOS.
  11246. - bpo-42350: Fix the :class:`threading.Thread` class at fork: do nothing if
  11247. the thread is already stopped (ex: fork called at Python exit).
  11248. Previously, an error was logged in the child process.
  11249. - bpo-42333: Port _ssl extension module to heap types.
  11250. - bpo-42014: The ``onerror`` callback from ``shutil.rmtree`` now receives
  11251. correct function when ``os.open`` fails.
  11252. - bpo-42237: Fix ``os.sendfile()`` on illumos.
  11253. - bpo-42308: Add :data:`threading.__excepthook__` to allow retrieving the
  11254. original value of :func:`threading.excepthook` in case it is set to a
  11255. broken or a different value. Patch by Mario Corchero.
  11256. - bpo-42131: Implement PEP 451/spec methods on zipimport.zipimporter:
  11257. find_spec(), create_module(), and exec_module().
  11258. This also allows for the documented deprecation of find_loader(),
  11259. find_module(), and load_module().
  11260. - bpo-41877: Mock objects which are not unsafe will now raise an
  11261. AttributeError if an attribute with the prefix asert, aseert, or assrt is
  11262. accessed, in addition to this already happening for the prefixes assert or
  11263. assret.
  11264. - bpo-42264: ``sqlite3.OptimizedUnicode`` has been undocumented and obsolete
  11265. since Python 3.3, when it was made an alias to :class:`str`. It is now
  11266. deprecated, scheduled for removal in Python 3.12.
  11267. - bpo-42251: Added :func:`threading.gettrace` and
  11268. :func:`threading.getprofile` to retrieve the functions set by
  11269. :func:`threading.settrace` and :func:`threading.setprofile` respectively.
  11270. Patch by Mario Corchero.
  11271. - bpo-42249: Fixed writing binary Plist files larger than 4 GiB.
  11272. - bpo-42236: On Unix, the :func:`os.device_encoding` function now returns
  11273. ``'UTF-8'`` rather than the device encoding if the :ref:`Python UTF-8 Mode
  11274. <utf8-mode>` is enabled.
  11275. - bpo-41754: webbrowser: Ignore *NotADirectoryError* when calling
  11276. ``xdg-settings``.
  11277. - bpo-42183: Fix a stack overflow error for asyncio Task or Future repr().
  11278. The overflow occurs under some circumstances when a Task or Future
  11279. recursively returns itself.
  11280. - bpo-42140: Improve asyncio.wait function to create the futures set just
  11281. one time.
  11282. - bpo-42133: Update various modules in the stdlib to fall back on
  11283. ``__spec__.loader`` when ``__loader__`` isn't defined on a module.
  11284. - bpo-26131: The ``load_module()`` methods found in ``importlib`` now
  11285. trigger a ``DeprecationWarning``.
  11286. - bpo-39825: Windows: Change ``sysconfig.get_config_var('EXT_SUFFIX')`` to
  11287. the expected full ``platform_tag.extension`` format. Previously it was
  11288. hard-coded to ``.pyd``, now it is compatible with ``distutils.sysconfig``
  11289. and will result in something like ``.cp38-win_amd64.pyd``. This brings
  11290. windows into conformance with the other platforms.
  11291. - bpo-26389: The :func:`traceback.format_exception`,
  11292. :func:`traceback.format_exception_only`, and
  11293. :func:`traceback.print_exception` functions can now take an exception
  11294. object as a positional-only argument.
  11295. - bpo-41889: Enum: fix regression involving inheriting a multiply inherited
  11296. enum
  11297. - bpo-41861: Convert :mod:`sqlite3` to use heap types (PEP 384). Patch by
  11298. Erlend E. Aasland.
  11299. - bpo-40624: Added support for the XPath ``!=`` operator in xml.etree
  11300. - bpo-28850: Fix :meth:`pprint.PrettyPrinter.format` overrides being ignored
  11301. for contents of small containers. The :func:`pprint._safe_repr` function
  11302. was removed.
  11303. - bpo-41625: Expose the :c:func:`splice` as :func:`os.splice` in the
  11304. :mod:`os` module. Patch by Pablo Galindo
  11305. - bpo-34215: Clarify the error message for
  11306. :exc:`asyncio.IncompleteReadError` when ``expected`` is ``None``.
  11307. - bpo-41543: Add async context manager support for contextlib.nullcontext.
  11308. - bpo-21041: :attr:`pathlib.PurePath.parents` now supports negative
  11309. indexing. Patch contributed by Yaroslav Pankovych.
  11310. - bpo-41332: Added missing connect_accepted_socket() method to
  11311. ``asyncio.AbstractEventLoop``.
  11312. - bpo-12800: Extracting a symlink from a tarball should succeed and
  11313. overwrite the symlink if it already exists. The fix is to remove the
  11314. existing file or symlink before extraction. Based on patch by Chris AtLee,
  11315. Jeffrey Kintscher, and Senthil Kumaran.
  11316. - bpo-40968: :mod:`urllib.request` and :mod:`http.client` now send
  11317. ``http/1.1`` ALPN extension during TLS handshake when no custom context is
  11318. supplied.
  11319. - bpo-41001: Add :func:`os.eventfd` to provide a low level interface for
  11320. Linux's event notification file descriptor.
  11321. - bpo-40816: Add AsyncContextDecorator to contextlib to support async
  11322. context manager as a decorator.
  11323. - bpo-40550: Fix time-of-check/time-of-action issue in
  11324. subprocess.Popen.send_signal.
  11325. - bpo-39411: Add an ``is_async`` identifier to :mod:`pyclbr`'s ``Function``
  11326. objects. Patch by Batuhan Taskaya
  11327. - bpo-35498: Add slice support to :attr:`pathlib.PurePath.parents`.
  11328. Documentation
  11329. -------------
  11330. - bpo-42238: Tentative to deprecate ``make suspicious`` by first removing it
  11331. from the CI and documentation builds, but keeping it around for manual
  11332. uses.
  11333. - bpo-42153: Fix the URL for the IMAP protocol documents.
  11334. - bpo-41028: Language and version switchers, previously maintained in every
  11335. cpython branches, are now handled by docsbuild-script.
  11336. Tests
  11337. -----
  11338. - bpo-41473: Re-enable test_gdb on gdb 9.2 and newer:
  11339. https://bugzilla.redhat.com/show_bug.cgi?id=1866884 bug is fixed in gdb
  11340. 10.1.
  11341. - bpo-42553: Fix ``test_asyncio.test_call_later()`` race condition: don't
  11342. measure asyncio performance in the ``call_later()`` unit test. The test
  11343. failed randomly on the CI.
  11344. - bpo-31904: Fix test_netrc on VxWorks: create temporary directories using
  11345. temp_cwd().
  11346. - bpo-31904: skip test_getaddrinfo_ipv6_scopeid_symbolic and
  11347. test_getnameinfo_ipv6_scopeid_symbolic on VxWorks
  11348. - bpo-31904: skip test_test of test_mailcap on VxWorks
  11349. - bpo-31904: add shell requirement for test_pipes
  11350. - bpo-31904: skip some tests related to fifo on VxWorks
  11351. - bpo-31904: Fix test_doctest.py failures for VxWorks.
  11352. - bpo-40754: Include ``_testinternalcapi`` module in Windows installer for
  11353. test suite
  11354. - bpo-41561: test_ssl: skip test_min_max_version_mismatch when TLS 1.0 is
  11355. not available
  11356. - bpo-31904: Fix os module failures for VxWorks RTOS.
  11357. - bpo-31904: Fix fifo test cases for VxWorks RTOS.
  11358. Build
  11359. -----
  11360. - bpo-31904: remove libnet dependency from detect_socket() for VxWorks
  11361. - bpo-42398: Fix a race condition in "make regen-all" when make -jN option
  11362. is used to run jobs in parallel. The clinic.py script now only use atomic
  11363. write to write files. Moveover, generated files are now left unchanged if
  11364. the content does not change, to not change the file modification time.
  11365. - bpo-41617: Fix building ``pycore_bitutils.h`` internal header on old clang
  11366. version without ``__builtin_bswap16()`` (ex: Xcode 4.6.3 on Mac OS X
  11367. 10.7). Patch by Joshua Root and Victor Stinner.
  11368. - bpo-38823: It is no longer possible to build the ``_ctypes`` extension
  11369. module without :c:type:`wchar_t` type: remove ``CTYPES_UNICODE`` macro.
  11370. Anyway, the :c:type:`wchar_t` type is required to build Python. Patch by
  11371. Victor Stinner.
  11372. - bpo-42087: Support was removed for AIX 5.3 and below. See :issue:`40680`.
  11373. - bpo-40998: Addressed three compiler warnings found by undefined behavior
  11374. sanitizer (ubsan).
  11375. Windows
  11376. -------
  11377. - bpo-42120: Remove macro definition of ``copysign`` (to ``_copysign``) in
  11378. headers.
  11379. - bpo-38506: The Windows launcher now properly handles Python 3.10 when
  11380. listing installed Python versions.
  11381. macOS
  11382. -----
  11383. - bpo-42504: Fix build on macOS Big Sur when MACOSX_DEPLOYMENT_TARGET=11
  11384. - bpo-41116: Ensure distutils.unixxcompiler.find_library_file can find
  11385. system provided libraries on macOS 11.
  11386. - bpo-41100: Add support for macOS 11 and Apple Silicon systems.
  11387. It is now possible to build "Universal 2" binaries using
  11388. "--enable-universalsdk --with-universal-archs=universal2".
  11389. Binaries build on later macOS versions can be deployed back to older
  11390. versions (tested up to macOS 10.9), when using the correct deployment
  11391. target. This is tested using Xcode 11 and later.
  11392. - bpo-42232: Added Darwin specific madvise options to mmap module.
  11393. - bpo-38443: The ``--enable-universalsdk`` and ``--with-universal-archs``
  11394. options for the configure script now check that the specified
  11395. architectures can be used.
  11396. IDLE
  11397. ----
  11398. - bpo-42508: Keep IDLE running on macOS. Remove obsolete workaround that
  11399. prevented running files with shortcuts when using new universal2
  11400. installers built on macOS 11.
  11401. - bpo-42426: Fix reporting offset of the RE error in searchengine.
  11402. - bpo-42415: Get docstrings for IDLE calltips more often by using
  11403. inspect.getdoc.
  11404. Tools/Demos
  11405. -----------
  11406. - bpo-42212: The smelly.py script now also checks the Python dynamic library
  11407. and extension modules, not only the Python static library. Make also the
  11408. script more verbose: explain what it does.
  11409. - bpo-36310: Allow :file:`Tools/i18n/pygettext.py` to detect calls to
  11410. ``gettext`` in f-strings.
  11411. C API
  11412. -----
  11413. - bpo-42423: The :c:func:`PyType_FromSpecWithBases` and
  11414. :c:func:`PyType_FromModuleAndSpec` functions now accept a single class as
  11415. the *bases* argument.
  11416. - bpo-1635741: Port :mod:`select` extension module to multiphase
  11417. initialization (:pep:`489`).
  11418. - bpo-1635741: Port _posixsubprocess extension module to multiphase
  11419. initialization (:pep:`489`).
  11420. - bpo-1635741: Port _posixshmem extension module to multiphase
  11421. initialization (:pep:`489`)
  11422. - bpo-1635741: Port _struct extension module to multiphase initialization
  11423. (:pep:`489`)
  11424. - bpo-1635741: Port :mod:`spwd` extension module to multiphase
  11425. initialization (:pep:`489`)
  11426. - bpo-1635741: Port :mod:`gc` extension module to multiphase initialization
  11427. (:pep:`489`)
  11428. - bpo-1635741: Port _queue extension module to multiphase initialization
  11429. (:pep:`489`)
  11430. - bpo-39573: Convert :c:func:`Py_TYPE` and :c:func:`Py_SIZE` back to macros
  11431. to allow using them as an l-value. Many third party C extension modules
  11432. rely on the ability of using Py_TYPE() and Py_SIZE() to set an object type
  11433. and size: ``Py_TYPE(obj) = type;`` and ``Py_SIZE(obj) = size;``.
  11434. - bpo-1635741: Port :mod:`symtable` extension module to multiphase
  11435. initialization (:pep:`489`)
  11436. - bpo-1635741: Port :mod:`grp` and :mod:`pwd` extension modules to
  11437. multiphase initialization (:pep:`489`)
  11438. - bpo-1635741: Port _random extension module to multiphase initialization
  11439. (:pep:`489`)
  11440. - bpo-1635741: Port _hashlib extension module to multiphase initialization
  11441. (:pep:`489`)
  11442. - bpo-41713: Removed the undocumented ``PyOS_InitInterrupts()`` function.
  11443. Initializing Python already implicitly installs signal handlers: see
  11444. :c:member:`PyConfig.install_signal_handlers`. Patch by Victor Stinner.
  11445. - bpo-40170: The ``Py_TRASHCAN_BEGIN`` macro no longer accesses PyTypeObject
  11446. attributes, but now can get the condition by calling the new private
  11447. :c:func:`_PyTrash_cond()` function which hides implementation details.
  11448. - bpo-42260: :c:func:`Py_GetPath`, :c:func:`Py_GetPrefix`,
  11449. :c:func:`Py_GetExecPrefix`, :c:func:`Py_GetProgramFullPath`,
  11450. :c:func:`Py_GetPythonHome` and :c:func:`Py_GetProgramName` functions now
  11451. return ``NULL`` if called before :c:func:`Py_Initialize` (before Python is
  11452. initialized). Use the new :ref:`Python Initialization Configuration API
  11453. <init-config>` to get the :ref:`Python Path Configuration.
  11454. <init-path-config>`. Patch by Victor Stinner.
  11455. - bpo-42260: The :c:func:`PyConfig_Read` function now only parses
  11456. :c:member:`PyConfig.argv` arguments once: :c:member:`PyConfig.parse_argv`
  11457. is set to ``2`` after arguments are parsed. Since Python arguments are
  11458. strippped from :c:member:`PyConfig.argv`, parsing arguments twice would
  11459. parse the application options as Python options.
  11460. - bpo-42262: Added :c:func:`Py_NewRef` and :c:func:`Py_XNewRef` functions to
  11461. increment the reference count of an object and return the object. Patch by
  11462. Victor Stinner.
  11463. - bpo-42260: When :c:func:`Py_Initialize` is called twice, the second call
  11464. now updates more :mod:`sys` attributes for the configuration, rather than
  11465. only :data:`sys.argv`. Patch by Victor Stinner.
  11466. - bpo-41832: The :c:func:`PyType_FromModuleAndSpec` function now accepts
  11467. NULL ``tp_doc`` slot.
  11468. - bpo-1635741: Added :c:func:`PyModule_AddObjectRef` function: similar to
  11469. :c:func:`PyModule_AddObject` but don't steal a reference to the value on
  11470. success. Patch by Victor Stinner.
  11471. - bpo-42171: The :c:macro:`METH_FASTCALL` calling convention is added to the
  11472. limited API. The functions :c:func:`PyModule_AddType`,
  11473. :c:func:`PyType_FromModuleAndSpec`, :c:func:`PyType_GetModule` and
  11474. :c:func:`PyType_GetModuleState` are added to the limited API on Windows.
  11475. - bpo-42085: Add dedicated entry to PyAsyncMethods for sending values
  11476. - bpo-41073: :c:func:`PyType_GetSlot()` can now accept static types.
  11477. - bpo-30459: :c:func:`PyList_SET_ITEM`, :c:func:`PyTuple_SET_ITEM` and
  11478. :c:func:`PyCell_SET` macros can no longer be used as l-value or r-value.
  11479. For example, ``x = PyList_SET_ITEM(a, b, c)`` and ``PyList_SET_ITEM(a, b,
  11480. c) = x`` now fail with a compiler error. It prevents bugs like ``if
  11481. (PyList_SET_ITEM (a, b, c) < 0) ...`` test. Patch by Zackery Spytz and
  11482. Victor Stinner.
  11483. What's New in Python 3.10.0 alpha 2?
  11484. ====================================
  11485. *Release date: 2020-11-03*
  11486. Security
  11487. --------
  11488. - bpo-42103: Prevented potential DoS attack via CPU and RAM exhaustion when
  11489. processing malformed Apple Property List files in binary format.
  11490. - bpo-42051: The :mod:`plistlib` module no longer accepts entity
  11491. declarations in XML plist files to avoid XML vulnerabilities. This should
  11492. not affect users as entity declarations are not used in regular plist
  11493. files.
  11494. Core and Builtins
  11495. -----------------
  11496. - bpo-42236: If the ``nl_langinfo(CODESET)`` function returns an empty
  11497. string, Python now uses UTF-8 as the filesystem encoding. Patch by Victor
  11498. Stinner.
  11499. - bpo-42218: Fixed a bug in the PEG parser that was causing crashes in debug
  11500. mode. Now errors are checked in left-recursive rules to avoid cases where
  11501. such errors do not get handled in time and appear as long-distance crashes
  11502. in other places.
  11503. - bpo-42214: Fixed a possible crash in the PEG parser when checking for the
  11504. '!=' token in the ``barry_as_flufl`` rule. Patch by Pablo Galindo.
  11505. - bpo-42206: Propagate and raise the errors caused by
  11506. :c:func:`PyAST_Validate` in the parser.
  11507. - bpo-41796: The :mod:`ast` module internal state is now per interpreter.
  11508. Patch by Victor Stinner.
  11509. - bpo-42143: Fix handling of errors during creation of ``PyFunctionObject``,
  11510. which resulted in operations on uninitialized memory. Patch by Yonatan
  11511. Goldschmidt.
  11512. - bpo-41659: Fix a bug in the parser, where a curly brace following a
  11513. ``primary`` didn't fail immediately. This led to invalid expressions like
  11514. ``a {b}`` to throw a :exc:`SyntaxError` with a wrong offset, or invalid
  11515. expressions ending with a curly brace like ``a {`` to not fail immediately
  11516. in the REPL.
  11517. - bpo-42150: Fix possible buffer overflow in the new parser when checking
  11518. for continuation lines. Patch by Pablo Galindo.
  11519. - bpo-42123: Run the parser two times. On the first run, disable all the
  11520. rules that only generate better error messages to gain performance. If
  11521. there's a parse failure, run the parser a second time with those enabled.
  11522. - bpo-42093: The ``LOAD_ATTR`` instruction now uses new "per opcode cache"
  11523. mechanism and it is about 36% faster now. Patch by Pablo Galindo and Yury
  11524. Selivanov.
  11525. - bpo-42030: Support for the legacy AIX-specific shared library loading
  11526. support has been removed. All versions of AIX since 4.3 have supported and
  11527. defaulted to using the common Unix mechanism instead.
  11528. - bpo-41984: The garbage collector now tracks all user-defined classes.
  11529. Patch by Brandt Bucher.
  11530. - bpo-41993: Fixed potential issues with removing not completely initialized
  11531. module from ``sys.modules`` when import fails.
  11532. - bpo-41979: Star-unpacking is now allowed for with item's targets in the
  11533. PEG parser.
  11534. - bpo-41974: Removed special methods ``__int__``, ``__float__``,
  11535. ``__floordiv__``, ``__mod__``, ``__divmod__``, ``__rfloordiv__``,
  11536. ``__rmod__`` and ``__rdivmod__`` of the :class:`complex` class. They
  11537. always raised a :exc:`TypeError`.
  11538. - bpo-41902: Micro optimization when compute
  11539. :c:member:`~PySequenceMethods.sq_item` and
  11540. :c:member:`~PyMappingMethods.mp_subscript` of :class:`range`. Patch by
  11541. Donghee Na.
  11542. - bpo-41894: When loading a native module and a load failure occurs, prevent
  11543. a possible UnicodeDecodeError when not running in a UTF-8 locale by
  11544. decoding the load error message using the current locale's encoding.
  11545. - bpo-41902: Micro optimization for range.index if step is 1. Patch by
  11546. Donghee Na.
  11547. - bpo-41435: Add ``sys._current_exceptions()`` function to retrieve a
  11548. dictionary mapping each thread's identifier to the topmost exception
  11549. currently active in that thread at the time the function is called.
  11550. - bpo-38605: Enable ``from __future__ import annotations`` (:pep:`563`) by
  11551. default. The values found in :attr:`__annotations__` dicts are now
  11552. strings, e.g. ``{"x": "int"}`` instead of ``{"x": int}``.
  11553. Library
  11554. -------
  11555. - bpo-35455: On Solaris, :func:`~time.thread_time` is now implemented with
  11556. ``gethrvtime()`` because ``clock_gettime(CLOCK_THREAD_CPUTIME_ID)`` is not
  11557. always available. Patch by Jakub Kulik.
  11558. - bpo-42233: The :func:`repr` of :mod:`typing` types containing
  11559. :ref:`Generic Alias Types <types-genericalias>` previously did not show
  11560. the parameterized types in the ``GenericAlias``. They have now been
  11561. changed to do so.
  11562. - bpo-29566: ``binhex.binhex()`` consistently writes macOS 9 line endings.
  11563. - bpo-26789: The :class:`logging.FileHandler` class now keeps a reference to
  11564. the builtin :func:`open` function to be able to open or reopen the file
  11565. during Python finalization. Fix errors like: ``NameError: name 'open' is
  11566. not defined``. Patch by Victor Stinner.
  11567. - bpo-42157: Removed the ``unicodedata.ucnhash_CAPI`` attribute which was an
  11568. internal PyCapsule object. The related private ``_PyUnicode_Name_CAPI``
  11569. structure was moved to the internal C API. Patch by Victor Stinner.
  11570. - bpo-42157: Convert the :mod:`unicodedata` extension module to the
  11571. multiphase initialization API (:pep:`489`) and convert the
  11572. ``unicodedata.UCD`` static type to a heap type. Patch by Mohamed Koubaa
  11573. and Victor Stinner.
  11574. - bpo-42146: Fix memory leak in :func:`subprocess.Popen` in case an uid
  11575. (gid) specified in ``user`` (``group``, ``extra_groups``) overflows
  11576. ``uid_t`` (``gid_t``).
  11577. - bpo-42103: :exc:`~plistlib.InvalidFileException` and :exc:`RecursionError`
  11578. are now the only errors caused by loading malformed binary Plist file
  11579. (previously ValueError and TypeError could be raised in some specific
  11580. cases).
  11581. - bpo-41490: In ``importlib.resources``, ``.path`` method is more aggressive
  11582. about releasing handles to zipfile objects early, enabling use-cases like
  11583. certifi to leave the context open but delete the underlying zip file.
  11584. - bpo-41052: Pickling heap types implemented in C with protocols 0 and 1
  11585. raises now an error instead of producing incorrect data.
  11586. - bpo-42089: In ``importlib.metadata.PackageNotFoundError``, make reference
  11587. to the package metadata being missing to improve the user experience.
  11588. - bpo-41491: plistlib: fix parsing XML plists with hexadecimal integer
  11589. values
  11590. - bpo-42065: Fix an incorrectly formatted error from
  11591. :meth:`_codecs.charmap_decode` when called with a mapped value outside the
  11592. range of valid Unicode code points. PR by Max Bernstein.
  11593. - bpo-41966: Fix pickling pure Python :class:`datetime.time` subclasses.
  11594. Patch by Dean Inwood.
  11595. - bpo-19270: :meth:`sched.scheduler.cancel()` will now cancel the correct
  11596. event, if two events with same priority are scheduled for the same time.
  11597. Patch by Bar Harel.
  11598. - bpo-28660: :func:`textwrap.wrap` now attempts to break long words after
  11599. hyphens when ``break_long_words=True`` and ``break_on_hyphens=True``.
  11600. - bpo-35823: Use ``vfork()`` instead of ``fork()`` for
  11601. :func:`subprocess.Popen` on Linux to improve performance in cases where it
  11602. is deemed safe.
  11603. - bpo-42043: Add support for ``zipfile.Path`` inheritance.
  11604. ``zipfile.Path.is_file()`` now returns False for non-existent names.
  11605. ``zipfile.Path`` objects now expose a ``.filename`` attribute and rely on
  11606. that to resolve ``.name`` and ``.parent`` when the ``Path`` object is at
  11607. the root of the zipfile.
  11608. - bpo-42021: Fix possible ref leaks in :mod:`sqlite3` module init.
  11609. - bpo-39101: Fixed tests using IsolatedAsyncioTestCase from hanging on
  11610. BaseExceptions.
  11611. - bpo-41976: Fixed a bug that was causing :func:`ctypes.util.find_library`
  11612. to return ``None`` when triying to locate a library in an environment when
  11613. gcc>=9 is available and ``ldconfig`` is not. Patch by Pablo Galindo
  11614. - bpo-41943: Fix bug where TestCase.assertLogs doesn't correctly filter
  11615. messages by level.
  11616. - bpo-41923: Implement :pep:`613`, introducing :data:`typing.TypeAlias`
  11617. annotation.
  11618. - bpo-41905: A new function in abc: *update_abstractmethods* to re-calculate
  11619. an abstract class's abstract status. In addition, *dataclass* has been
  11620. changed to call this function.
  11621. - bpo-23706: Added *newline* parameter to ``pathlib.Path.write_text()``.
  11622. - bpo-41876: Tkinter font class repr uses font name
  11623. - bpo-41831: ``str()`` for the ``type`` attribute of the ``tkinter.Event``
  11624. object always returns now the numeric code returned by Tk instead of the
  11625. name of the event type.
  11626. - bpo-39337: :func:`encodings.normalize_encoding` now ignores non-ASCII
  11627. characters.
  11628. - bpo-41747: Ensure all methods that generated from
  11629. :func:`dataclasses.dataclass` objects now have the proper ``__qualname__``
  11630. attribute referring to the class they belong to. Patch by Batuhan Taskaya.
  11631. - bpo-30681: Handle exceptions caused by unparsable date headers when using
  11632. email "default" policy. Patch by Tim Bell, Georges Toth
  11633. - bpo-41586: Add F_SETPIPE_SZ and F_GETPIPE_SZ to fcntl module. Allow
  11634. setting pipesize on subprocess.Popen.
  11635. - bpo-41229: Add ``contextlib.aclosing`` for deterministic cleanup of async
  11636. generators which is analogous to ``contextlib.closing`` for non-async
  11637. generators. Patch by Joongi Kim and John Belmonte.
  11638. - bpo-16396: Allow ``ctypes.wintypes`` to be imported on non-Windows
  11639. systems.
  11640. - bpo-4356: Add a key function to the bisect module.
  11641. - bpo-40592: :func:`shutil.which` now ignores empty entries in
  11642. :envvar:`PATHEXT` instead of treating them as a match.
  11643. - bpo-40492: Fix ``--outfile`` for :mod:`cProfile` / :mod:`profile` not
  11644. writing the output file in the original directory when the program being
  11645. profiled changes the working directory. PR by Anthony Sottile.
  11646. - bpo-34204: The :mod:`shelve` module now uses
  11647. :const:`pickle.DEFAULT_PROTOCOL` by default instead of :mod:`pickle`
  11648. protocol ``3``.
  11649. - bpo-27321: Fixed KeyError exception when flattening an email to a string
  11650. attempts to replace a non-existent Content-Transfer-Encoding header.
  11651. - bpo-38976: The :mod:`http.cookiejar` module now supports the parsing of
  11652. cookies in CURL-style cookiejar files through MozillaCookieJar on all
  11653. platforms. Previously, such cookie entries would be silently ignored when
  11654. loading a cookiejar with such entries.
  11655. Additionally, the HTTP Only attribute is persisted in the object, and will
  11656. be correctly written to file if the MozillaCookieJar object is
  11657. subsequently dumped.
  11658. Documentation
  11659. -------------
  11660. - bpo-42061: Document __format__ functionality for IP addresses.
  11661. - bpo-41910: Document the default implementation of ``object.__eq__``.
  11662. - bpo-42010: Clarify that subscription expressions are also valid for
  11663. certain :term:`classes <class>` and :term:`types <type>` in the standard
  11664. library, and for user-defined classes and types if the classmethod
  11665. :meth:`__class_getitem__` is provided.
  11666. - bpo-41805: Documented :ref:`generic alias type <types-genericalias>` and
  11667. :data:`types.GenericAlias`. Also added an entry in glossary for
  11668. :term:`generic types <generic type>`.
  11669. - bpo-39693: Fix tarfile's extractfile documentation
  11670. - bpo-39416: Document some restrictions on the default string
  11671. representations of numeric classes.
  11672. Tests
  11673. -----
  11674. - bpo-41739: Fix test_logging.test_race_between_set_target_and_flush(): the
  11675. test now waits until all threads complete to avoid leaking running
  11676. threads.
  11677. - bpo-41970: Avoid a test failure in ``test_lib2to3`` if the module has
  11678. already imported at the time the test executes. Patch by Pablo Galindo.
  11679. - bpo-41944: Tests for CJK codecs no longer call ``eval()`` on content
  11680. received via HTTP.
  11681. - bpo-41306: Fixed a failure in ``test_tk.test_widgets.ScaleTest`` happening
  11682. when executing the test with Tk 8.6.10.
  11683. Build
  11684. -----
  11685. - bpo-38980: Add ``-fno-semantic-interposition`` to both the compile and
  11686. link line when building with ``--enable-optimizations``. Patch by Victor
  11687. Stinner and Pablo Galindo.
  11688. Windows
  11689. -------
  11690. - bpo-38439: Updates the icons for IDLE in the Windows Store package.
  11691. - bpo-38252: Use 8-byte step to detect ASCII sequence in 64-bit Windows
  11692. build.
  11693. - bpo-39107: Update Tcl and Tk to 8.6.10 in Windows installer.
  11694. - bpo-41557: Update Windows installer to use SQLite 3.33.0.
  11695. - bpo-38324: Avoid Unicode errors when accessing certain locale data on
  11696. Windows.
  11697. macOS
  11698. -----
  11699. - bpo-41471: Ignore invalid prefix lengths in system proxy excludes.
  11700. IDLE
  11701. ----
  11702. - bpo-33987: Mostly finish using ttk widgets, mainly for editor, settings,
  11703. and searches. Some patches by Mark Roseman.
  11704. - bpo-40511: Typing opening and closing parentheses inside the parentheses
  11705. of a function call will no longer cause unnecessary "flashing" off and on
  11706. of an existing open call-tip, e.g. when typed in a string literal.
  11707. - bpo-38439: Add a 256×256 pixel IDLE icon to the Windows .ico file. Created
  11708. by Andrew Clover. Remove the low-color gif variations from the .ico file.
  11709. C API
  11710. -----
  11711. - bpo-42157: The private ``_PyUnicode_Name_CAPI`` structure of the PyCapsule
  11712. API ``unicodedata.ucnhash_CAPI`` has been moved to the internal C API.
  11713. Patch by Victor Stinner.
  11714. - bpo-42015: Fix potential crash in deallocating method objects when
  11715. dynamically allocated :c:type:`PyMethodDef`'s lifetime is managed through
  11716. the ``self`` argument of a :c:type:`PyCFunction`.
  11717. - bpo-40423: The :mod:`subprocess` module and ``os.closerange`` will now use
  11718. the ``close_range(low, high, flags)`` syscall when it is available for
  11719. more efficient closing of ranges of descriptors.
  11720. - bpo-41845: :c:func:`PyObject_GenericGetDict` is available again in the
  11721. limited API when targeting 3.10 or later.
  11722. - bpo-40422: Add ``_Py_closerange`` function to provide performant closing
  11723. of a range of file descriptors.
  11724. - bpo-41986: :c:data:`!Py_FileSystemDefaultEncodeErrors` and
  11725. :c:data:`!Py_UTF8Mode` are available again in limited API.
  11726. - bpo-41756: Add ``PyIter_Send`` function to allow sending value into
  11727. generator/coroutine/iterator without raising StopIteration exception to
  11728. signal return.
  11729. - bpo-41784: Added ``PyUnicode_AsUTF8AndSize`` to the limited C API.
  11730. What's New in Python 3.10.0 alpha 1?
  11731. ====================================
  11732. *Release date: 2020-10-05*
  11733. Security
  11734. --------
  11735. - bpo-41304: Fixes ``python3x._pth`` being ignored on Windows, caused by the
  11736. fix for :issue:`29778` (CVE-2020-15801).
  11737. - bpo-41162: Audit hooks are now cleared later during finalization to avoid
  11738. missing events.
  11739. - bpo-29778: Ensure :file:`python3.dll` is loaded from correct locations
  11740. when Python is embedded (CVE-2020-15523).
  11741. - bpo-41004: The __hash__() methods of ipaddress.IPv4Interface and
  11742. ipaddress.IPv6Interface incorrectly generated constant hash values of 32
  11743. and 128 respectively. This resulted in always causing hash collisions. The
  11744. fix uses hash() to generate hash values for the tuple of (address, mask
  11745. length, network address).
  11746. - bpo-39603: Prevent http header injection by rejecting control characters
  11747. in http.client.putrequest(...).
  11748. Core and Builtins
  11749. -----------------
  11750. - bpo-41909: Fixed stack overflow in :func:`issubclass` and
  11751. :func:`isinstance` when getting the ``__bases__`` attribute leads to
  11752. infinite recursion.
  11753. - bpo-41922: Speed up calls to ``reversed()`` by using the :pep:`590`
  11754. ``vectorcall`` calling convention. Patch by Donghee Na.
  11755. - bpo-41873: Calls to ``float()`` are now faster due to the ``vectorcall``
  11756. calling convention. Patch by Dennis Sweeney.
  11757. - bpo-41870: Speed up calls to ``bool()`` by using the :pep:`590`
  11758. ``vectorcall`` calling convention. Patch by Donghee Na.
  11759. - bpo-1635741: Port the :mod:`_bisect` module to the multi-phase
  11760. initialization API (:pep:`489`).
  11761. - bpo-39934: Correctly count control blocks in 'except' in compiler. Ensures
  11762. that a syntax error, rather a fatal error, occurs for deeply nested, named
  11763. exception handlers.
  11764. - bpo-41780: Fix :meth:`__dir__` of :class:`types.GenericAlias`. Patch by
  11765. Batuhan Taskaya.
  11766. - bpo-1635741: Port the :mod:`_lsprof` extension module to multi-phase
  11767. initialization (:pep:`489`).
  11768. - bpo-1635741: Port the :mod:`cmath` extension module to multi-phase
  11769. initialization (:pep:`489`).
  11770. - bpo-1635741: Port the :mod:`_scproxy` extension module to multi-phase
  11771. initialization (:pep:`489`).
  11772. - bpo-1635741: Port the :mod:`termios` extension module to multi-phase
  11773. initialization (:pep:`489`).
  11774. - bpo-1635741: Convert the :mod:`_sha256` extension module types to heap
  11775. types.
  11776. - bpo-41690: Fix a possible stack overflow in the parser when parsing
  11777. functions and classes with a huge amount of arguments. Patch by Pablo
  11778. Galindo.
  11779. - bpo-1635741: Port the :mod:`_overlapped` extension module to multi-phase
  11780. initialization (:pep:`489`).
  11781. - bpo-1635741: Port the :mod:`_curses_panel` extension module to multi-phase
  11782. initialization (:pep:`489`).
  11783. - bpo-1635741: Port the :mod:`_opcode` extension module to multi-phase
  11784. initialization (:pep:`489`).
  11785. - bpo-41681: Fixes the wrong error description in the error raised by using
  11786. 2 ``,`` in format string in f-string and :meth:`str.format`.
  11787. - bpo-41675: The implementation of :func:`signal.siginterrupt` now uses
  11788. :c:func:`!sigaction` (if it is available in the system) instead of the
  11789. deprecated :c:func:`!siginterrupt`. Patch by Pablo Galindo.
  11790. - bpo-41670: Prevent line trace being skipped on platforms not compiled with
  11791. ``USE_COMPUTED_GOTOS``. Fixes issue where some lines nested within a
  11792. try-except block were not being traced on Windows.
  11793. - bpo-41654: Fix a crash that occurred when destroying subclasses of
  11794. :class:`MemoryError`. Patch by Pablo Galindo.
  11795. - bpo-1635741: Port the :mod:`zlib` extension module to multi-phase
  11796. initialization (:pep:`489`).
  11797. - bpo-41631: The ``_ast`` module uses again a global state. Using a module
  11798. state per module instance is causing subtle practical problems. For
  11799. example, the Mercurial project replaces the ``__import__()`` function to
  11800. implement lazy import, whereas Python expected that ``import _ast`` always
  11801. return a fully initialized ``_ast`` module.
  11802. - bpo-40077: Convert :mod:`_operator` to use :c:func:`PyType_FromSpec`.
  11803. - bpo-1653741: Port :mod:`_sha3` to multi-phase init. Convert static types
  11804. to heap types.
  11805. - bpo-1635741: Port the :mod:`_blake2` extension module to the multi-phase
  11806. initialization API (:pep:`489`).
  11807. - bpo-41533: Free the stack allocated in ``va_build_stack`` if
  11808. ``do_mkstack`` fails and the stack is not a ``small_stack``.
  11809. - bpo-41531: Fix a bug that was dropping keys when compiling dict literals
  11810. with more than 0xFFFF elements. Patch by Pablo Galindo.
  11811. - bpo-41525: The output of ``python --help`` contains now only ASCII
  11812. characters.
  11813. - bpo-1635741: Port the :mod:`_sha1`, :mod:`_sha512`, and :mod:`_md5`
  11814. extension modules to multi-phase initialization API (:pep:`489`).
  11815. - bpo-41431: Optimize ``dict_merge()`` for copying dict (e.g. ``dict(d)``
  11816. and ``{}.update(d)``).
  11817. - bpo-41428: Implement PEP 604. This supports (int | str) etc. in place of
  11818. Union[str, int].
  11819. - bpo-41340: Removed fallback implementation for ``strdup``.
  11820. - bpo-38156: Handle interrupts that come after EOF correctly in
  11821. ``PyOS_StdioReadline``.
  11822. - bpo-41342: :func:`round` with integer argument is now faster (9--60%).
  11823. - bpo-41334: Constructors :func:`str`, :func:`bytes` and :func:`bytearray`
  11824. are now faster (around 30--40% for small objects).
  11825. - bpo-41295: Resolve a regression in CPython 3.8.4 where defining
  11826. "__setattr__" in a multi-inheritance setup and calling up the hierarchy
  11827. chain could fail if builtins/extension types were involved in the base
  11828. types.
  11829. - bpo-41323: Bytecode optimizations are performed directly on the control
  11830. flow graph. This will result in slightly more compact code objects in some
  11831. circumstances.
  11832. - bpo-41247: Always cache the running loop holder when running
  11833. ``asyncio.set_running_loop``.
  11834. - bpo-41252: Fix incorrect refcounting in _ssl.c's
  11835. ``_servername_callback()``.
  11836. - bpo-1635741: Port :mod:`multiprocessing` to multi-phase initialization
  11837. - bpo-1635741: Port :mod:`winapi` to multiphase initialization
  11838. - bpo-41215: Use non-NULL default values in the PEG parser keyword list to
  11839. overcome a bug that was preventing Python from being properly compiled
  11840. when using the XLC compiler. Patch by Pablo Galindo.
  11841. - bpo-41218: Python 3.8.3 had a regression where compiling with
  11842. ast.PyCF_ALLOW_TOP_LEVEL_AWAIT would aggressively mark list comprehension
  11843. with CO_COROUTINE. Now only list comprehension making use of async/await
  11844. will tagged as so.
  11845. - bpo-1635741: Port :mod:`faulthandler` to multiphase initialization.
  11846. - bpo-1635741: Port :mod:`sha256` to multiphase initialization
  11847. - bpo-41175: Guard against a NULL pointer dereference within bytearrayobject
  11848. triggered by the ``bytearray() + bytearray()`` operation.
  11849. - bpo-41100: add arm64 to the allowable Mac OS arches in mpdecimal.h
  11850. - bpo-41094: Fix decoding errors with audit when open files with non-ASCII
  11851. names on non-UTF-8 locale.
  11852. - bpo-39960: The "hackcheck" that prevents sneaking around a type's
  11853. __setattr__() by calling the superclass method was rewritten to allow C
  11854. implemented heap types.
  11855. - bpo-41084: Prefix the error message with 'f-string: ', when parsing an
  11856. f-string expression which throws a :exc:`SyntaxError`.
  11857. - bpo-40521: Empty frozensets are no longer singletons.
  11858. - bpo-41076: Pre-feed the parser with the location of the f-string
  11859. expression, not the f-string itself, which allows us to skip the shifting
  11860. of the AST node locations after the parsing is completed.
  11861. - bpo-41056: Fixes a reference to deallocated stack space during startup
  11862. when constructing sys.path involving a relative symlink when code was
  11863. supplied via -c. (discovered via Coverity)
  11864. - bpo-41061: Fix incorrect expressions and asserts in hashtable code and
  11865. tests.
  11866. - bpo-41052: Opt out serialization/deserialization for _random.Random
  11867. - bpo-40939: Rename ``PyPegen*`` functions to ``PyParser*``, so that we can
  11868. remove the old set of ``PyParser*`` functions that were using the old
  11869. parser, but keep everything backwards-compatible.
  11870. - bpo-35975: Stefan Behnel reported that cf_feature_version is used even
  11871. when PyCF_ONLY_AST is not set. This is against the intention and against
  11872. the documented behavior, so it's been fixed.
  11873. - bpo-40939: Remove the remaining files from the old parser and the
  11874. :mod:`symbol` module.
  11875. - bpo-40077: Convert :mod:`_bz2` to use :c:func:`PyType_FromSpec`.
  11876. - bpo-41006: The ``encodings.latin_1`` module is no longer imported at
  11877. startup. Now it is only imported when it is the filesystem encoding or the
  11878. stdio encoding.
  11879. - bpo-40636: :func:`zip` now supports :pep:`618`'s ``strict`` parameter,
  11880. which raises a :exc:`ValueError` if the arguments are exhausted at
  11881. different lengths. Patch by Brandt Bucher.
  11882. - bpo-1635741: Port :mod:`_gdbm` to multiphase initialization.
  11883. - bpo-40985: Fix a bug that caused the :exc:`SyntaxError` text to be empty
  11884. when a file ends with a line ending in a line continuation character (i.e.
  11885. backslash). The error text should contain the text of the last line.
  11886. - bpo-40958: Fix a possible buffer overflow in the PEG parser when gathering
  11887. information for emitting syntax errors. Patch by Pablo Galindo.
  11888. - bpo-1635741: Port :mod:`_dbm` to multiphase initialization.
  11889. - bpo-40957: Fix refleak in _Py_fopen_obj() when PySys_Audit() fails
  11890. - bpo-40950: Add a state to the :mod:`nis` module (:pep:`3121`) and apply
  11891. the multiphase initialization. Patch by Donghee Na.
  11892. - bpo-40947: The Python :ref:`Path Configuration <init-path-config>` now
  11893. takes :c:member:`PyConfig.platlibdir` in account.
  11894. - bpo-40939: Remove the old parser, the :mod:`parser` module and all
  11895. associated support code, command-line options and environment variables.
  11896. Patch by Pablo Galindo.
  11897. - bpo-40847: Fix a bug where a line with only a line continuation character
  11898. is not considered a blank line at tokenizer level. In such cases, more
  11899. than a single ``NEWLINE`` token was emitted. The old parser was working
  11900. around the issue, but the new parser threw a :exc:`SyntaxError` for valid
  11901. input due to this. For example, an empty line following a line
  11902. continuation character was interpreted as a :exc:`SyntaxError`.
  11903. - bpo-40890: Each dictionary view now has a ``mapping`` attribute that
  11904. provides a :class:`types.MappingProxyType` wrapping the original
  11905. dictionary. Patch contributed by Dennis Sweeney.
  11906. - bpo-40889: Improved the performance of symmetric difference operations on
  11907. dictionary item views. Patch by Dennis Sweeney.
  11908. - bpo-40904: Fix possible segfault in the new PEG parser when parsing
  11909. f-string containing yield statements with no value (:code:`f"{yield}"`).
  11910. Patch by Pablo Galindo
  11911. - bpo-40903: Fixed a possible segfault in the new PEG parser when producing
  11912. error messages for invalid assignments of the form :code:`p=p=`. Patch by
  11913. Pablo Galindo
  11914. - bpo-40880: Fix invalid memory read in the new parser when checking
  11915. newlines in string literals. Patch by Pablo Galindo.
  11916. - bpo-40883: Fix memory leak in when parsing f-strings in the new parser.
  11917. Patch by Pablo Galindo
  11918. - bpo-40870: Raise :exc:`ValueError` when validating custom AST's where the
  11919. constants ``True``, ``False`` and ``None`` are used within a
  11920. :class:`ast.Name` node.
  11921. - bpo-40854: Allow overriding :data:`sys.platlibdir` via a new
  11922. :envvar:`PYTHONPLATLIBDIR` environment variable.
  11923. - bpo-40826: Fix GIL usage in :c:func:`PyOS_Readline`: lock the GIL to set
  11924. an exception and pass the Python thread state when checking if there is a
  11925. pending signal.
  11926. - bpo-1635741: Port :mod:`fcntl` to multiphase initialization.
  11927. - bpo-19468: Delete unnecessary instance check in importlib.reload(). Patch
  11928. by Furkan Önder.
  11929. - bpo-40824: Unexpected errors in calling the ``__iter__`` method are no
  11930. longer masked by ``TypeError`` in the :keyword:`in` operator and functions
  11931. :func:`~operator.contains`, :func:`~operator.indexOf` and
  11932. :func:`~operator.countOf` of the :mod:`operator` module.
  11933. - bpo-40792: Attributes ``start``, ``stop`` and ``step`` of the
  11934. :class:`range` object now always has exact type :class:`int`. Previously,
  11935. they could have been an instance of a subclass of ``int``.
  11936. - bpo-40780: Fix a corner case where g-style string formatting of a float
  11937. failed to remove trailing zeros.
  11938. - bpo-38964: When there's a :exc:`SyntaxError` in the expression part of an
  11939. fstring, the filename attribute of the :exc:`SyntaxError` gets correctly
  11940. set to the name of the file the fstring resides in.
  11941. - bpo-40750: Support the "-d" debug flag in the new PEG parser. Patch by
  11942. Pablo Galindo
  11943. - bpo-40217: Instances of types created with
  11944. :c:func:`PyType_FromSpecWithBases` will no longer automatically visit
  11945. their class object when traversing references in the garbage collector.
  11946. The user is expected to manually visit the object's class. Patch by Pablo
  11947. Galindo.
  11948. - bpo-39573: :c:func:`Py_TYPE()` is changed to the inline static function.
  11949. Patch by Donghee Na.
  11950. - bpo-40696: Fix a hang that can arise after :meth:`generator.throw` due to
  11951. a cycle in the exception context chain.
  11952. - bpo-40521: Each interpreter now its has own free lists, singletons and
  11953. caches:
  11954. * Free lists: float, tuple, list, dict, frame, context,
  11955. asynchronous generator, MemoryError.
  11956. * Singletons: empty tuple, empty bytes string, empty Unicode string,
  11957. single byte character, single Unicode (latin1) character.
  11958. * Slice cache.
  11959. They are no longer shared by all interpreters.
  11960. - bpo-40679: Certain :exc:`TypeError` messages about missing or extra
  11961. arguments now include the function's :term:`qualified name`. Patch by
  11962. Dennis Sweeney.
  11963. - bpo-29590: Make the stack trace correct after calling
  11964. :meth:`generator.throw` on a generator that has yielded from a ``yield
  11965. from``.
  11966. - bpo-4022: Improve performance of generators by not raising internal
  11967. StopIteration.
  11968. - bpo-1635741: Port :mod:`mmap` to multiphase initialization.
  11969. - bpo-1635741: Port :mod:`_lzma` to multiphase initialization.
  11970. - bpo-37999: Builtin and extension functions that take integer arguments no
  11971. longer accept :class:`~decimal.Decimal`\ s, :class:`~fractions.Fraction`\
  11972. s and other objects that can be converted to integers only with a loss
  11973. (e.g. that have the :meth:`~object.__int__` method but do not have the
  11974. :meth:`~object.__index__` method).
  11975. - bpo-29882: Add :meth:`int.bit_count()`, counting the number of ones in the
  11976. binary representation of an integer. Patch by Niklas Fiekas.
  11977. - bpo-36982: Use ncurses extended color functions when available to support
  11978. terminals with 256 colors, and add the new function
  11979. :func:`curses.has_extended_color_support` to indicate whether extended
  11980. color support is provided by the underlying ncurses library.
  11981. - bpo-19569: Add the private macros ``_Py_COMP_DIAG_PUSH``,
  11982. ``_Py_COMP_DIAG_IGNORE_DEPR_DECLS``, and ``_Py_COMP_DIAG_POP``.
  11983. - bpo-26680: The int type now supports the x.is_integer() method for
  11984. compatibility with float.
  11985. Library
  11986. -------
  11987. - bpo-41900: C14N 2.0 serialisation in xml.etree.ElementTree failed for
  11988. unprefixed attributes when a default namespace was defined.
  11989. - bpo-41887: Strip leading spaces and tabs on :func:`ast.literal_eval`. Also
  11990. document stripping of spaces and tabs for :func:`eval`.
  11991. - bpo-41773: Note in documentation that :func:`random.choices` doesn't
  11992. support non-finite weights, raise :exc:`ValueError` when given non-finite
  11993. weights.
  11994. - bpo-41840: Fix a bug in the :mod:`symtable` module that was causing
  11995. module-scope global variables to not be reported as both local and global.
  11996. Patch by Pablo Galindo.
  11997. - bpo-41842: Add :func:`codecs.unregister` function to unregister a codec
  11998. search function.
  11999. - bpo-40564: In ``zipfile.Path``, mutate the passed ZipFile object type
  12000. instead of making a copy. Prevents issues when both the local copy and the
  12001. caller’s copy attempt to close the same file handle.
  12002. - bpo-40670: More reliable validation of statements in
  12003. :class:`timeit.Timer`. It now accepts "empty" statements (only whitespaces
  12004. and comments) and rejects misindentent statements.
  12005. - bpo-41833: The :class:`threading.Thread` constructor now uses the target
  12006. name if the *target* argument is specified but the *name* argument is
  12007. omitted.
  12008. - bpo-41817: fix ``tkinter.EventType`` Enum so all members are strings, and
  12009. none are tuples
  12010. - bpo-41810: :data:`types.EllipsisType`, :data:`types.NotImplementedType`
  12011. and :data:`types.NoneType` have been reintroduced, providing a new set of
  12012. types readily interpretable by static type checkers.
  12013. - bpo-41815: Fix SQLite3 segfault when backing up closed database. Patch
  12014. contributed by Peter David McCormick.
  12015. - bpo-41816: StrEnum added: it ensures that all members are already strings
  12016. or string candidates
  12017. - bpo-41517: fix bug allowing Enums to be extended via multiple inheritance
  12018. - bpo-39587: use the correct mix-in data type when constructing Enums
  12019. - bpo-41792: Add is_typeddict function to typing.py to check if a type is a
  12020. TypedDict class
  12021. Previously there was no way to check that without using private API. See
  12022. the `relevant issue in python/typing
  12023. <https://github.com/python/typing/issues/751>`_.
  12024. - bpo-41789: Honor ``object`` overrides in ``Enum`` class creation
  12025. (specifically, ``__str__``, ``__repr__``, ``__format__``, and
  12026. ``__reduce_ex__``).
  12027. - bpo-32218: ``enum.Flag`` and ``enum.IntFlag`` members are now iterable.
  12028. - bpo-39651: Fix a race condition in the ``call_soon_threadsafe()`` method
  12029. of ``asyncio.ProactorEventLoop``: do nothing if the self-pipe socket has
  12030. been closed.
  12031. - bpo-1635741: Port the ``mashal`` extension module to the multi-phase
  12032. initialization API (:pep:`489`).
  12033. - bpo-1635741: Port the ``_string`` extension module to the multi-phase
  12034. initialization API (:pep:`489`).
  12035. - bpo-41732: Added an :term:`iterator` to :class:`memoryview`.
  12036. - bpo-41720: Fixed :meth:`turtle.Vec2D.__rmul__` for arguments which are not
  12037. int or float.
  12038. - bpo-41696: Fix handling of debug mode in :func:`asyncio.run`. This allows
  12039. setting ``PYTHONASYNCIODEBUG`` or ``-X dev`` to enable asyncio debug mode
  12040. when using :func:`asyncio.run`.
  12041. - bpo-41687: Fix implementation of sendfile to be compatible with Solaris.
  12042. - bpo-41662: No longer override exceptions raised in ``__len__()`` of a
  12043. sequence of parameters in :mod:`sqlite3` with
  12044. :exc:`~sqlite3.ProgrammingError`.
  12045. - bpo-39010: Restarting a ``ProactorEventLoop`` on Windows no longer logs
  12046. spurious ``ConnectionResetErrors``.
  12047. - bpo-41638: :exc:`~sqlite3.ProgrammingError` message for absent parameter
  12048. in :mod:`sqlite3` contains now the name of the parameter instead of its
  12049. index when parameters are supplied as a dict.
  12050. - bpo-41662: Fixed crash when mutate list of parameters during iteration in
  12051. :mod:`sqlite3`.
  12052. - bpo-41513: Improved the accuracy of math.hypot(). Internally, each step
  12053. is computed with extra precision so that the result is now almost always
  12054. correctly rounded.
  12055. - bpo-41609: The pdb whatis command correctly reports instance methods as
  12056. 'Method' rather than 'Function'.
  12057. - bpo-39994: Fixed pprint's handling of dict subclasses that override
  12058. __repr__.
  12059. - bpo-32751: When cancelling the task due to a timeout,
  12060. :meth:`asyncio.wait_for` will now wait until the cancellation is complete
  12061. also in the case when *timeout* is <= 0, like it does with positive
  12062. timeouts.
  12063. - bpo-37658: :meth:`asyncio.wait_for` now properly handles races between
  12064. cancellation of itself and the completion of the wrapped awaitable.
  12065. - bpo-40782: Change the method asyncio.AbstractEventLoop.run_in_executor to
  12066. not be a coroutine.
  12067. - bpo-41520: Fix :mod:`codeop` regression that prevented turning compile
  12068. warnings into errors.
  12069. - bpo-41528: turtle uses math module functions to convert degrees to radians
  12070. and vice versa and to calculate vector norm
  12071. - bpo-41513: Minor algorithmic improvement to math.hypot() and math.dist()
  12072. giving small gains in speed and accuracy.
  12073. - bpo-41503: Fixed a race between setTarget and flush in
  12074. logging.handlers.MemoryHandler.
  12075. - bpo-41497: Fix potential UnicodeDecodeError in dis module.
  12076. - bpo-41467: On Windows, fix asyncio ``recv_into()`` return value when the
  12077. socket/pipe is closed (:exc:`BrokenPipeError`): return ``0`` rather than
  12078. an empty byte string (``b''``).
  12079. - bpo-41425: Make tkinter doc example runnable.
  12080. - bpo-41421: Make an algebraic simplification to random.paretovariate(). It
  12081. now is slightly less subject to round-off error and is slightly faster.
  12082. Inputs that used to cause ZeroDivisionError now cause an OverflowError
  12083. instead.
  12084. - bpo-41440: Add :func:`os.cpu_count()` support for VxWorks RTOS.
  12085. - bpo-41316: Fix the :mod:`tarfile` module to write only basename of TAR
  12086. file to GZIP compression header.
  12087. - bpo-41384: Raise TclError instead of TypeError when an unknown option is
  12088. passed to tkinter.OptionMenu.
  12089. - bpo-41317: Use add_done_callback() in asyncio.loop.sock_accept() to
  12090. unsubscribe reader early on cancellation.
  12091. - bpo-41364: Reduce import overhead of :mod:`uuid`.
  12092. - bpo-35328: Set the environment variable ``VIRTUAL_ENV_PROMPT`` at
  12093. :mod:`venv` activation.
  12094. - bpo-41341: Recursive evaluation of ``typing.ForwardRef`` in
  12095. ``get_type_hints``.
  12096. - bpo-41344: Prevent creating :class:`shared_memory.SharedMemory` objects
  12097. with :code:`size=0`.
  12098. - bpo-41333: :meth:`collections.OrderedDict.pop` is now 2 times faster.
  12099. - bpo-41288: Unpickling invalid NEWOBJ_EX opcode with the C implementation
  12100. raises now UnpicklingError instead of crashing.
  12101. - bpo-39017: Avoid infinite loop when reading specially crafted TAR files
  12102. using the tarfile module (CVE-2019-20907).
  12103. - bpo-41273: Speed up any transport using ``_ProactorReadPipeTransport`` by
  12104. calling ``recv_into`` instead of ``recv``, thus not creating a new buffer
  12105. for each ``recv`` call in the transport's read loop.
  12106. - bpo-41235: Fix the error handling in
  12107. :meth:`ssl.SSLContext.load_dh_params`.
  12108. - bpo-41207: In distutils.spawn, restore expectation that DistutilsExecError
  12109. is raised when the command is not found.
  12110. - bpo-29727: Register :class:`array.array` as a
  12111. :class:`~collections.abc.MutableSequence`. Patch by Pablo Galindo.
  12112. - bpo-39168: Remove the ``__new__`` method of :class:`typing.Generic`.
  12113. - bpo-41194: Fix a crash in the ``_ast`` module: it can no longer be loaded
  12114. more than once. It now uses a global state rather than a module state.
  12115. - bpo-41195: Add read-only ssl.SSLContext.security_level attribute to
  12116. retrieve the context's security level.
  12117. - bpo-41193: The ``write_history()`` atexit function of the readline
  12118. completer now ignores any :exc:`OSError` to ignore error if the filesystem
  12119. is read-only, instead of only ignoring :exc:`FileNotFoundError` and
  12120. :exc:`PermissionError`.
  12121. - bpo-41182: selector: use DefaultSelector based upon implementation
  12122. - bpo-41161: The decimal module now requires libmpdec-2.5.0. Users of
  12123. --with-system-libmpdec should update their system library.
  12124. - bpo-40874: The decimal module now requires libmpdec-2.5.0.
  12125. - bpo-41138: Fixed the :mod:`trace` module CLI for Python source files with
  12126. non-UTF-8 encoding.
  12127. - bpo-31082: Use the term "iterable" in the docstring for
  12128. :func:`functools.reduce`.
  12129. - bpo-40521: Remove freelist from collections.deque().
  12130. - bpo-31938: Fix default-value signatures of several functions in the
  12131. :mod:`select` module - by Anthony Sottile.
  12132. - bpo-41068: Fixed reading files with non-ASCII names from ZIP archive
  12133. directly after writing them.
  12134. - bpo-41058: :func:`pdb.find_function` now correctly determines the source
  12135. file encoding.
  12136. - bpo-41056: Invalid file descriptor values are now prevented from being
  12137. passed to os.fpathconf. (discovered by Coverity)
  12138. - bpo-41056: Fix a NULL pointer dereference within the ssl module during a
  12139. MemoryError in the keylog callback. (discovered by Coverity)
  12140. - bpo-41056: Fixed an instance where a MemoryError within the zoneinfo
  12141. module might not be reported or not reported at its source. (found by
  12142. Coverity)
  12143. - bpo-41048: :func:`mimetypes.read_mime_types` function reads the rule file
  12144. using UTF-8 encoding, not the locale encoding. Patch by Srinivas Reddy
  12145. Thatiparthy.
  12146. - bpo-41043: Fixed the use of :func:`~glob.glob` in the stdlib: literal part
  12147. of the path is now always correctly escaped.
  12148. - bpo-41025: Fixed an issue preventing the C implementation of
  12149. :class:`zoneinfo.ZoneInfo` from being subclassed.
  12150. - bpo-35018: Add the :class:`xml.sax.handler.LexicalHandler` class that is
  12151. present in other SAX XML implementations.
  12152. - bpo-41002: Improve performance of HTTPResponse.read with a given amount.
  12153. Patch by Bruce Merry.
  12154. - bpo-40448: :mod:`ensurepip` now disables the use of ``pip`` cache when
  12155. installing the bundled versions of ``pip`` and ``setuptools``. Patch by
  12156. Krzysztof Konopko.
  12157. - bpo-40967: Removed :meth:`asyncio.Task.current_task` and
  12158. :meth:`asyncio.Task.all_tasks`. Patch contributed by Rémi Lapeyre.
  12159. - bpo-40924: Ensure ``importlib.resources.path`` returns an extant path for
  12160. the SourceFileLoader's resource reader. Avoids the regression identified
  12161. in master while a long-term solution is devised.
  12162. - bpo-40955: Fix a minor memory leak in :mod:`subprocess` module when
  12163. extra_groups was specified.
  12164. - bpo-40855: The standard deviation and variance functions in the statistics
  12165. module were ignoring their mu and xbar arguments.
  12166. - bpo-40939: Use the new PEG parser when generating the stdlib
  12167. :mod:`keyword` module.
  12168. - bpo-23427: Add :data:`sys.orig_argv` attribute: the list of the original
  12169. command line arguments passed to the Python executable.
  12170. - bpo-33689: Ignore empty or whitespace-only lines in .pth files. This
  12171. matches the documentated behavior. Before, empty lines caused the
  12172. site-packages dir to appear multiple times in sys.path. By Ido Michael,
  12173. contributors Malcolm Smith and Tal Einat.
  12174. - bpo-40884: Added a ``defaults`` parameter to :class:`logging.Formatter`,
  12175. to allow specifying default values for custom fields. Patch by Asaf Alon
  12176. and Bar Harel.
  12177. - bpo-40876: Clarify error message in the :mod:`csv` module.
  12178. - bpo-39791: Refresh importlib.metadata from importlib_metadata 1.6.1.
  12179. - bpo-40807: Stop codeop._maybe_compile, used by code.InteractiveInterpreter
  12180. (and IDLE). from emitting each warning three times.
  12181. - bpo-32604: Fix reference leak in the :mod:`select` module when the module
  12182. is imported in a subinterpreter.
  12183. - bpo-39791: Built-in loaders (SourceFileLoader and ZipImporter) now supply
  12184. ``TraversableResources`` implementations for ``ResourceReader``, and the
  12185. fallback function has been removed.
  12186. - bpo-39314: :class:`rlcompleter.Completer` and the standard Python shell
  12187. now close the parenthesis for functions that take no arguments. Patch
  12188. contributed by Rémi Lapeyre.
  12189. - bpo-17005: The topological sort functionality that was introduced
  12190. initially in the :mod:`functools` module has been moved to a new
  12191. :mod:`graphlib` module to better accommodate the new tools and keep the
  12192. original scope of the :mod:`functools` module. Patch by Pablo Galindo
  12193. - bpo-40834: Fix truncate when sending str object
  12194. with_xxsubinterpreters.channel_send.
  12195. - bpo-40755: Add rich comparisons to collections.Counter().
  12196. - bpo-26407: Unexpected errors in calling the ``__iter__`` method are no
  12197. longer masked by ``TypeError`` in :func:`csv.reader`,
  12198. :func:`csv.writer.writerow` and :meth:`csv.writer.writerows`.
  12199. - bpo-39384: Fixed email.contentmanager to allow set_content() to set a null
  12200. string.
  12201. - bpo-40744: The :mod:`sqlite3` module uses SQLite API functions that
  12202. require SQLite v3.7.3 or higher. This patch removes support for older
  12203. SQLite versions, and explicitly requires SQLite 3.7.3 both at build,
  12204. compile and runtime. Patch by Sergey Fedoseev and Erlend E. Aasland.
  12205. - bpo-40777: Initialize PyDateTime_IsoCalendarDateType.tp_base at run-time
  12206. to avoid errors on some compilers.
  12207. - bpo-38488: Update ensurepip to install pip 20.1.1 and setuptools 47.1.0.
  12208. - bpo-40792: The result of :func:`operator.index` now always has exact type
  12209. :class:`int`. Previously, the result could have been an instance of a
  12210. subclass of ``int``.
  12211. - bpo-40767: :mod:`webbrowser` now properly finds the default browser in
  12212. pure Wayland systems by checking the WAYLAND_DISPLAY environment variable.
  12213. Patch contributed by Jérémy Attali.
  12214. - bpo-40791: :func:`hashlib.compare_digest` uses OpenSSL's
  12215. ``CRYPTO_memcmp()`` function when OpenSSL is available.
  12216. - bpo-40795: :mod:`ctypes` module: If ctypes fails to convert the result of
  12217. a callback or if a ctypes callback function raises an exception,
  12218. sys.unraisablehook is now called with an exception set. Previously, the
  12219. error was logged into stderr by :c:func:`PyErr_Print`.
  12220. - bpo-16995: Add :func:`base64.b32hexencode` and :func:`base64.b32hexdecode`
  12221. to support the Base32 Encoding with Extended Hex Alphabet.
  12222. - bpo-30008: Fix :mod:`ssl` code to be compatible with OpenSSL 1.1.x builds
  12223. that use ``no-deprecated`` and ``--api=1.1.0``.
  12224. - bpo-30064: Fix asyncio ``loop.sock_*`` race condition issue
  12225. - bpo-40759: Deprecate the :mod:`symbol` module.
  12226. - bpo-40756: The second argument (extra) of ``LoggerAdapter.__init__`` now
  12227. defaults to None.
  12228. - bpo-37129: Add a new :const:`os.RWF_APPEND` flag for :func:`os.pwritev`.
  12229. - bpo-40737: Fix possible reference leak for :mod:`sqlite3` initialization.
  12230. - bpo-40726: Handle cases where the ``end_lineno`` is ``None`` on
  12231. :func:`ast.increment_lineno`.
  12232. - bpo-40698: ``distutils`` upload creates SHA2-256 and Blake2b-256 digests.
  12233. MD5 digests is skipped if platform blocks MD5.
  12234. - bpo-40695: :mod:`hashlib` no longer falls back to builtin hash
  12235. implementations when OpenSSL provides a hash digest and the algorithm is
  12236. blocked by security policy.
  12237. - bpo-9216: :func:`hashlib.new` passed ``usedforsecurity`` to OpenSSL EVP
  12238. constructor ``_hashlib.new()``. test_hashlib and test_smtplib handle
  12239. strict security policy better.
  12240. - bpo-40614: :func:`ast.parse` will not parse self documenting expressions
  12241. in f-strings when passed ``feature_version`` is less than ``(3, 8)``.
  12242. - bpo-40626: Add h5 file extension as MIME Type application/x-hdf5, as per
  12243. HDF Group recommendation for HDF5 formatted data files. Patch contributed
  12244. by Mark Schwab.
  12245. - bpo-25920: On macOS, when building Python for macOS 10.4 and older, which
  12246. wasn't the case for python.org macOS installer, :func:`socket.getaddrinfo`
  12247. no longer uses an internal lock to prevent race conditions when calling
  12248. ``getaddrinfo()`` which is thread-safe since macOS 10.5. Python 3.9
  12249. requires macOS 10.6 or newer. The internal lock caused random hang on fork
  12250. when another thread was calling :func:`socket.getaddrinfo`. The lock was
  12251. also used on FreeBSD older than 5.3, OpenBSD older than 201311 and NetBSD
  12252. older than 4.
  12253. - bpo-40671: Prepare ``_hashlib`` for :pep:`489` and use
  12254. :c:func:`PyModule_AddType`.
  12255. - bpo-32309: Added a new :term:`coroutine` :func:`asyncio.to_thread`. It is
  12256. mainly used for running IO-bound functions in a separate thread to avoid
  12257. blocking the event loop, and essentially works as a high-level version of
  12258. :meth:`~asyncio.loop.run_in_executor` that can directly take keyword
  12259. arguments.
  12260. - bpo-36543: Restored the deprecated :mod:`xml.etree.cElementTree` module.
  12261. - bpo-40611: :const:`~mmap.MAP_POPULATE` constant has now been added to the
  12262. list of exported :mod:`mmap` module flags.
  12263. - bpo-39881: PEP 554 for use in the test suite. (Patch By Joannah Nanjekye)
  12264. - bpo-13097: ``ctypes`` now raises an ``ArgumentError`` when a callback is
  12265. invoked with more than 1024 arguments.
  12266. - bpo-39385: A new test assertion context-manager,
  12267. :func:`unittest.assertNoLogs` will ensure a given block of code emits no
  12268. log messages using the logging module. Contributed by Kit Yan Choi.
  12269. - bpo-23082: Updated the error message and docs of PurePath.relative_to() to
  12270. better reflect the function behaviour.
  12271. - bpo-40318: Use SQLite3 trace v2 API, if it is available.
  12272. - bpo-40105: ZipFile truncates files to avoid corruption when a shorter
  12273. comment is provided in append ("a") mode. Patch by Jan Mazur.
  12274. - bpo-40084: Fix ``Enum.__dir__``: dir(Enum.member) now includes attributes
  12275. as well as methods.
  12276. - bpo-31122: ssl.wrap_socket() now raises ssl.SSLEOFError rather than
  12277. OSError when peer closes connection during TLS negotiation
  12278. - bpo-39728: fix default ``_missing_`` so a duplicate ``ValueError`` is not
  12279. set as the ``__context__`` of the original ``ValueError``.
  12280. - bpo-39244: Fixed :class:`multiprocessing.context.get_all_start_methods` to
  12281. properly return the default method first on macOS.
  12282. - bpo-39040: Fix parsing of invalid mime headers parameters by collapsing
  12283. whitespace between encoded words in a bare-quote-string.
  12284. - bpo-38731: Add ``--quiet`` option to command-line interface of
  12285. :mod:`py_compile`. Patch by Gregory Schevchenko.
  12286. - bpo-35714: :exc:`struct.error` is now raised if there is a null character
  12287. in a :mod:`struct` format string.
  12288. - bpo-38144: Added the *root_dir* and *dir_fd* parameters in
  12289. :func:`glob.glob`.
  12290. - bpo-26543: Fix :meth:`IMAP4.noop()` when debug mode is enabled (ex:
  12291. ``imaplib.Debug = 3``).
  12292. - bpo-12178: :func:`csv.writer` now correctly escapes *escapechar* when
  12293. input contains *escapechar*. Patch by Catalin Iacob, Berker Peksag, and
  12294. Itay Elbirt.
  12295. - bpo-36290: AST nodes are now raising :exc:`TypeError` on conflicting
  12296. keyword arguments. Patch contributed by Rémi Lapeyre.
  12297. - bpo-33944: Added site.py site-packages tracing in verbose mode.
  12298. - bpo-35078: Refactor formatweekday, formatmonthname methods in
  12299. LocaleHTMLCalendar and LocaleTextCalendar classes in calendar module to
  12300. call the base class methods.This enables customizable CSS classes for
  12301. LocaleHTMLCalendar. Patch by Srinivas Reddy Thatiparthy
  12302. - bpo-29620: :func:`~unittest.TestCase.assertWarns` no longer raises a
  12303. ``RuntimeException`` when accessing a module's ``__warningregistry__``
  12304. causes importation of a new module, or when a new module is imported in
  12305. another thread. Patch by Kernc.
  12306. - bpo-31844: Remove ``ParserBase.error()`` method from the private and
  12307. undocumented ``_markupbase`` module. :class:`html.parser.HTMLParser` is
  12308. the only subclass of ``ParserBase`` and its ``error()`` implementation was
  12309. deprecated in Python 3.4 and removed in Python 3.5.
  12310. - bpo-34226: Fix ``cgi.parse_multipart`` without content_length. Patch by
  12311. Roger Duran
  12312. - bpo-33660: Fix pathlib.PosixPath to resolve a relative path located on the
  12313. root directory properly.
  12314. - bpo-28557: Improve the error message for a misbehaving ``rawio.readinto``
  12315. - bpo-26680: The d.is_integer() method is added to the Decimal type, for
  12316. compatibility with other number types.
  12317. - bpo-26680: The x.is_integer() method is incorporated into the abstract
  12318. types of the numeric tower, Real, Rational and Integral, with appropriate
  12319. default implementations.
  12320. Documentation
  12321. -------------
  12322. - bpo-41428: Add documentation for :pep:`604` (Allow writing union types as
  12323. ``X | Y``).
  12324. - bpo-41774: In Programming FAQ "Sequences (Tuples/Lists)" section, add "How
  12325. do you remove multiple items from a list".
  12326. - bpo-35293: Fix RemovedInSphinx40Warning when building the documentation.
  12327. Patch by Donghee Na.
  12328. - bpo-37149: Change Shipman tkinter doc link from archive.org to TkDocs.
  12329. (The doc has been removed from the NMT server.) The new link responds
  12330. much faster and includes a short explanatory note.
  12331. - bpo-41726: Update the refcounts info of ``PyType_FromModuleAndSpec``.
  12332. - bpo-41624: Fix the signature of :class:`typing.Coroutine`.
  12333. - bpo-40204: Enable Sphinx 3.2 ``c_allow_pre_v3`` option and disable
  12334. ``c_warn_on_allowed_pre_v3`` option to make the documentation compatible
  12335. with Sphinx 2 and Sphinx 3.
  12336. - bpo-41045: Add documentation for debug feature of f-strings.
  12337. - bpo-41314: Changed the release when ``from __future__ import annotations``
  12338. becomes the default from ``4.0`` to ``3.10`` (following a change in PEP
  12339. 563).
  12340. - bpo-40979: Refactored typing.rst, arranging more than 70 classes,
  12341. functions, and decorators into new sub-sections.
  12342. - bpo-40552: Fix in tutorial section 4.2. Code snippet is now correct.
  12343. - bpo-39883: Make code, examples, and recipes in the Python documentation be
  12344. licensed under the more permissive BSD0 license in addition to the
  12345. existing Python 2.0 license.
  12346. - bpo-37703: Updated Documentation to comprehensively elaborate on the
  12347. behaviour of gather.cancel()
  12348. Tests
  12349. -----
  12350. - bpo-41939: Fix test_site.test_license_exists_at_url(): call
  12351. ``urllib.request.urlcleanup()`` to reset the global
  12352. ``urllib.request._opener``. Patch by Victor Stinner.
  12353. - bpo-41731: Make test_cmd_line_script pass with option '-vv'.
  12354. - bpo-41602: Add tests for SIGINT handling in the runpy module.
  12355. - bpo-41521: :mod:`test.support`: Rename ``blacklist`` parameter of
  12356. :func:`~test.support.check__all__` to ``not_exported``.
  12357. - bpo-41477: Make ctypes optional in test_genericalias.
  12358. - bpo-41085: Fix integer overflow in the :meth:`array.array.index` method on
  12359. 64-bit Windows for index larger than ``2**31``.
  12360. - bpo-41069: :data:`test.support.TESTFN` and the current directory for tests
  12361. when run via ``test.regrtest`` contain now non-ascii characters if
  12362. possible.
  12363. - bpo-38377: On Linux, skip tests using multiprocessing if the current user
  12364. cannot create a file in ``/dev/shm/`` directory. Add the
  12365. :func:`~test.support.skip_if_broken_multiprocessing_synchronize` function
  12366. to the :mod:`test.support` module.
  12367. - bpo-41009: Fix use of ``support.require_{linux|mac|freebsd}_version()``
  12368. decorators as class decorator.
  12369. - bpo-41003: Fix ``test_copyreg`` when ``numpy`` is installed:
  12370. ``test.pickletester`` now saves/restores warnings filters when importing
  12371. ``numpy``, to ignore filters installed by ``numpy``.
  12372. - bpo-40964: Disable remote :mod:`imaplib` tests, host cyrus.andrew.cmu.edu
  12373. is blocking incoming connections.
  12374. - bpo-40927: Fix test_binhex when run twice: it now uses
  12375. import_fresh_module() to ensure that it raises DeprecationWarning each
  12376. time.
  12377. - bpo-17258: Skip some :mod:`multiprocessing` tests when MD5 hash digest is
  12378. blocked.
  12379. - bpo-31904: Increase LOOPBACK_TIMEOUT to 10 for VxWorks RTOS.
  12380. - bpo-38169: Increase code coverage for SharedMemory and ShareableList
  12381. - bpo-34401: Make test_gdb properly run on HP-UX. Patch by Michael Osipov.
  12382. Build
  12383. -----
  12384. - bpo-38249: Update :c:macro:`Py_UNREACHABLE` to use __builtin_unreachable()
  12385. if only the compiler is able to use it. Patch by Donghee Na.
  12386. - bpo-41617: Fix ``pycore_bitutils.h`` header file to support old clang
  12387. versions: ``__builtin_bswap16()`` is not available in LLVM clang 3.0.
  12388. - bpo-40204: Pin Sphinx version to 2.3.1 in ``Doc/Makefile``.
  12389. - bpo-36020: The C99 functions :c:func:`snprintf` and :c:func:`vsnprintf`
  12390. are now required to build Python.
  12391. - bpo-40684: ``make install`` now uses the ``PLATLIBDIR`` variable for the
  12392. destination ``lib-dynload/`` directory when ``./configure
  12393. --with-platlibdir`` is used.
  12394. - bpo-40683: Fixed an issue where the :mod:`zoneinfo` module and its tests
  12395. were not included when Python is installed with ``make``.
  12396. Windows
  12397. -------
  12398. - bpo-41744: Fixes automatic import of props file when using the Nuget
  12399. package.
  12400. - bpo-41627: The user site directory for 32-bit now includes a ``-32``
  12401. suffix to distinguish it from the 64-bit interpreter's directory.
  12402. - bpo-41526: Fixed layout of final page of the installer by removing the
  12403. special thanks to Mark Hammond (with his permission).
  12404. - bpo-41492: Fixes the description that appears in UAC prompts.
  12405. - bpo-40948: Improve post-install message to direct people to the "py"
  12406. command.
  12407. - bpo-41412: The installer will now fail to install on Windows 7 and Windows
  12408. 8. Further, the UCRT dependency is now always downloaded on demand.
  12409. - bpo-40741: Update Windows release to include SQLite 3.32.3.
  12410. - bpo-41142: :mod:`msilib` now supports creating CAB files with non-ASCII
  12411. file path and adding files with non-ASCII file path to them.
  12412. - bpo-41074: Fixed support of non-ASCII names in functions
  12413. :func:`msilib.OpenDatabase` and :func:`msilib.init_database` and non-ASCII
  12414. SQL in method :meth:`msilib.Database.OpenView`.
  12415. - bpo-41039: Stable ABI redirection DLL (python3.dll) now uses ``#pragma
  12416. comment(linker)`` for re-exporting.
  12417. - bpo-40164: Updates Windows OpenSSL to 1.1.1g
  12418. - bpo-39631: Changes the registered MIME type for ``.py`` files on Windows
  12419. to ``text/x-python`` instead of ``text/plain``.
  12420. - bpo-40677: Manually define IO_REPARSE_TAG_APPEXECLINK in case some old
  12421. Windows SDK doesn't have it.
  12422. - bpo-37556: Extend py.exe help to mention overrides via venv, shebang,
  12423. environmental variables & ini files.
  12424. macOS
  12425. -----
  12426. - bpo-41557: Update macOS installer to use SQLite 3.33.0.
  12427. - bpo-39580: Avoid opening Finder window if running installer from the
  12428. command line. Patch contributed by Rick Heil.
  12429. - bpo-41100: Fix configure error when building on macOS 11. Note that the
  12430. current Python release was released shortly after the first developer
  12431. preview of macOS 11 (Big Sur); there are other known issues with building
  12432. and running on the developer preview. Big Sur is expected to be fully
  12433. supported in a future bugfix release of Python 3.8.x and with 3.9.0.
  12434. - bpo-40741: Update macOS installer to use SQLite 3.32.3.
  12435. - bpo-41005: fixed an XDG settings issue not allowing macos to open browser
  12436. in webbrowser.py
  12437. - bpo-40741: Update macOS installer to use SQLite 3.32.2.
  12438. IDLE
  12439. ----
  12440. - bpo-41775: Use 'IDLE Shell' as shell title
  12441. - bpo-35764: Rewrite the Calltips doc section.
  12442. - bpo-40181: In calltips, stop reminding that '/' marks the end of
  12443. positional-only arguments.
  12444. - bpo-41468: Improve IDLE run crash error message (which users should never
  12445. see).
  12446. - bpo-41373: Save files loaded with no line ending, as when blank, or
  12447. different line endings, by setting its line ending to the system default.
  12448. Fix regression in 3.8.4 and 3.9.0b4.
  12449. - bpo-41300: Save files with non-ascii chars. Fix regression released in
  12450. 3.9.0b4 and 3.8.4.
  12451. - bpo-37765: Add keywords to module name completion list. Rewrite
  12452. Completions section of IDLE doc.
  12453. - bpo-41152: The encoding of ``stdin``, ``stdout`` and ``stderr`` in IDLE is
  12454. now always UTF-8.
  12455. - bpo-41144: Make Open Module open a special module such as os.path.
  12456. - bpo-39885: Make context menu Cut and Copy work again when right-clicking
  12457. within a selection.
  12458. - bpo-40723: Make test_idle pass when run after import.
  12459. C API
  12460. -----
  12461. - bpo-41936: Removed undocumented macros ``Py_ALLOW_RECURSION`` and
  12462. ``Py_END_ALLOW_RECURSION`` and the ``recursion_critical`` field of the
  12463. :c:type:`PyInterpreterState` structure.
  12464. - bpo-41692: The ``PyUnicode_InternImmortal()`` function is now deprecated
  12465. and will be removed in Python 3.12: use :c:func:`PyUnicode_InternInPlace`
  12466. instead. Patch by Victor Stinner.
  12467. - bpo-41842: Add :c:func:`PyCodec_Unregister` function to unregister a codec
  12468. search function.
  12469. - bpo-41834: Remove the ``_Py_CheckRecursionLimit`` variable: it has been
  12470. replaced by ``ceval.recursion_limit`` of the :c:type:`PyInterpreterState`
  12471. structure. Patch by Victor Stinner.
  12472. - bpo-41689: Types created with :c:func:`PyType_FromSpec` now make any
  12473. signature in their ``tp_doc`` slot accessible from ``__text_signature__``.
  12474. - bpo-41524: Fix bug in PyOS_mystrnicmp and PyOS_mystricmp that incremented
  12475. pointers beyond the end of a string.
  12476. - bpo-41324: Add a minimal decimal capsule API. The API supports fast
  12477. conversions between Decimals up to 38 digits and their triple
  12478. representation as a C struct.
  12479. - bpo-30155: Add :c:func:`PyDateTime_DATE_GET_TZINFO` and
  12480. :c:func:`PyDateTime_TIME_GET_TZINFO` macros for accessing the ``tzinfo``
  12481. attributes of :class:`datetime.datetime` and :class:`datetime.time`
  12482. objects.
  12483. - bpo-40170: Revert :c:func:`PyType_HasFeature` change: it reads again
  12484. directly the :c:member:`PyTypeObject.tp_flags` member when the limited C
  12485. API is not used, rather than always calling :c:func:`PyType_GetFlags`
  12486. which hides implementation details.
  12487. - bpo-41123: Remove ``PyUnicode_AsUnicodeCopy``.
  12488. - bpo-41123: Removed ``PyLong_FromUnicode()``.
  12489. - bpo-41123: Removed ``PyUnicode_GetMax()``.
  12490. - bpo-41123: Removed ``Py_UNICODE_str*`` functions manipulating
  12491. ``Py_UNICODE*`` strings.
  12492. - bpo-41103: ``PyObject_AsCharBuffer()``, ``PyObject_AsReadBuffer()``,
  12493. ``PyObject_CheckReadBuffer()``, and ``PyObject_AsWriteBuffer()`` are
  12494. removed. Please migrate to new buffer protocol;
  12495. :c:func:`PyObject_GetBuffer` and :c:func:`PyBuffer_Release`.
  12496. - bpo-36346: Raises DeprecationWarning for ``PyUnicode_FromUnicode(NULL,
  12497. size)`` and ``PyUnicode_FromStringAndSize(NULL, size)`` with ``size > 0``.
  12498. - bpo-36346: Mark ``Py_UNICODE_COPY``, ``Py_UNICODE_FILL``,
  12499. ``PyUnicode_WSTR_LENGTH``, ``PyUnicode_FromUnicode``,
  12500. ``PyUnicode_AsUnicode``, and ``PyUnicode_AsUnicodeAndSize`` as deprecated
  12501. in C. Remove ``Py_UNICODE_MATCH`` which was deprecated and broken since
  12502. Python 3.3.
  12503. - bpo-40989: The :c:func:`PyObject_INIT` and :c:func:`PyObject_INIT_VAR`
  12504. macros become aliases to, respectively, :c:func:`PyObject_Init` and
  12505. :c:func:`PyObject_InitVar` functions.
  12506. - bpo-36020: On Windows, ``#include "pyerrors.h"`` no longer defines
  12507. ``snprintf`` and ``vsnprintf`` macros.
  12508. - bpo-40943: The ``PY_SSIZE_T_CLEAN`` macro must now be defined to use
  12509. :c:func:`PyArg_ParseTuple` and :c:func:`Py_BuildValue` formats which use
  12510. ``#``: ``es#``, ``et#``, ``s#``, ``u#``, ``y#``, ``z#``, ``U#`` and
  12511. ``Z#``. See :ref:`Parsing arguments and building values <arg-parsing>` and
  12512. the :pep:`353`.
  12513. - bpo-40910: Export explicitly the :c:func:`Py_GetArgcArgv` function to the
  12514. C API and document the function. Previously, it was exported implicitly
  12515. which no longer works since Python is built with ``-fvisibility=hidden``.
  12516. - bpo-40724: Allow defining buffer slots in type specs.
  12517. - bpo-40679: Fix a ``_PyEval_EvalCode()`` crash if *qualname* argument is
  12518. NULL.
  12519. - bpo-40839: Calling :c:func:`PyDict_GetItem` without :term:`GIL` held had
  12520. been allowed for historical reason. It is no longer allowed.
  12521. - bpo-40826: :c:func:`PyOS_InterruptOccurred` now fails with a fatal error
  12522. if it is called with the GIL released.
  12523. - bpo-40792: The result of :c:func:`PyNumber_Index` now always has exact
  12524. type :class:`int`. Previously, the result could have been an instance of a
  12525. subclass of ``int``.
  12526. - bpo-39573: Convert :c:func:`Py_REFCNT` and :c:func:`Py_SIZE` macros to
  12527. static inline functions. They cannot be used as l-value anymore: use
  12528. :c:func:`Py_SET_REFCNT` and :c:func:`Py_SET_SIZE` to set an object
  12529. reference count and size. This change is backward incompatible on purpose,
  12530. to prepare the C API for an opaque :c:type:`PyObject` structure.
  12531. - bpo-40703: The PyType_FromSpec*() functions no longer overwrite the type's
  12532. "__module__" attribute if it is set via "Py_tp_members" or "Py_tp_getset".
  12533. - bpo-39583: Remove superfluous "extern C" declarations from
  12534. ``Include/cpython/*.h``.
  12535. What's New in Python 3.9.0 beta 1?
  12536. ==================================
  12537. *Release date: 2020-05-19*
  12538. Security
  12539. --------
  12540. - bpo-40501: :mod:`uuid` no longer uses :mod:`ctypes` to load
  12541. :file:`libuuid` or :file:`rpcrt4.dll` at runtime.
  12542. Core and Builtins
  12543. -----------------
  12544. - bpo-40663: Correctly generate annotations where parentheses are omitted
  12545. but required (e.g: ``Type[(str, int, *other))]``.
  12546. - bpo-40596: Fixed :meth:`str.isidentifier` for non-canonicalized strings
  12547. containing non-BMP characters on Windows.
  12548. - bpo-40593: Improved syntax errors for invalid characters in source code.
  12549. - bpo-40585: Fixed a bug when using :func:`codeop.compile_command` that was
  12550. causing exceptions to be swallowed with the new parser. Patch by Pablo
  12551. Galindo
  12552. - bpo-40566: Apply :pep:`573` to :mod:`abc`.
  12553. - bpo-40502: Initialize ``n->n_col_offset``. (Patch by Joannah Nanjekye)
  12554. - bpo-40527: Fix command line argument parsing: no longer write errors
  12555. multiple times into stderr.
  12556. - bpo-1635741: Port :mod:`errno` to multiphase initialization (:pep:`489`).
  12557. - bpo-40523: Add pass-throughs for :func:`hash` and :func:`reversed` to
  12558. :class:`weakref.proxy` objects. Patch by Pablo Galindo.
  12559. - bpo-1635741: Port :mod:`syslog` to multiphase initialization (:pep:`489`).
  12560. - bpo-40246: Reporting a specialised error message for invalid string
  12561. prefixes, which was introduced in :issue:`40246`, is being reverted due to
  12562. backwards compatibility concerns for strings that immediately follow a
  12563. reserved keyword without whitespace between them. Constructs like
  12564. ``bg="#d00" if clear else"#fca"`` were failing to parse, which is not an
  12565. acceptable breakage on such short notice.
  12566. - bpo-40417: Fix imp module deprecation warning when PyImport_ReloadModule
  12567. is called. Patch by Robert Rouhani.
  12568. - bpo-40408: Fixed support of nested type variables in GenericAlias (e.g.
  12569. ``list[list[T]]``).
  12570. - bpo-1635741: Port _stat module to multiphase initialization (:pep:`489`).
  12571. - bpo-29587: Enable implicit exception chaining when calling
  12572. :meth:`generator.throw`.
  12573. - bpo-40328: Add tools for generating mappings headers for CJKCodecs.
  12574. - bpo-40228: Setting frame.f_lineno is now robust w.r.t. changes in the
  12575. source-to-bytecode compiler
  12576. - bpo-38880: Added the ability to list interpreters associated with channel
  12577. ends in the internal subinterpreters module.
  12578. - bpo-37986: Improve performance of :c:func:`PyLong_FromDouble` for values
  12579. that fit into :c:expr:`long`.
  12580. Library
  12581. -------
  12582. - bpo-40662: Fixed :func:`ast.get_source_segment` for ast nodes that have
  12583. incomplete location information. Patch by Irit Katriel.
  12584. - bpo-40665: Convert :mod:`bisect` to use Argument Clinic.
  12585. - bpo-40536: Added the :func:`~zoneinfo.available_timezones` function to the
  12586. :mod:`zoneinfo` module. Patch by Paul Ganssle.
  12587. - bpo-40645: The :class:`hmac.HMAC` exposes internal implementation details.
  12588. The attributes ``digest_cons``, ``inner``, and ``outer`` are deprecated
  12589. and will be removed in the future.
  12590. - bpo-40645: The internal module ``_hashlib`` wraps and exposes OpenSSL's
  12591. HMAC API. The new code will be used in Python 3.10 after the internal
  12592. implementation details of the pure Python HMAC module are no longer part
  12593. of the public API.
  12594. - bpo-40637: Builtin hash modules can now be disabled or selectively enabled
  12595. with ``configure --with-builtin-hashlib-hashes=sha3,blake1`` or
  12596. ``--without-builtin-hashlib-hashes``.
  12597. - bpo-37630: The :mod:`hashlib` module can now use SHA3 hashes and SHAKE XOF
  12598. from OpenSSL when available.
  12599. - bpo-40479: The :mod:`hashlib` now compiles with OpenSSL 3.0.0-alpha2.
  12600. - bpo-40257: Revert changes to :func:`inspect.getdoc`.
  12601. - bpo-40607: When cancelling a task due to timeout, :meth:`asyncio.wait_for`
  12602. will now propagate the exception if an error happens during cancellation.
  12603. Patch by Roman Skurikhin.
  12604. - bpo-40612: Fix edge cases in SyntaxError formatting. If the offset is <=
  12605. 0, no caret is printed. If the offset is > line length, the caret is
  12606. printed pointing just after the last character.
  12607. - bpo-40597: If text content lines are longer than policy.max_line_length,
  12608. always use a content-encoding to make sure they are wrapped.
  12609. - bpo-40571: Added functools.cache() as a simpler, more discoverable way to
  12610. access the unbounded cache variant of lru_cache(maxsize=None).
  12611. - bpo-40503: :pep:`615`, the :mod:`zoneinfo` module. Adds support for the
  12612. IANA time zone database.
  12613. - bpo-40397: Removed attributes ``__args__`` and ``__parameters__`` from
  12614. special generic aliases like ``typing.List`` (not subscripted).
  12615. - bpo-40549: Convert posixmodule.c ("posix" or "nt" module) to the
  12616. multiphase initialization (PEP 489).
  12617. - bpo-31033: Add a ``msg`` argument to :meth:`Future.cancel` and
  12618. :meth:`Task.cancel`.
  12619. - bpo-40541: Added an optional *counts* parameter to random.sample().
  12620. - bpo-40515: The :mod:`ssl` and :mod:`hashlib` modules now actively check
  12621. that OpenSSL is build with thread support. Python 3.7.0 made thread
  12622. support mandatory and no longer works safely with a no-thread builds.
  12623. - bpo-31033: When a :class:`asyncio.Task` is cancelled, the exception
  12624. traceback now chains all the way back to where the task was first
  12625. interrupted.
  12626. - bpo-40504: :func:`functools.lru_cache` objects can now be the targets of
  12627. weakrefs.
  12628. - bpo-40559: Fix possible memory leak in the C implementation of
  12629. :class:`asyncio.Task`.
  12630. - bpo-40480: ``fnmatch.fnmatch()`` could take exponential time in the
  12631. presence of multiple ``*`` pattern characters. This was repaired by
  12632. generating more elaborate regular expressions to avoid futile
  12633. backtracking.
  12634. - bpo-40495: :mod:`compileall` is now able to use hardlinks to prevent
  12635. duplicates in a case when ``.pyc`` files for different optimization levels
  12636. have the same content.
  12637. - bpo-40457: The ssl module now support OpenSSL builds without TLS 1.0 and
  12638. 1.1 methods.
  12639. - bpo-40355: Improve error reporting in :func:`ast.literal_eval` in the
  12640. presence of malformed :class:`ast.Dict` nodes instead of silently ignoring
  12641. any non-conforming elements. Patch by Curtis Bucher.
  12642. - bpo-40465: Deprecated the optional *random* argument to
  12643. *random.shuffle()*.
  12644. - bpo-40459: :func:`platform.win32_ver` now produces correct *ptype* strings
  12645. instead of empty strings.
  12646. - bpo-39435: The first argument of :func:`pickle.loads` is now
  12647. positional-only.
  12648. - bpo-39305: Update :mod:`nntplib` to merge :class:`nntplib.NNTP` and
  12649. :class:`nntplib._NNTPBase`. Patch by Donghee Na.
  12650. - bpo-32494: Update :mod:`dbm.gnu` to use gdbm_count if possible when
  12651. calling :func:`len`. Patch by Donghee Na.
  12652. - bpo-40453: Add ``isolated=True`` keyword-only parameter to
  12653. ``_xxsubinterpreters.create()``. An isolated subinterpreter cannot spawn
  12654. threads, spawn a child process or call ``os.fork()``.
  12655. - bpo-40286: Remove ``_random.Random.randbytes()``: the C implementation of
  12656. ``randbytes()``. Implement the method in Python to ease subclassing:
  12657. ``randbytes()`` now directly reuses ``getrandbits()``.
  12658. - bpo-40394: Added default arguments to
  12659. :meth:`difflib.SequenceMatcher.find_longest_match()`.
  12660. - bpo-39995: Fix a race condition in concurrent.futures._ThreadWakeup:
  12661. access to _ThreadWakeup is now protected with the shutdown lock.
  12662. - bpo-30966: ``Process.shutdown(wait=True)`` of :mod:`concurrent.futures`
  12663. now closes explicitly the result queue.
  12664. - bpo-30966: Add a new :meth:`~multiprocessing.SimpleQueue.close` method to
  12665. the :class:`~multiprocessing.SimpleQueue` class to explicitly close the
  12666. queue.
  12667. - bpo-39966: Revert bpo-25597. :class:`unittest.mock.MagicMock` with wraps'
  12668. set uses default return values for magic methods.
  12669. - bpo-39791: Added ``files()`` function to importlib.resources with support
  12670. for subdirectories in package data, matching backport in
  12671. importlib_resources 1.5.
  12672. - bpo-40375: :meth:`imaplib.IMAP4.unselect` is added. Patch by Donghee Na.
  12673. - bpo-40389: ``repr()`` now returns ``typing.Optional[T]`` when called for
  12674. ``typing.Union`` of two types, one of which is ``NoneType``.
  12675. - bpo-40291: Add support for CAN_J1939 sockets (available on Linux 5.4+)
  12676. - bpo-40273: :class:`types.MappingProxyType` is now reversible.
  12677. - bpo-39075: The repr for :class:`types.SimpleNamespace` is now insertion
  12678. ordered rather than alphabetical.
  12679. - bpo-40192: On AIX, :func:`~time.thread_time` is now implemented with
  12680. ``thread_cputime()`` which has nanosecond resolution, rather than
  12681. ``clock_gettime(CLOCK_THREAD_CPUTIME_ID)`` which has a resolution of 10
  12682. milliseconds. Patch by Batuhan Taskaya.
  12683. - bpo-40025: Raise TypeError when _generate_next_value_ is defined after
  12684. members. Patch by Ethan Onstott.
  12685. - bpo-39058: In the argparse module, the repr for Namespace() and other
  12686. argument holders now displayed in the order attributes were added.
  12687. Formerly, it displayed in alphabetical order even though argument order is
  12688. preserved the user visible parts of the module.
  12689. - bpo-24416: The ``isocalendar()`` methods of :class:`datetime.date` and
  12690. :class:`datetime.datetime` now return a :term:`named tuple` instead of a
  12691. :class:`tuple`.
  12692. Documentation
  12693. -------------
  12694. - bpo-34790: Add version of removal for explicit passing of coros to
  12695. ``asyncio.wait()``'s documentation
  12696. - bpo-40561: Provide docstrings for webbrowser open functions.
  12697. - bpo-40499: Mention that :func:`asyncio.wait` requires a non-empty set of
  12698. awaitables.
  12699. - bpo-39705: Tutorial example for sorted() in the Loop Techniques section is
  12700. given a better explanation. Also a new example is included to explain
  12701. sorted()'s basic behavior.
  12702. - bpo-39435: Fix an incorrect signature for :func:`pickle.loads` in the docs
  12703. Tests
  12704. -----
  12705. - bpo-40055: distutils.tests now saves/restores warnings filters to leave
  12706. them unchanged. Importing tests imports docutils which imports
  12707. pkg_resources which adds a warnings filter.
  12708. - bpo-40436: test_gdb and test.pythoninfo now check gdb command exit code.
  12709. Build
  12710. -----
  12711. - bpo-40653: Move _dirnameW out of HAVE_SYMLINK to fix a potential compiling
  12712. issue.
  12713. - bpo-40514: Add ``--with-experimental-isolated-subinterpreters`` build
  12714. option to ``configure``: better isolate subinterpreters, experimental
  12715. build mode.
  12716. Windows
  12717. -------
  12718. - bpo-40650: Include winsock2.h in pytime.c for timeval.
  12719. - bpo-40458: Increase reserved stack space to prevent overflow crash on
  12720. Windows.
  12721. - bpo-39148: Add IPv6 support to :mod:`asyncio` datagram endpoints in
  12722. ProactorEventLoop. Change the raised exception for unknown address
  12723. families to ValueError as it's not coming from Windows API.
  12724. macOS
  12725. -----
  12726. - bpo-34956: When building Python on macOS from source, ``_tkinter`` now
  12727. links with non-system Tcl and Tk frameworks if they are installed in
  12728. ``/Library/Frameworks``, as had been the case on older releases of macOS.
  12729. If a macOS SDK is explicitly configured, by using
  12730. ``--enable-universalsdk=`` or ``-isysroot``, only the SDK itself is
  12731. searched. The default behavior can still be overridden with
  12732. ``--with-tcltk-includes`` and ``--with-tcltk-libs``.
  12733. - bpo-35569: Expose RFC 3542 IPv6 socket options.
  12734. Tools/Demos
  12735. -----------
  12736. - bpo-40479: Update multissltest helper to test with latest OpenSSL 1.0.2,
  12737. 1.1.0, 1.1.1, and 3.0.0-alpha.
  12738. - bpo-40431: Fix a syntax typo in ``turtledemo`` that now raises a
  12739. ``SyntaxError``.
  12740. - bpo-40163: Fix multissltest tool. OpenSSL has changed download URL for old
  12741. releases. The multissltest tool now tries to download from current and old
  12742. download URLs.
  12743. C API
  12744. -----
  12745. - bpo-39465: Remove the ``_PyUnicode_ClearStaticStrings()`` function from
  12746. the C API.
  12747. - bpo-38787: Add PyCFunction_CheckExact() macro for exact type checks now
  12748. that we allow subtypes of PyCFunction, as well as PyCMethod_CheckExact()
  12749. and PyCMethod_Check() for the new PyCMethod subtype.
  12750. - bpo-40545: Declare ``_PyErr_GetTopmostException()`` with ``PyAPI_FUNC()``
  12751. to properly export the function in the C API. The function remains private
  12752. (``_Py``) prefix.
  12753. - bpo-40412: Nullify inittab_copy during finalization, preventing future
  12754. interpreter initializations in an embedded situation from crashing. Patch
  12755. by Gregory Szorc.
  12756. - bpo-40429: The :c:func:`PyThreadState_GetFrame` function now returns a
  12757. strong reference to the frame.
  12758. - bpo-40428: Remove the following functions from the C API. Call
  12759. :c:func:`PyGC_Collect` explicitly to free all free lists.
  12760. * ``PyAsyncGen_ClearFreeLists()``
  12761. * ``PyContext_ClearFreeList()``
  12762. * ``PyDict_ClearFreeList()``
  12763. * ``PyFloat_ClearFreeList()``
  12764. * ``PyFrame_ClearFreeList()``
  12765. * ``PyList_ClearFreeList()``
  12766. * ``PySet_ClearFreeList()``
  12767. * ``PyTuple_ClearFreeList()``
  12768. - bpo-40421: New :c:func:`PyFrame_GetBack` function: get the frame next
  12769. outer frame.
  12770. - bpo-40421: New :c:func:`PyFrame_GetCode` function: return a borrowed
  12771. reference to the frame code.
  12772. - bpo-40217: Ensure that instances of types created with
  12773. :c:func:`PyType_FromSpecWithBases` will visit its class object when
  12774. traversing references in the garbage collector (implemented as an
  12775. extension of the provided :c:member:`~PyTypeObject.tp_traverse`). Patch by
  12776. Pablo Galindo.
  12777. - bpo-38787: Module C state is now accessible from C-defined heap type
  12778. methods (:pep:`573`). Patch by Marcel Plch and Petr Viktorin.
  12779. What's New in Python 3.9.0 alpha 6?
  12780. ===================================
  12781. *Release date: 2020-04-27*
  12782. Security
  12783. --------
  12784. - bpo-40121: Fixes audit events raised on creating a new socket.
  12785. - bpo-39073: Disallow CR or LF in email.headerregistry.Address arguments to
  12786. guard against header injection attacks.
  12787. - bpo-39503: CVE-2020-8492: The
  12788. :class:`~urllib.request.AbstractBasicAuthHandler` class of the
  12789. :mod:`urllib.request` module uses an inefficient regular expression which
  12790. can be exploited by an attacker to cause a denial of service. Fix the
  12791. regex to prevent the catastrophic backtracking. Vulnerability reported by
  12792. Ben Caller and Matt Schwager.
  12793. Core and Builtins
  12794. -----------------
  12795. - bpo-40313: Improve the performance of bytes.hex().
  12796. - bpo-40334: Switch to a new parser, based on PEG. For more details see PEP
  12797. 617. To temporarily switch back to the old parser, use ``-X oldparser`` or
  12798. ``PYTHONOLDPARSER=1``. In Python 3.10 we will remove the old parser
  12799. completely, including the ``parser`` module (already deprecated) and
  12800. anything that depends on it.
  12801. - bpo-40267: Fix the tokenizer to display the correct error message, when
  12802. there is a ``SyntaxError`` on the last input character and no newline
  12803. follows. It used to be ``unexpected EOF while parsing``, while it should
  12804. be ``invalid syntax``.
  12805. - bpo-39522: Correctly unparse explicit ``u`` prefix for strings when
  12806. postponed evaluation for annotations activated. Patch by Batuhan Taskaya.
  12807. - bpo-40246: Report a specialized error message, ``invalid string prefix``,
  12808. when the tokenizer encounters a string with an invalid prefix.
  12809. - bpo-40082: Fix the signal handler: it now always uses the main
  12810. interpreter, rather than trying to get the current Python thread state.
  12811. - bpo-37388: str.encode() and str.decode() no longer check the encoding and
  12812. errors in development mode or in debug mode during Python finalization.
  12813. The codecs machinery can no longer work on very late calls to str.encode()
  12814. and str.decode().
  12815. - bpo-40077: Fix possible refleaks in :mod:`_json`, memo of PyScannerObject
  12816. should be traversed.
  12817. - bpo-37207: Speed up calls to ``dict()`` by using the :pep:`590`
  12818. ``vectorcall`` calling convention.
  12819. - bpo-40141: Add column and line information to ``ast.keyword`` nodes. Patch
  12820. by Pablo Galindo.
  12821. - bpo-1635741: Port :mod:`resource` to multiphase initialization
  12822. (:pep:`489`).
  12823. - bpo-1635741: Port :mod:`math` to multiphase initialization (:pep:`489`).
  12824. - bpo-1635741: Port _uuid module to multiphase initialization (:pep:`489`).
  12825. - bpo-40077: Convert json module to use :c:func:`PyType_FromSpec`.
  12826. - bpo-40067: Improve the error message for multiple star expressions in an
  12827. assignment. Patch by Furkan Onder
  12828. - bpo-1635741: Port _functools module to multiphase initialization (PEP
  12829. 489). Patch by Paulo Henrique Silva.
  12830. - bpo-1635741: Port operator module to multiphase initialization (PEP 489).
  12831. Patch by Paulo Henrique Silva.
  12832. - bpo-20526: Fix :c:func:`PyThreadState_Clear()`. ``PyThreadState.frame`` is
  12833. a borrowed reference, not a strong reference: ``PyThreadState_Clear()``
  12834. must not call ``Py_CLEAR(tstate->frame)``.
  12835. - bpo-1635741: Port time module to multiphase initialization (:pep:`489`).
  12836. Patch by Paulo Henrique Silva.
  12837. - bpo-1635741: Port _weakref extension module to multiphase initialization
  12838. (:pep:`489`).
  12839. - bpo-40020: Fix a leak and subsequent crash in parsetok.c caused by realloc
  12840. misuse on a rare codepath.
  12841. - bpo-39939: Added str.removeprefix and str.removesuffix methods and
  12842. corresponding bytes, bytearray, and collections.UserString methods to
  12843. remove affixes from a string if present. See :pep:`616` for a full
  12844. description. Patch by Dennis Sweeney.
  12845. - bpo-39481: Implement PEP 585. This supports list[int], tuple[str, ...]
  12846. etc.
  12847. - bpo-32894: Support unparsing of infinity numbers in postponed annotations.
  12848. Patch by Batuhan Taşkaya.
  12849. - bpo-37207: Speed up calls to ``list()`` by using the :pep:`590`
  12850. ``vectorcall`` calling convention. Patch by Mark Shannon.
  12851. Library
  12852. -------
  12853. - bpo-40398: :func:`typing.get_args` now always returns an empty tuple for
  12854. special generic aliases.
  12855. - bpo-40396: Functions :func:`typing.get_origin`, :func:`typing.get_args`
  12856. and :func:`typing.get_type_hints` support now generic aliases like
  12857. ``list[int]``.
  12858. - bpo-38061: Optimize the :mod:`subprocess` module on FreeBSD using
  12859. ``closefrom()``. A single ``close(fd)`` syscall is cheap, but when
  12860. ``sysconf(_SC_OPEN_MAX)`` is high, the loop calling ``close(fd)`` on each
  12861. file descriptor can take several milliseconds.
  12862. The workaround on FreeBSD to improve performance was to load and mount the
  12863. fdescfs kernel module, but this is not enabled by default.
  12864. Initial patch by Ed Maste (emaste), Conrad Meyer (cem), Kyle Evans
  12865. (kevans) and Kubilay Kocak (koobs):
  12866. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242274
  12867. - bpo-38061: On FreeBSD, ``os.closerange(fd_low, fd_high)`` now calls
  12868. ``closefrom(fd_low)`` if *fd_high* is greater than or equal to
  12869. ``sysconf(_SC_OPEN_MAX)``.
  12870. Initial patch by Ed Maste (emaste), Conrad Meyer (cem), Kyle Evans
  12871. (kevans) and Kubilay Kocak (koobs):
  12872. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242274
  12873. - bpo-40360: The :mod:`lib2to3` module is pending deprecation due to
  12874. :pep:`617`.
  12875. - bpo-40138: Fix the Windows implementation of :func:`os.waitpid` for exit
  12876. code larger than ``INT_MAX >> 8``. The exit status is now interpreted as
  12877. an unsigned number.
  12878. - bpo-39942: Set "__main__" as the default module name when "__name__" is
  12879. missing in :class:`typing.TypeVar`. Patch by Weipeng Hong.
  12880. - bpo-40275: The :mod:`logging` package is now imported lazily in
  12881. :mod:`unittest` only when the :meth:`~unittest.TestCase.assertLogs`
  12882. assertion is used.
  12883. - bpo-40275: The :mod:`asyncio` package is now imported lazily in
  12884. :mod:`unittest` only when the :class:`~unittest.IsolatedAsyncioTestCase`
  12885. class is used.
  12886. - bpo-40330: In :meth:`ShareableList.__setitem__`, check the size of a new
  12887. string item after encoding it to utf-8, not before.
  12888. - bpo-40148: Added :meth:`pathlib.Path.with_stem()` to create a new Path
  12889. with the stem replaced.
  12890. - bpo-40325: Deprecated support for set objects in random.sample().
  12891. - bpo-40257: Improved help for the :mod:`typing` module. Docstrings are now
  12892. shown for all special forms and special generic aliases (like ``Union``
  12893. and ``List``). Using ``help()`` with generic alias like ``List[int]`` will
  12894. show the help for the correspondent concrete type (``list`` in this case).
  12895. - bpo-40257: :func:`inspect.getdoc` no longer returns docstring inherited
  12896. from the type of the object or from parent class if it is a class if it is
  12897. not defined in the object itself. In :mod:`pydoc` the documentation string
  12898. is now shown not only for class, function, method etc, but for any object
  12899. that has its own ``__doc__`` attribute.
  12900. - bpo-40287: Fixed ``SpooledTemporaryFile.seek()`` to return the position.
  12901. - bpo-40290: Added zscore() to statistics.NormalDist().
  12902. - bpo-40282: Allow ``random.getrandbits(0)`` to succeed and to return 0.
  12903. - bpo-40286: Add :func:`random.randbytes` function and
  12904. :meth:`random.Random.randbytes` method to generate random bytes.
  12905. - bpo-40277: :func:`collections.namedtuple` now provides a human-readable
  12906. repr for its field accessors.
  12907. - bpo-40270: The included copy of sqlite3 on Windows is now compiled with
  12908. the json extension. This allows the use of functions such as
  12909. ``json_object``.
  12910. - bpo-29255: Wait in ``KqueueSelector.select`` when no fds are registered
  12911. - bpo-40260: Ensure :mod:`modulefinder` uses :func:`io.open_code` and
  12912. respects coding comments.
  12913. - bpo-40234: Allow again to spawn daemon threads in subinterpreters (revert
  12914. change which denied them).
  12915. - bpo-39207: Workers in :class:`~concurrent.futures.ProcessPoolExecutor` are
  12916. now spawned on demand, only when there are no available idle workers to
  12917. reuse. This optimizes startup overhead and reduces the amount of lost CPU
  12918. time to idle workers. Patch by Kyle Stanley.
  12919. - bpo-40091: Fix a hang at fork in the logging module: the new private
  12920. _at_fork_reinit() method is now used to reinitialize locks at fork in the
  12921. child process.
  12922. - bpo-40149: Implement traverse and clear slots in _abc._abc_data type.
  12923. - bpo-40208: Remove deprecated :meth:`symtable.SymbolTable.has_exec`.
  12924. - bpo-40196: Fix a bug in the :mod:`symtable` module that was causing
  12925. incorrectly report global variables as local. Patch by Pablo Galindo.
  12926. - bpo-40190: Add support for ``_SC_AIX_REALMEM`` to :func:`posix.sysconf`.
  12927. - bpo-40182: Removed the ``_field_types`` attribute of the
  12928. :class:`typing.NamedTuple` class.
  12929. - bpo-36517: Multiple inheritance with :class:`typing.NamedTuple` now raises
  12930. an error instead of silently ignoring other types.
  12931. - bpo-40126: Fixed reverting multiple patches in unittest.mock. Patcher's
  12932. ``__exit__()`` is now never called if its ``__enter__()`` is failed.
  12933. Returning true from ``__exit__()`` silences now the exception.
  12934. - bpo-40094: CGIHTTPRequestHandler of http.server now logs the CGI script
  12935. exit code, rather than the CGI script exit status of os.waitpid(). For
  12936. example, if the script is killed by signal 11, it now logs: "CGI script
  12937. exit code -11."
  12938. - bpo-40108: Improve the error message when triying to import a module using
  12939. :mod:`runpy` and incorrently use the ".py" extension at the end of the
  12940. module name. Patch by Pablo Galindo.
  12941. - bpo-40094: Add :func:`os.waitstatus_to_exitcode` function: convert a wait
  12942. status to an exit code.
  12943. - bpo-40089: Fix threading._after_fork(): if fork was not called by a thread
  12944. spawned by threading.Thread, threading._after_fork() now creates a
  12945. _MainThread instance for _main_thread, instead of a _DummyThread instance.
  12946. - bpo-40089: Add a private ``_at_fork_reinit()`` method to
  12947. :class:`_thread.Lock`, :class:`_thread.RLock`, :class:`threading.RLock`
  12948. and :class:`threading.Condition` classes: reinitialize the lock at fork in
  12949. the child process, reset the lock to the unlocked state. Rename also the
  12950. private ``_reset_internal_locks()`` method of :class:`threading.Event` to
  12951. ``_at_fork_reinit()``.
  12952. - bpo-25780: Expose :const:`~socket.CAN_RAW_JOIN_FILTERS` in the
  12953. :mod:`socket` module.
  12954. - bpo-39503: :class:`~urllib.request.AbstractBasicAuthHandler` of
  12955. :mod:`urllib.request` now parses all WWW-Authenticate HTTP headers and
  12956. accepts multiple challenges per header: use the realm of the first Basic
  12957. challenge.
  12958. - bpo-39812: Removed daemon threads from :mod:`concurrent.futures` by adding
  12959. an internal ``threading._register_atexit()``, which calls registered
  12960. functions prior to joining all non-daemon threads. This allows for
  12961. compatibility with subinterpreters, which don't support daemon threads.
  12962. - bpo-40050: Fix ``importlib._bootstrap_external``: avoid creating a new
  12963. ``winreg`` builtin module if it's already available in
  12964. :data:`sys.modules`, and remove redundant imports.
  12965. - bpo-40014: Fix ``os.getgrouplist()``: if ``getgrouplist()`` function fails
  12966. because the group list is too small, retry with a larger group list. On
  12967. failure, the glibc implementation of ``getgrouplist()`` sets ``ngroups``
  12968. to the total number of groups. For other implementations, double the group
  12969. list size.
  12970. - bpo-40017: Add :const:`time.CLOCK_TAI` constant if the operating system
  12971. support it.
  12972. - bpo-40016: In re docstring, clarify the relationship between inline and
  12973. argument compile flags.
  12974. - bpo-39953: Update internal table of OpenSSL error codes in the ``ssl``
  12975. module.
  12976. - bpo-36144: Added :pep:`584` operators to
  12977. :class:`weakref.WeakValueDictionary`.
  12978. - bpo-36144: Added :pep:`584` operators to
  12979. :class:`weakref.WeakKeyDictionary`.
  12980. - bpo-38891: Fix linear runtime behaviour of the ``__getitem__`` and
  12981. ``__setitem__`` methods in
  12982. :class:`multiprocessing.shared_memory.ShareableList`. This avoids
  12983. quadratic performance when iterating a ``ShareableList``. Patch by Thomas
  12984. Krennwallner.
  12985. - bpo-39682: Remove undocumented support for *closing* a ``pathlib.Path``
  12986. object via its context manager. The context manager magic methods remain,
  12987. but they are now a no-op, making ``Path`` objects immutable.
  12988. - bpo-36144: Added :pep:`584` operators (``|`` and ``|=``) to
  12989. :class:`collections.ChainMap`.
  12990. - bpo-39011: Normalization of line endings in ElementTree attributes was
  12991. removed, as line endings which were replaced by entity numbers should be
  12992. preserved in original form.
  12993. - bpo-38410: Properly handle :func:`sys.audit` failures in
  12994. :func:`sys.set_asyncgen_hooks`.
  12995. - bpo-36541: lib2to3 now recognizes named assignment expressions (the walrus
  12996. operator, ``:=``)
  12997. - bpo-35967: In platform, delay the invocation of 'uname -p' until the
  12998. processor attribute is requested.
  12999. - bpo-35113: :meth:`inspect.getsource` now returns correct source code for
  13000. inner class with same name as module level class. Decorators are also
  13001. returned as part of source of the class. Patch by Karthikeyan
  13002. Singaravelan.
  13003. - bpo-33262: Deprecate passing None as an argument for
  13004. :func:`shlex.split()`'s ``s`` parameter. Patch by Zackery Spytz.
  13005. - bpo-31758: Prevent crashes when using an uninitialized
  13006. ``_elementtree.XMLParser`` object. Patch by Oren Milman.
  13007. Documentation
  13008. -------------
  13009. - bpo-27635: The pickle documentation incorrectly claimed that ``__new__``
  13010. isn't called by default when unpickling.
  13011. - bpo-39879: Updated :ref:`datamodel` docs to include :func:`dict` insertion
  13012. order preservation. Patch by Furkan Onder and Samy Lahfa.
  13013. - bpo-38387: Document :c:macro:`PyDoc_STRVAR` macro in the C-API reference.
  13014. - bpo-13743: Some methods within xml.dom.minidom.Element class are now
  13015. better documented.
  13016. Tests
  13017. -----
  13018. - bpo-31904: Set expected default encoding in test_c_locale_coercion.py for
  13019. VxWorks RTOS.
  13020. - bpo-40162: Update Travis CI configuration to OpenSSL 1.1.1f.
  13021. - bpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines.
  13022. - bpo-40094: Add :func:`test.support.wait_process` function.
  13023. - bpo-40003: ``test.bisect_cmd`` now copies Python command line options like
  13024. ``-O`` or ``-W``. Moreover, emit a warning if ``test.bisect_cmd`` is used
  13025. with ``-w``/``--verbose2`` option.
  13026. - bpo-39380: Add the encoding in :class:`ftplib.FTP` and
  13027. :class:`ftplib.FTP_TLS` to the constructor as keyword-only and change the
  13028. default from ``latin-1`` to ``utf-8`` to follow :rfc:`2640`.
  13029. - bpo-39793: Use the same domain when testing ``make_msgid``. Patch by
  13030. Batuhan Taskaya.
  13031. - bpo-1812: Fix newline handling in doctest.testfile when loading from a
  13032. package whose loader has a get_data method. Patch by Peter Donis.
  13033. Build
  13034. -----
  13035. - bpo-38360: Support single-argument form of macOS -isysroot flag.
  13036. - bpo-40158: Fix CPython MSBuild Properties in NuGet Package
  13037. (build/native/python.props)
  13038. - bpo-38527: Fix configure check on Solaris for "float word ordering":
  13039. sometimes, the correct "grep" command was not being used. Patch by Arnon
  13040. Yaari.
  13041. Windows
  13042. -------
  13043. - bpo-40164: Updates Windows to OpenSSL 1.1.1f
  13044. - bpo-8901: Ignore the Windows registry when the ``-E`` option is used.
  13045. macOS
  13046. -----
  13047. - bpo-38329: python.org macOS installers now update the Current version
  13048. symlink of /Library/Frameworks/Python.framework/Versions for 3.9 installs.
  13049. Previously, Current was only updated for Python 2.x installs. This should
  13050. make it easier to embed Python 3 into other macOS applications.
  13051. - bpo-40164: Update macOS installer builds to use OpenSSL 1.1.1g.
  13052. IDLE
  13053. ----
  13054. - bpo-38439: Add a 256×256 pixel IDLE icon to support more modern
  13055. environments. Created by Andrew Clover. Delete the unused macOS idle.icns
  13056. icon file.
  13057. - bpo-38689: IDLE will no longer freeze when inspect.signature fails when
  13058. fetching a calltip.
  13059. Tools/Demos
  13060. -----------
  13061. - bpo-40385: Removed the checkpyc.py tool. Please see compileall without
  13062. force mode as a potential alternative.
  13063. - bpo-40179: Fixed translation of ``#elif`` in Argument Clinic.
  13064. - bpo-40094: Fix ``which.py`` script exit code: it now uses
  13065. :func:`os.waitstatus_to_exitcode` to convert :func:`os.system` exit status
  13066. into an exit code.
  13067. C API
  13068. -----
  13069. - bpo-40241: Move the :c:type:`PyGC_Head` structure to the internal C API.
  13070. - bpo-40170: Convert :c:func:`PyObject_IS_GC` macro to a function to hide
  13071. implementation details.
  13072. - bpo-40241: Add the functions :c:func:`PyObject_GC_IsTracked` and
  13073. :c:func:`PyObject_GC_IsFinalized` to the public API to allow to query if
  13074. Python objects are being currently tracked or have been already finalized
  13075. by the garbage collector respectively. Patch by Pablo Galindo.
  13076. - bpo-40170: The :c:func:`PyObject_NEW` macro becomes an alias to the
  13077. :c:func:`PyObject_New` macro, and the :c:func:`PyObject_NEW_VAR` macro
  13078. becomes an alias to the :c:func:`PyObject_NewVar` macro, to hide
  13079. implementation details. They no longer access directly the
  13080. :c:member:`PyTypeObject.tp_basicsize` member.
  13081. - bpo-40170: :c:func:`PyType_HasFeature` now always calls
  13082. :c:func:`PyType_GetFlags` to hide implementation details. Previously, it
  13083. accessed directly the :c:member:`PyTypeObject.tp_flags` member when the
  13084. limited C API was not used.
  13085. - bpo-40170: Convert the :c:func:`PyObject_GET_WEAKREFS_LISTPTR` macro to a
  13086. function to hide implementation details: the macro accessed directly to
  13087. the :c:member:`PyTypeObject.tp_weaklistoffset` member.
  13088. - bpo-40170: Convert :c:func:`PyObject_CheckBuffer` macro to a function to
  13089. hide implementation details: the macro accessed directly the
  13090. :c:member:`PyTypeObject.tp_as_buffer` member.
  13091. - bpo-40170: Always declare :c:func:`PyIndex_Check` as an opaque function to
  13092. hide implementation details: remove ``PyIndex_Check()`` macro. The macro
  13093. accessed directly the :c:member:`PyTypeObject.tp_as_number` member.
  13094. - bpo-39947: Add :c:func:`PyThreadState_GetID` function: get the unique
  13095. identifier of a Python thread state.
  13096. What's New in Python 3.9.0 alpha 5?
  13097. ===================================
  13098. *Release date: 2020-03-23*
  13099. Security
  13100. --------
  13101. - bpo-38576: Disallow control characters in hostnames in http.client,
  13102. addressing CVE-2019-18348. Such potentially malicious header injection
  13103. URLs now cause a InvalidURL to be raised.
  13104. Core and Builtins
  13105. -----------------
  13106. - bpo-40010: Optimize pending calls in multithreaded applications. If a
  13107. thread different than the main thread schedules a pending call
  13108. (:c:func:`Py_AddPendingCall`), the bytecode evaluation loop is no longer
  13109. interrupted at each bytecode instruction to check for pending calls which
  13110. cannot be executed. Only the main thread can execute pending calls.
  13111. Previously, the bytecode evaluation loop was interrupted at each
  13112. instruction until the main thread executes pending calls.
  13113. - bpo-1635741: Port _weakref extension module to multiphase initialization
  13114. (:pep:`489`).
  13115. - bpo-1635741: Port _collections module to multiphase initialization
  13116. (:pep:`489`).
  13117. - bpo-40010: Optimize signal handling in multithreaded applications. If a
  13118. thread different than the main thread gets a signal, the bytecode
  13119. evaluation loop is no longer interrupted at each bytecode instruction to
  13120. check for pending signals which cannot be handled. Only the main thread of
  13121. the main interpreter can handle signals.
  13122. Previously, the bytecode evaluation loop was interrupted at each
  13123. instruction until the main thread handles signals.
  13124. - bpo-39984: If :c:func:`Py_AddPendingCall` is called in a subinterpreter,
  13125. the function is now scheduled to be called from the subinterpreter, rather
  13126. than being called from the main interpreter. Each subinterpreter now has
  13127. its own list of scheduled calls.
  13128. - bpo-1635741: Port _heapq module to multiphase initialization.
  13129. - bpo-1635741: Port itertools module to multiphase initialization
  13130. (:pep:`489`).
  13131. - bpo-37207: Speed up calls to ``frozenset()`` by using the :pep:`590`
  13132. ``vectorcall`` calling convention. Patch by Donghee Na.
  13133. - bpo-39984: subinterpreters: Move
  13134. ``_PyRuntimeState.ceval.tracing_possible`` to
  13135. ``PyInterpreterState.ceval.tracing_possible``: each interpreter now has
  13136. its own variable.
  13137. - bpo-37207: Speed up calls to ``set()`` by using the :pep:`590`
  13138. ``vectorcall`` calling convention. Patch by Donghee Na.
  13139. - bpo-1635741: Port _statistics module to multiphase initialization
  13140. (:pep:`489`).
  13141. - bpo-39968: Use inline function to replace extension modules'
  13142. get_module_state macros.
  13143. - bpo-39965: Correctly raise ``SyntaxError`` if *await* is used inside
  13144. non-async functions and ``PyCF_ALLOW_TOP_LEVEL_AWAIT`` is set (like in the
  13145. asyncio REPL). Patch by Pablo Galindo.
  13146. - bpo-39562: Allow executing asynchronous comprehensions on the top level
  13147. when the ``PyCF_ALLOW_TOP_LEVEL_AWAIT`` flag is given. Patch by Batuhan
  13148. Taskaya.
  13149. - bpo-37207: Speed up calls to ``tuple()`` by using the :pep:`590`
  13150. ``vectorcall`` calling convention. Patch by Donghee Na.
  13151. - bpo-38373: Changed list overallocation strategy. It no longer
  13152. overallocates if the new size is closer to overallocated size than to the
  13153. old size and adds padding.
  13154. - bpo-39926: Update Unicode database to Unicode version 13.0.0.
  13155. - bpo-19466: Clear the frames of daemon threads earlier during the Python
  13156. shutdown to call objects destructors. So "unclosed file" resource warnings
  13157. are now emitted for daemon threads in a more reliable way.
  13158. - bpo-38894: Fix a bug that was causing incomplete results when calling
  13159. ``pathlib.Path.glob`` in the presence of symlinks that point to files
  13160. where the user does not have read access. Patch by Pablo Galindo and Matt
  13161. Wozniski.
  13162. - bpo-39877: Fix :c:func:`PyEval_RestoreThread` random crash at exit with
  13163. daemon threads. It now accesses the ``_PyRuntime`` variable directly
  13164. instead of using ``tstate->interp->runtime``, since ``tstate`` can be a
  13165. dangling pointer after :c:func:`Py_Finalize` has been called. Moreover,
  13166. the daemon thread now exits before trying to take the GIL.
  13167. - bpo-39871: Fix a possible :exc:`SystemError` in
  13168. ``math.{atan2,copysign,remainder}()`` when the first argument cannot be
  13169. converted to a :class:`float`. Patch by Zackery Spytz.
  13170. - bpo-39776: Fix race condition where threads created by PyGILState_Ensure()
  13171. could get a duplicate id.
  13172. This affects consumers of tstate->id like the contextvar caching
  13173. machinery, which could return invalid cached objects under heavy thread
  13174. load (observed in embedded scenarios).
  13175. - bpo-39778: Fixed a crash due to incorrect handling of weak references in
  13176. ``collections.OrderedDict`` classes. Patch by Pablo Galindo.
  13177. - bpo-1635741: Port audioop extension module to multiphase initialization
  13178. (:pep:`489`).
  13179. - bpo-39702: Relax :term:`decorator` grammar restrictions to allow any valid
  13180. expression (:pep:`614`).
  13181. - bpo-38091: Tweak import deadlock detection code to not deadlock itself.
  13182. - bpo-1635741: Port _locale extension module to multiphase initialization
  13183. (:pep:`489`).
  13184. - bpo-39087: Optimize :c:func:`PyUnicode_AsUTF8` and
  13185. :c:func:`PyUnicode_AsUTF8AndSize` slightly when they need to create
  13186. internal UTF-8 cache.
  13187. - bpo-39520: Fix unparsing of ext slices with no items (``foo[:,]``). Patch
  13188. by Batuhan Taskaya.
  13189. - bpo-39220: Do not optimize annotations if 'from __future__ import
  13190. annotations' is used. Patch by Pablo Galindo.
  13191. - bpo-35712: Using :data:`NotImplemented` in a boolean context has been
  13192. deprecated. Patch contributed by Josh Rosenberg.
  13193. - bpo-22490: Don't leak environment variable ``__PYVENV_LAUNCHER__`` into
  13194. the interpreter session on macOS.
  13195. Library
  13196. -------
  13197. - bpo-39830: Add :class:`zipfile.Path` to ``__all__`` in the :mod:`zipfile`
  13198. module.
  13199. - bpo-40000: Improved error messages for validation of ``ast.Constant``
  13200. nodes. Patch by Batuhan Taskaya.
  13201. - bpo-39999: ``__module__`` of the AST node classes is now set to "ast"
  13202. instead of "_ast". Added docstrings for dummy AST node classes and
  13203. deprecated attributes.
  13204. - bpo-39991: :func:`uuid.getnode` now skips IPv6 addresses with the same
  13205. string length than a MAC address (17 characters): only use MAC addresses.
  13206. - bpo-39988: Deprecated ``ast.AugLoad`` and ``ast.AugStore`` node classes
  13207. because they are no longer used.
  13208. - bpo-39656: Ensure ``bin/python3.#`` is always present in virtual
  13209. environments on POSIX platforms - by Anthony Sottile.
  13210. - bpo-39969: Deprecated ``ast.Param`` node class because it's no longer
  13211. used. Patch by Batuhan Taskaya.
  13212. - bpo-39360: Ensure all workers exit when finalizing a
  13213. :class:`multiprocessing.Pool` implicitly via the module finalization
  13214. handlers of multiprocessing. This fixes a deadlock situation that can be
  13215. experienced when the Pool is not properly finalized via the context
  13216. manager or a call to ``multiprocessing.Pool.terminate``. Patch by Batuhan
  13217. Taskaya and Pablo Galindo.
  13218. - bpo-35370: sys.settrace(), sys.setprofile() and _lsprof.Profiler.enable()
  13219. now properly report :c:func:`PySys_Audit` error if "sys.setprofile" or
  13220. "sys.settrace" audit event is denied.
  13221. - bpo-39936: AIX: Fix _aix_support module when the subprocess is not
  13222. available, when building Python from scratch. It now uses new private
  13223. _bootsubprocess module, rather than having two implementations depending
  13224. if subprocess is available or not. So _aix_support.aix_platform() result
  13225. is now the same if subprocess is available or not.
  13226. - bpo-36144: :class:`collections.OrderedDict` now implements ``|`` and
  13227. ``|=`` (:pep:`584`).
  13228. - bpo-39652: The column name found in ``sqlite3.Cursor.description`` is now
  13229. truncated on the first '[' only if the PARSE_COLNAMES option is set.
  13230. - bpo-39915: Ensure :attr:`unittest.mock.AsyncMock.await_args_list` has call
  13231. objects in the order of awaited arguments instead of using
  13232. :attr:`unittest.mock.Mock.call_args` which has the last value of the call.
  13233. Patch by Karthikeyan Singaravelan.
  13234. - bpo-36144: Updated :data:`os.environ` and :data:`os.environb` to support
  13235. :pep:`584`'s merge (``|``) and update (``|=``) operators.
  13236. - bpo-38662: The ``ensurepip`` module now invokes ``pip`` via the ``runpy``
  13237. module. Hence it is no longer tightly coupled with the internal API of the
  13238. bundled ``pip`` version, allowing easier updates to a newer ``pip``
  13239. version both internally and for distributors.
  13240. - bpo-38075: Fix the :meth:`random.Random.seed` method when a :class:`bool`
  13241. is passed as the seed.
  13242. - bpo-39916: More reliable use of ``os.scandir()`` in ``Path.glob()``. It no
  13243. longer emits a ResourceWarning when interrupted.
  13244. - bpo-39850: :mod:`multiprocessing` now supports abstract socket addresses
  13245. (if abstract sockets are supported in the running platform). When creating
  13246. arbitrary addresses (like when default-constructing
  13247. :class:`multiprocessing.connection.Listener` objects) abstract sockets are
  13248. preferred to avoid the case when the temporary-file-generated address is
  13249. too large for an AF_UNIX socket address. Patch by Pablo Galindo.
  13250. - bpo-36287: :func:`ast.dump()` no longer outputs optional fields and
  13251. attributes with default values. The default values for optional fields and
  13252. attributes of AST nodes are now set as class attributes (e.g.
  13253. ``Constant.kind`` is set to ``None``).
  13254. - bpo-39889: Fixed :func:`ast.unparse` for extended slices containing a
  13255. single element (e.g. ``a[i:j,]``). Remove redundant tuples when index with
  13256. a tuple (e.g. ``a[i, j]``).
  13257. - bpo-39828: Fix :mod:`json.tool` to catch :exc:`BrokenPipeError`. Patch by
  13258. Donghee Na.
  13259. - bpo-13487: Avoid a possible *"RuntimeError: dictionary changed size during
  13260. iteration"* from :func:`inspect.getmodule` when it tried to loop through
  13261. :data:`sys.modules`.
  13262. - bpo-39674: Revert "bpo-37330: open() no longer accept 'U' in file mode".
  13263. The "U" mode of open() is kept in Python 3.9 to ease transition from
  13264. Python 2.7, but will be removed in Python 3.10.
  13265. - bpo-28577: The hosts method on 32-bit prefix length IPv4Networks and
  13266. 128-bit prefix IPv6Networks now returns a list containing the single
  13267. Address instead of an empty list.
  13268. - bpo-39826: Add getConnection method to logging HTTPHandler to enable
  13269. custom connections.
  13270. - bpo-39763: Reimplement ``distutils.spawn.spawn`` function with the
  13271. :mod:`subprocess` module.
  13272. - bpo-39794: Add --without-decimal-contextvar build option. This enables a
  13273. thread-local rather than a coroutine local context.
  13274. - bpo-36144: :class:`collections.defaultdict` now implements ``|``
  13275. (:pep:`584`).
  13276. - bpo-39517: Fix runpy.run_path() when using pathlike objects
  13277. - bpo-39775: Change ``inspect.Signature.parameters`` back to
  13278. ``collections.OrderedDict``. This was changed to ``dict`` in Python
  13279. 3.9.0a4.
  13280. - bpo-39678: Refactor queue_manager in
  13281. :class:`concurrent.futures.ProcessPoolExecutor` to make it easier to
  13282. maintain.
  13283. - bpo-39764: Fix AttributeError when calling get_stack on a PyAsyncGenObject
  13284. Task
  13285. - bpo-39769: The :func:`compileall.compile_dir` function's *ddir* parameter
  13286. and the compileall command line flag ``-d`` no longer write the wrong
  13287. pathname to the generated pyc file for submodules beneath the root of the
  13288. directory tree being compiled. This fixes a regression introduced with
  13289. Python 3.5.
  13290. - bpo-36144: :class:`types.MappingProxyType` objects now support the merge
  13291. (``|``) operator from :pep:`584`.
  13292. - bpo-38691: The :mod:`importlib` module now ignores the
  13293. :envvar:`PYTHONCASEOK` environment variable when the :option:`-E` or
  13294. :option:`-I` command line options are being used.
  13295. - bpo-39719: Remove :meth:`tempfile.SpooledTemporaryFile.softspace` as files
  13296. no longer have the ``softspace`` attribute in Python 3. Patch by Shantanu.
  13297. - bpo-39667: Improve pathlib.Path compatibility on zipfile.Path and correct
  13298. performance degradation as found in zipp 3.0.
  13299. - bpo-39638: Keep ASDL signatures in the docstrings for ``AST`` nodes. Patch
  13300. by Batuhan Taskaya
  13301. - bpo-39639: Deprecated ``ast.Suite`` node class because it's no longer
  13302. used. Patch by Batuhan Taskaya.
  13303. - bpo-39609: Add thread_name_prefix to default asyncio executor
  13304. - bpo-39548: Fix handling of header in
  13305. :class:`urllib.request.AbstractDigestAuthHandler` when the optional
  13306. ``qop`` parameter is not present.
  13307. - bpo-39509: HTTP status codes ``103 EARLY_HINTS`` and ``425 TOO_EARLY`` are
  13308. added to :class:`http.HTTPStatus`. Patch by Donghee Na.
  13309. - bpo-39507: Adding HTTP status 418 "I'm a Teapot" to HTTPStatus in http
  13310. library. Patch by Ross Rhodes.
  13311. - bpo-39495: Remove default value from *attrs* parameter of
  13312. :meth:`xml.etree.ElementTree.TreeBuilder.start` for consistency between
  13313. Python and C implementations.
  13314. - bpo-38971: Open issue in the BPO indicated a desire to make the
  13315. implementation of codecs.open() at parity with io.open(), which implements
  13316. a try/except to assure file stream gets closed before an exception is
  13317. raised.
  13318. - bpo-38641: Added starred expressions support to ``return`` and ``yield``
  13319. statements for ``lib2to3``. Patch by Vlad Emelianov.
  13320. - bpo-37534: When using minidom module to generate XML documents the ability
  13321. to add Standalone Document Declaration is added. All the changes are made
  13322. to generate a document in compliance with Extensible Markup Language (XML)
  13323. 1.0 (Fifth Edition) W3C Recommendation (available here:
  13324. https://www.w3.org/TR/xml/#sec-prolog-dtd).
  13325. - bpo-34788: Add support for scoped IPv6 addresses to :mod:`ipaddress`.
  13326. Patch by Oleksandr Pavliuk.
  13327. - bpo-34822: Simplified AST for subscription. Simple indices are now
  13328. represented by their value, extended slices are represented as tuples.
  13329. :mod:`ast` classes ``Index`` and ``ExtSlice`` are considered deprecated
  13330. and will be removed in future Python versions. In the meantime,
  13331. ``Index(value)`` now returns a ``value`` itself, ``ExtSlice(slices)``
  13332. returns ``Tuple(slices, Load())``.
  13333. Documentation
  13334. -------------
  13335. - bpo-39868: Updated the Language Reference for :pep:`572`.
  13336. - bpo-13790: Change 'string' to 'specification' in format doc.
  13337. - bpo-17422: The language reference no longer restricts default class
  13338. namespaces to dicts only.
  13339. - bpo-39530: Fix misleading documentation about mixed-type numeric
  13340. comparisons.
  13341. - bpo-39718: Update :mod:`token` documentation to reflect additions in
  13342. Python 3.8
  13343. - bpo-39677: Changed operand name of **MAKE_FUNCTION** from *argc* to
  13344. *flags* for module :mod:`dis`
  13345. Tests
  13346. -----
  13347. - bpo-40019: test_gdb now skips tests if it detects that gdb failed to read
  13348. debug information because the Python binary is optimized.
  13349. - bpo-27807: ``test_site.test_startup_imports()`` is now skipped if a path
  13350. of :data:`sys.path` contains a ``.pth`` file.
  13351. - bpo-26067: Do not fail test_shutil test_chown test when uid or gid of user
  13352. cannot be resolved to a name.
  13353. - bpo-39855: test_subprocess.test_user() now skips the test on an user name
  13354. if the user name doesn't exist. For example, skip the test if the user
  13355. "nobody" doesn't exist on Linux.
  13356. Build
  13357. -----
  13358. - bpo-39761: Fix build with DTrace but without additional DFLAGS.
  13359. - bpo-39763: setup.py now uses a basic implementation of the
  13360. :mod:`subprocess` module if the :mod:`subprocess` module is not available:
  13361. before required C extension modules are built.
  13362. - bpo-1294959: Add ``--with-platlibdir`` option to the configure script:
  13363. name of the platform-specific library directory, stored in the new
  13364. :data:`sys.platlibdir` attribute. It is used to build the path of
  13365. platform-specific extension modules and the path of the standard library.
  13366. It is equal to ``"lib"`` on most platforms. On Fedora and SuSE, it is
  13367. equal to ``"lib64"`` on 64-bit platforms. Patch by Jan Matějek, Matěj
  13368. Cepl, Charalampos Stratakis and Victor Stinner.
  13369. Windows
  13370. -------
  13371. - bpo-39930: Ensures the required :file:`vcruntime140.dll` is included in
  13372. install packages.
  13373. - bpo-39847: Avoid hang when computer is hibernated whilst waiting for a
  13374. mutex (for lock-related objects from :mod:`threading`) around 49-day
  13375. uptime.
  13376. - bpo-38597: ``distutils`` will no longer statically link
  13377. :file:`vcruntime140.dll` when a redistributable version is unavailable.
  13378. All future releases of CPython will include a copy of this DLL to ensure
  13379. distributed extensions can continue to load.
  13380. - bpo-38380: Update Windows builds to use SQLite 3.31.1
  13381. - bpo-39789: Update Windows release build machines to Visual Studio 2019
  13382. (MSVC 14.2).
  13383. - bpo-34803: Package for nuget.org now includes repository reference and
  13384. bundled icon image.
  13385. macOS
  13386. -----
  13387. - bpo-38380: Update macOS builds to use SQLite 3.31.1
  13388. IDLE
  13389. ----
  13390. - bpo-27115: For 'Go to Line', use a Query box subclass with IDLE standard
  13391. behavior and improved error checking.
  13392. - bpo-39885: Since clicking to get an IDLE context menu moves the cursor,
  13393. any text selection should be and now is cleared.
  13394. - bpo-39852: Edit "Go to line" now clears any selection, preventing
  13395. accidental deletion. It also updates Ln and Col on the status bar.
  13396. - bpo-39781: Selecting code context lines no longer causes a jump.
  13397. Tools/Demos
  13398. -----------
  13399. - bpo-36184: Port python-gdb.py to FreeBSD. python-gdb.py now checks for
  13400. "take_gil" function name to check if a frame tries to acquire the GIL,
  13401. instead of checking for "pthread_cond_timedwait" which is specific to
  13402. Linux and can be a different condition than the GIL.
  13403. - bpo-38080: Added support to fix ``getproxies`` in the
  13404. :mod:`!lib2to3.fixes.fix_urllib` module. Patch by José Roberto Meza
  13405. Cabrera.
  13406. C API
  13407. -----
  13408. - bpo-40024: Add :c:func:`PyModule_AddType` helper function: add a type to a
  13409. module. Patch by Donghee Na.
  13410. - bpo-39946: Remove ``_PyRuntime.getframe`` hook and remove
  13411. ``_PyThreadState_GetFrame`` macro which was an alias to
  13412. ``_PyRuntime.getframe``. They were only exposed by the internal C API.
  13413. Remove also ``PyThreadFrameGetter`` type.
  13414. - bpo-39947: Add :c:func:`PyThreadState_GetFrame` function: get the current
  13415. frame of a Python thread state.
  13416. - bpo-37207: Add _PyArg_NoKwnames helper function. Patch by Donghee Na.
  13417. - bpo-39947: Add :c:func:`PyThreadState_GetInterpreter`: get the interpreter
  13418. of a Python thread state.
  13419. - bpo-39947: Add :c:func:`PyInterpreterState_Get` function to the limited C
  13420. API.
  13421. - bpo-35370: If :c:func:`PySys_Audit` fails in :c:func:`PyEval_SetProfile`
  13422. or :c:func:`PyEval_SetTrace`, log the error as an unraisable exception.
  13423. - bpo-39947: Move the static inline function flavor of
  13424. Py_EnterRecursiveCall() and Py_LeaveRecursiveCall() to the internal C API:
  13425. they access PyThreadState attributes. The limited C API provides regular
  13426. functions which hide implementation details.
  13427. - bpo-39947: Py_TRASHCAN_BEGIN_CONDITION and Py_TRASHCAN_END macro no longer
  13428. access PyThreadState attributes, but call new private _PyTrash_begin() and
  13429. _PyTrash_end() functions which hide implementation details.
  13430. - bpo-39884: :c:func:`PyDescr_NewMethod` and :c:func:`PyCFunction_NewEx` now
  13431. include the method name in the SystemError "bad call flags" error message
  13432. to ease debug.
  13433. - bpo-39877: Deprecated :c:func:`!PyEval_InitThreads` and
  13434. :c:func:`!PyEval_ThreadsInitialized`. Calling
  13435. :c:func:`!PyEval_InitThreads` now does nothing.
  13436. - bpo-38249: :c:macro:`Py_UNREACHABLE` is now implemented with
  13437. ``__builtin_unreachable()`` and analogs in release mode.
  13438. - bpo-38643: :c:func:`PyNumber_ToBase` now raises a :exc:`SystemError`
  13439. instead of crashing when called with invalid base.
  13440. - bpo-39882: The :c:func:`Py_FatalError` function is replaced with a macro
  13441. which logs automatically the name of the current function, unless the
  13442. ``Py_LIMITED_API`` macro is defined.
  13443. - bpo-39824: Extension modules: :c:member:`~PyModuleDef.m_traverse`,
  13444. :c:member:`~PyModuleDef.m_clear` and :c:member:`~PyModuleDef.m_free`
  13445. functions of :c:type:`PyModuleDef` are no longer called if the module
  13446. state was requested but is not allocated yet. This is the case immediately
  13447. after the module is created and before the module is executed
  13448. (:c:data:`Py_mod_exec` function). More precisely, these functions are not
  13449. called if :c:member:`~PyModuleDef.m_size` is greater than 0 and the module
  13450. state (as returned by :c:func:`PyModule_GetState`) is ``NULL``.
  13451. Extension modules without module state (``m_size <= 0``) are not affected.
  13452. - bpo-38913: Fixed segfault in ``Py_BuildValue()`` called with a format
  13453. containing "#" and undefined PY_SSIZE_T_CLEAN whwn an exception is set.
  13454. - bpo-38500: Add a private API to get and set the frame evaluation function:
  13455. add :c:func:`_PyInterpreterState_GetEvalFrameFunc` and
  13456. :c:func:`_PyInterpreterState_SetEvalFrameFunc` C functions. The
  13457. :c:type:`_PyFrameEvalFunction` function type now takes a *tstate*
  13458. parameter.
  13459. What's New in Python 3.9.0 alpha 4?
  13460. ===================================
  13461. *Release date: 2020-02-25*
  13462. Security
  13463. --------
  13464. - bpo-39184: Add audit events to functions in ``fcntl``, ``msvcrt``, ``os``,
  13465. ``resource``, ``shutil``, ``signal`` and ``syslog``.
  13466. - bpo-39401: Avoid unsafe DLL load at startup on Windows 7 and earlier.
  13467. - bpo-39184: Add audit events to command execution functions in os and pty
  13468. modules.
  13469. Core and Builtins
  13470. -----------------
  13471. - bpo-39382: Fix a use-after-free in the single inheritance path of
  13472. ``issubclass()``, when the ``__bases__`` of an object has a single
  13473. reference, and so does its first item. Patch by Yonatan Goldschmidt.
  13474. - bpo-39573: Update clinic tool to use :c:func:`Py_IS_TYPE`. Patch by
  13475. Donghee Na.
  13476. - bpo-39619: Enable use of :func:`os.chroot` on HP-UX systems.
  13477. - bpo-39573: Add :c:func:`Py_IS_TYPE` static inline function to check
  13478. whether the object *o* type is *type*.
  13479. - bpo-39606: Fix regression caused by fix for bpo-39386, that prevented
  13480. calling ``aclose`` on an async generator that had already been closed or
  13481. exhausted.
  13482. - bpo-39579: Change the ending column offset of ``Attribute`` nodes
  13483. constructed in ``ast_for_dotted_name`` to point at the end of the current
  13484. node and not at the end of the last ``NAME`` node.
  13485. - bpo-1635741: Port _crypt extension module to multiphase initialization
  13486. (:pep:`489`).
  13487. - bpo-1635741: Port _contextvars extension module to multiphase
  13488. initialization (:pep:`489`).
  13489. - bpo-39510: Fix segfault in ``readinto()`` method on closed BufferedReader.
  13490. - bpo-39502: Fix :func:`time.localtime` on 64-bit AIX to support years
  13491. before 1902 and after 2038. Patch by M Felt.
  13492. - bpo-39492: Fix a reference cycle in the C Pickler that was preventing the
  13493. garbage collection of deleted, pickled objects.
  13494. - bpo-39453: Fixed a possible crash in :meth:`list.__contains__` when a list
  13495. is changed during comparing items. Patch by Donghee Na.
  13496. - bpo-39434: :term:`floor division` of float operation now has a better
  13497. performance. Also the message of :exc:`ZeroDivisionError` for this
  13498. operation is updated. Patch by Donghee Na.
  13499. - bpo-1635741: Port _codecs extension module to multiphase initialization
  13500. (:pep:`489`).
  13501. - bpo-1635741: Port _bz2 extension module to multiphase initialization
  13502. (:pep:`489`).
  13503. - bpo-1635741: Port _abc extension module to multiphase initialization
  13504. (:pep:`489`).
  13505. - bpo-39320: Replace two complex bytecodes for building dicts with two
  13506. simpler ones. The new bytecodes ``DICT_MERGE`` and ``DICT_UPDATE`` have
  13507. been added The old bytecodes ``BUILD_MAP_UNPACK`` and
  13508. ``BUILD_MAP_UNPACK_WITH_CALL`` have been removed.
  13509. - bpo-39219: Syntax errors raised in the tokenizer now always set correct
  13510. "text" and "offset" attributes.
  13511. - bpo-36051: Drop the GIL during large ``bytes.join`` operations. Patch by
  13512. Bruce Merry.
  13513. - bpo-38960: Fix DTrace build issues on FreeBSD. Patch by David Carlier.
  13514. - bpo-37207: Speed up calls to ``range()`` by about 30%, by using the PEP
  13515. 590 ``vectorcall`` calling convention. Patch by Mark Shannon.
  13516. - bpo-36144: :class:`dict` (and :class:`collections.UserDict`) objects now
  13517. support PEP 584's merge (``|``) and update (``|=``) operators. Patch by
  13518. Brandt Bucher.
  13519. - bpo-32856: Optimized the idiom for assignment a temporary variable in
  13520. comprehensions. Now ``for y in [expr]`` in comprehensions is as fast as a
  13521. simple assignment ``y = expr``.
  13522. Library
  13523. -------
  13524. - bpo-30566: Fix :exc:`IndexError` when trying to decode an invalid string
  13525. with punycode codec.
  13526. - bpo-39649: Remove obsolete check for ``__args__`` in
  13527. ``bdb.Bdb.format_stack_entry``.
  13528. - bpo-39648: Expanded :func:`math.gcd` and :func:`math.lcm` to handle
  13529. multiple arguments.
  13530. - bpo-39681: Fix a regression where the C pickle module wouldn't allow
  13531. unpickling from a file-like object that doesn't expose a readinto()
  13532. method.
  13533. - bpo-35950: Raise :exc:`io.UnsupportedOperation` in
  13534. :meth:`io.BufferedReader.truncate` when it is called on a read-only
  13535. :class:`io.BufferedReader` instance.
  13536. - bpo-39479: Add :func:`math.lcm` function: least common multiple.
  13537. - bpo-39674: Revert "Do not expose abstract collection classes in the
  13538. collections module" change (bpo-25988). Aliases to ABC like
  13539. collections.Mapping are kept in Python 3.9 to ease transition from Python
  13540. 2.7, but will be removed in Python 3.10.
  13541. - bpo-39104: Fix hanging ProcessPoolExcutor on ``shutdown(wait=False)`` when
  13542. a task has failed pickling.
  13543. - bpo-39627: Fixed TypedDict totality check for inherited keys.
  13544. - bpo-39474: Fixed starting position of AST for expressions like ``(a)(b)``,
  13545. ``(a)[b]`` and ``(a).b``.
  13546. - bpo-21016: The :mod:`pydoc` and :mod:`trace` modules now use the
  13547. :mod:`sysconfig` module to get the path to the Python standard library, to
  13548. support uncommon installation path like ``/usr/lib64/python3.9/`` on
  13549. Fedora. Patch by Jan Matějek.
  13550. - bpo-39590: Collections.deque now holds strong references during
  13551. deque.__contains__ and deque.count, fixing crashes.
  13552. - bpo-39586: The distutils ``bdist_msi`` command is deprecated in Python
  13553. 3.9, use ``bdist_wheel`` (wheel packages) instead.
  13554. - bpo-39595: Improved performance of zipfile.Path for files with a large
  13555. number of entries. Also improved performance and fixed minor issue as
  13556. published with `importlib_metadata 1.5
  13557. <https://importlib-metadata.readthedocs.io/en/latest/history.html#v1-5-0>`_.
  13558. - bpo-39350: Fix regression in :class:`fractions.Fraction` if the numerator
  13559. and/or the denominator is an :class:`int` subclass. The :func:`math.gcd`
  13560. function is now used to normalize the *numerator* and *denominator*.
  13561. :func:`math.gcd` always return a :class:`int` type. Previously, the GCD
  13562. type depended on *numerator* and *denominator*.
  13563. - bpo-39567: Added audit for :func:`os.walk`, :func:`os.fwalk`,
  13564. :meth:`pathlib.Path.glob` and :meth:`pathlib.Path.rglob`.
  13565. - bpo-39559: Remove unused, undocumented argument ``getters`` from
  13566. :func:`uuid.getnode`
  13567. - bpo-38149: :func:`sys.audit` is now called only once per call of
  13568. :func:`glob.glob` and :func:`glob.iglob`.
  13569. - bpo-39546: Fix a regression in :class:`~argparse.ArgumentParser` where
  13570. ``allow_abbrev=False`` was ignored for long options that used a prefix
  13571. character other than "-".
  13572. - bpo-39450: Striped whitespace from docstring before returning it from
  13573. :func:`unittest.case.shortDescription`.
  13574. - bpo-12915: A new function ``resolve_name`` has been added to the
  13575. ``pkgutil`` module. This resolves a string of the form ``'a.b.c.d'`` or
  13576. ``'a.b:c.d'`` to an object. In the example, ``a.b`` is a package/module
  13577. and ``c.d`` is an object within that package/module reached via recursive
  13578. attribute access.
  13579. - bpo-39353: The :func:`binascii.crc_hqx` function is no longer deprecated.
  13580. - bpo-39493: Mark ``typing.IO.closed`` as a property
  13581. - bpo-39491: Add :data:`typing.Annotated` and ``include_extras`` parameter
  13582. to :func:`typing.get_type_hints` as part of :pep:`593`. Patch by Till
  13583. Varoquaux, documentation by Till Varoquaux and Konstantin Kashin.
  13584. - bpo-39485: Fix a bug in :func:`unittest.mock.create_autospec` that would
  13585. complain about the wrong number of arguments for custom descriptors
  13586. defined in an extension module returning functions.
  13587. - bpo-38932: Mock fully resets child objects on reset_mock(). Patch by
  13588. Vegard Stikbakke
  13589. - bpo-39082: Allow AsyncMock to correctly patch static/class methods
  13590. - bpo-39432: Implement PEP-489 algorithm for non-ascii "PyInit\_..." symbol
  13591. names in distutils to make it export the correct init symbol also on
  13592. Windows.
  13593. - bpo-18819: Omit ``devmajor`` and ``devminor`` fields for non-device files
  13594. in :mod:`tarfile` archives, enabling bit-for-bit compatibility with GNU
  13595. ``tar(1)``.
  13596. - bpo-39349: Added a new *cancel_futures* parameter to
  13597. :meth:`concurrent.futures.Executor.shutdown` that cancels all pending
  13598. futures which have not started running, instead of waiting for them to
  13599. complete before shutting down the executor.
  13600. - bpo-39274: ``bool(fraction.Fraction)`` now returns a boolean even if
  13601. (numerator != 0) does not return a boolean (ex: numpy number).
  13602. - bpo-34793: Remove support for ``with (await asyncio.lock):`` and ``with
  13603. (yield from asyncio.lock):``. The same is correct for
  13604. ``asyncio.Condition`` and ``asyncio.Semaphore``.
  13605. - bpo-25597: Ensure, if ``wraps`` is supplied to
  13606. :class:`unittest.mock.MagicMock`, it is used to calculate return values
  13607. for the magic methods instead of using the default return values. Patch by
  13608. Karthikeyan Singaravelan.
  13609. - bpo-36350: ``inspect.Signature.parameters`` and
  13610. ``inspect.BoundArguments.arguments`` are now dicts instead of
  13611. OrderedDicts. Patch contributed by Rémi Lapeyre.
  13612. - bpo-35727: Fix sys.exit() and sys.exit(None) exit code propagation when
  13613. used in multiprocessing.Process.
  13614. - bpo-32173: * Add ``lazycache`` function to ``__all__``. * Use
  13615. ``dict.clear`` to clear the cache. * Refactoring ``getline`` function and
  13616. ``checkcache`` function.
  13617. Documentation
  13618. -------------
  13619. - bpo-17422: The language reference now specifies restrictions on class
  13620. namespaces. Adapted from a patch by Ethan Furman.
  13621. - bpo-39572: Updated documentation of ``total`` flag of ``TypedDict``.
  13622. - bpo-39654: In pyclbr doc, update 'class' to 'module' where appropriate and
  13623. add readmodule comment. Patch by Hakan Çelik.
  13624. - bpo-39153: Clarify refcounting semantics for the following functions: -
  13625. PyObject_SetItem - PyMapping_SetItemString - PyDict_SetItem -
  13626. PyDict_SetItemString
  13627. - bpo-39392: Explain that when filling with turtle, overlap regions may be
  13628. left unfilled.
  13629. - bpo-39369: Update mmap readline method description. The fact that the
  13630. readline method does update the file position should not be ignored since
  13631. this might give the impression for the programmer that it doesn't update
  13632. it.
  13633. - bpo-9056: Include subsection in TOC for PDF version of docs.
  13634. Tests
  13635. -----
  13636. - bpo-38325: Skip tests on non-BMP characters of test_winconsoleio.
  13637. - bpo-39502: Skip test_zipfile.test_add_file_after_2107() if
  13638. :func:`time.localtime` fails with :exc:`OverflowError`. It is the case on
  13639. AIX 6.1 for example.
  13640. Build
  13641. -----
  13642. - bpo-39489: Remove ``COUNT_ALLOCS`` special build.
  13643. Windows
  13644. -------
  13645. - bpo-39553: Delete unused code related to SxS manifests.
  13646. - bpo-39439: Honor the Python path when a virtualenv is active on Windows.
  13647. - bpo-39393: Improve the error message when attempting to load a DLL with
  13648. unresolved dependencies.
  13649. - bpo-38883: :meth:`~pathlib.Path.home()` and
  13650. :meth:`~pathlib.Path.expanduser()` on Windows now prefer
  13651. :envvar:`USERPROFILE` and no longer use :envvar:`HOME`, which is not
  13652. normally set for regular user accounts. This makes them again behave like
  13653. :func:`os.path.expanduser`, which was changed to ignore :envvar:`HOME` in
  13654. 3.8, see :issue:`36264`.
  13655. - bpo-39185: The build.bat script has additional options for very-quiet
  13656. output (-q) and very-verbose output (-vv)
  13657. IDLE
  13658. ----
  13659. - bpo-39663: Add tests for pyparse find_good_parse_start().
  13660. - bpo-39600: In the font configuration window, remove duplicated font names.
  13661. - bpo-30780: Add remaining configdialog tests for buttons and highlights and
  13662. keys tabs.
  13663. - bpo-39388: IDLE Settings Cancel button now cancels pending changes
  13664. - bpo-38792: Close an IDLE shell calltip if a :exc:`KeyboardInterrupt` or
  13665. shell restart occurs. Patch by Zackery Spytz.
  13666. C API
  13667. -----
  13668. - bpo-35081: Move the ``bytes_methods.h`` header file to the internal C API
  13669. as ``pycore_bytes_methods.h``: it only contains private symbols (prefixed
  13670. by ``_Py``), except of the ``PyDoc_STRVAR_shared()`` macro.
  13671. - bpo-35081: Move the ``dtoa.h`` header file to the internal C API as
  13672. ``pycore_dtoa.h``: it only contains private functions (prefixed by
  13673. ``_Py``). The :mod:`math` and :mod:`cmath` modules must now be compiled
  13674. with the ``Py_BUILD_CORE`` macro defined.
  13675. - bpo-39573: Add :c:func:`Py_SET_SIZE` function to set the size of an
  13676. object.
  13677. - bpo-39500: :c:func:`PyUnicode_IsIdentifier` does not call
  13678. :c:func:`Py_FatalError` anymore if the string is not ready.
  13679. - bpo-39573: Add :c:func:`Py_SET_TYPE` function to set the type of an
  13680. object.
  13681. - bpo-39573: Add a :c:func:`Py_SET_REFCNT` function to set the reference
  13682. counter of an object.
  13683. - bpo-39542: Convert :c:func:`PyType_HasFeature`, :c:func:`PyType_Check` and
  13684. :c:func:`PyType_CheckExact` macros to static inline functions.
  13685. - bpo-39542: In the limited C API, ``PyObject_INIT()`` and
  13686. ``PyObject_INIT_VAR()`` are now defined as aliases to
  13687. :c:func:`PyObject_Init` and :c:func:`PyObject_InitVar` to make their
  13688. implementation opaque. It avoids to leak implementation details in the
  13689. limited C API. Exclude the following functions from the limited C API:
  13690. ``_Py_NewReference()``, ``_Py_ForgetReference()``,
  13691. ``_PyTraceMalloc_NewReference()`` and ``_Py_GetRefTotal()``.
  13692. - bpo-39542: Exclude trashcan mechanism from the limited C API: it requires
  13693. access to PyTypeObject and PyThreadState structure fields, whereas these
  13694. structures are opaque in the limited C API.
  13695. - bpo-39511: The :c:func:`PyThreadState_Clear` function now calls the
  13696. :c:member:`PyThreadState.on_delete` callback. Previously, that happened in
  13697. :c:func:`PyThreadState_Delete`.
  13698. - bpo-38076: Fix to clear the interpreter state only after clearing module
  13699. globals to guarantee module state access from C Extensions during runtime
  13700. destruction
  13701. - bpo-39245: The Vectorcall API (PEP 590) was made public, adding the
  13702. functions ``PyObject_Vectorcall``, ``PyObject_VectorcallMethod``,
  13703. ``PyVectorcall_Function``, ``PyObject_CallOneArg``,
  13704. ``PyObject_CallMethodNoArgs``, ``PyObject_CallMethodOneArg``,
  13705. ``PyObject_FastCallDict``, and the flag ``Py_TPFLAGS_HAVE_VECTORCALL``.
  13706. What's New in Python 3.9.0 alpha 3?
  13707. ===================================
  13708. *Release date: 2020-01-24*
  13709. Core and Builtins
  13710. -----------------
  13711. - bpo-39427: Document all possibilities for the ``-X`` options in the
  13712. command line help section. Patch by Pablo Galindo.
  13713. - bpo-39421: Fix possible crashes when operating with the functions in the
  13714. :mod:`heapq` module and custom comparison operators.
  13715. - bpo-39386: Prevent double awaiting of async iterator.
  13716. - bpo-17005: Add :class:`functools.TopologicalSorter` to the
  13717. :mod:`functools` module to offers functionality to perform topological
  13718. sorting of graphs. Patch by Pablo Galindo, Tim Peters and Larry Hastings.
  13719. - bpo-39320: Replace four complex bytecodes for building sequences with
  13720. three simpler ones.
  13721. The following four bytecodes have been removed:
  13722. * BUILD_LIST_UNPACK
  13723. * BUILD_TUPLE_UNPACK
  13724. * BUILD_SET_UNPACK
  13725. * BUILD_TUPLE_UNPACK_WITH_CALL
  13726. The following three bytecodes have been added:
  13727. * LIST_TO_TUPLE
  13728. * LIST_EXTEND
  13729. * SET_UPDATE
  13730. - bpo-39336: Import loaders which publish immutable module objects can now
  13731. publish immutable packages in addition to individual modules.
  13732. - bpo-39322: Added a new function :func:`gc.is_finalized` to check if an
  13733. object has been finalized by the garbage collector. Patch by Pablo
  13734. Galindo.
  13735. - bpo-39048: Improve the displayed error message when incorrect types are
  13736. passed to ``async with`` statements by looking up the :meth:`__aenter__`
  13737. special method before the :meth:`__aexit__` special method when entering
  13738. an asynchronous context manager. Patch by Géry Ogam.
  13739. - bpo-39235: Fix AST end location for lone generator expression in function
  13740. call, e.g. f(i for i in a).
  13741. - bpo-39209: Correctly handle multi-line tokens in interactive mode. Patch
  13742. by Pablo Galindo.
  13743. - bpo-1635741: Port _json extension module to multiphase initialization
  13744. (:pep:`489`).
  13745. - bpo-39216: Fix constant folding optimization for positional only arguments
  13746. - by Anthony Sottile.
  13747. - bpo-39215: Fix ``SystemError`` when nested function has annotation on
  13748. positional-only argument - by Anthony Sottile.
  13749. - bpo-39200: Correct the error message when calling the :func:`min` or
  13750. :func:`max` with no arguments. Patch by Donghee Na.
  13751. - bpo-39200: Correct the error message when trying to construct
  13752. :class:`range` objects with no arguments. Patch by Pablo Galindo.
  13753. - bpo-39166: Fix incorrect line execution reporting in trace functions when
  13754. tracing the last iteration of asynchronous for loops. Patch by Pablo
  13755. Galindo.
  13756. - bpo-39114: Fix incorrect line execution reporting in trace functions when
  13757. tracing exception handlers with name binding. Patch by Pablo Galindo.
  13758. - bpo-39156: Split the COMPARE_OP bytecode instruction into four distinct
  13759. instructions.
  13760. * COMPARE_OP for rich comparisons
  13761. * IS_OP for 'is' and 'is not' tests
  13762. * CONTAINS_OP for 'in' and 'is not' tests
  13763. * JUMP_IF_NOT_EXC_MATCH for checking exceptions in 'try-except' statements.
  13764. This improves the clarity of the interpreter and should provide a modest
  13765. speedup.
  13766. - bpo-38588: Fix possible crashes in dict and list when calling
  13767. :c:func:`PyObject_RichCompareBool`.
  13768. - bpo-13601: By default, ``sys.stderr`` is line-buffered now, even if
  13769. ``stderr`` is redirected to a file. You can still make ``sys.stderr``
  13770. unbuffered by passing the :option:`-u` command-line option or setting the
  13771. :envvar:`PYTHONUNBUFFERED` environment variable.
  13772. (Contributed by Jendrik Seipp in bpo-13601.)
  13773. - bpo-38610: Fix possible crashes in several list methods by holding strong
  13774. references to list elements when calling
  13775. :c:func:`PyObject_RichCompareBool`.
  13776. - bpo-32021: Include brotli .br encoding in mimetypes encodings_map
  13777. Library
  13778. -------
  13779. - bpo-39430: Fixed race condition in lazy imports in :mod:`tarfile`.
  13780. - bpo-39413: The :func:`os.unsetenv` function is now also available on
  13781. Windows.
  13782. - bpo-39390: Fixed a regression with the ``ignore`` callback of
  13783. :func:`shutil.copytree`. The argument types are now ``str`` and
  13784. ``List[str]`` again.
  13785. - bpo-39395: The :func:`os.putenv` and :func:`os.unsetenv` functions are now
  13786. always available.
  13787. - bpo-39406: If ``setenv()`` C function is available, :func:`os.putenv` is
  13788. now implemented with ``setenv()`` instead of ``putenv()``, so Python
  13789. doesn't have to handle the environment variable memory.
  13790. - bpo-39396: Fix ``math.nextafter(-0.0, +0.0)`` on AIX 7.1.
  13791. - bpo-29435: Allow :func:`tarfile.is_tarfile` to be used with file and
  13792. file-like objects, like :func:`zipfile.is_zipfile`. Patch by William
  13793. Woodruff.
  13794. - bpo-39377: Removed ``encoding`` option from :func:`json.loads`. It has
  13795. been deprecated since Python 3.1.
  13796. - bpo-39389: Write accurate compression level metadata in :mod:`gzip`
  13797. archives, rather than always signaling maximum compression.
  13798. - bpo-39366: The previously deprecated ``xpath()`` and ``xgtitle()`` methods
  13799. of :class:`nntplib.NNTP` have been removed.
  13800. - bpo-39357: Remove the *buffering* parameter of :class:`bz2.BZ2File`. Since
  13801. Python 3.0, it was ignored and using it was emitting
  13802. :exc:`DeprecationWarning`. Pass an open file object, to control how the
  13803. file is opened. The *compresslevel* parameter becomes keyword-only.
  13804. - bpo-39353: Deprecate binhex4 and hexbin4 standards. Deprecate the
  13805. :mod:`binhex` module and the following :mod:`binascii` functions:
  13806. :func:`~binascii.b2a_hqx`, :func:`~binascii.a2b_hqx`,
  13807. :func:`~binascii.rlecode_hqx`, :func:`~binascii.rledecode_hqx`,
  13808. :func:`~binascii.crc_hqx`.
  13809. - bpo-39351: Remove ``base64.encodestring()`` and ``base64.decodestring()``,
  13810. aliases deprecated since Python 3.1: use :func:`base64.encodebytes` and
  13811. :func:`base64.decodebytes` instead.
  13812. - bpo-39350: Remove ``fractions.gcd()`` function, deprecated since Python
  13813. 3.5 (:issue:`22486`): use :func:`math.gcd` instead.
  13814. - bpo-39329: :class:`~smtplib.LMTP` constructor now has an optional
  13815. *timeout* parameter. Patch by Donghee Na.
  13816. - bpo-39313: Add a new ``exec_function`` option (*--exec-function* in the
  13817. CLI) to ``RefactoringTool`` for making ``exec`` a function. Patch by
  13818. Batuhan Taskaya.
  13819. - bpo-39259: :class:`~ftplib.FTP_TLS` and :class:`~ftplib.FTP_TLS` now raise
  13820. a :class:`ValueError` if the given timeout for their constructor is zero
  13821. to prevent the creation of a non-blocking socket. Patch by Donghee Na.
  13822. - bpo-39259: :class:`~smtplib.SMTP` and :class:`~smtplib.SMTP_SSL` now raise
  13823. a :class:`ValueError` if the given timeout for their constructor is zero
  13824. to prevent the creation of a non-blocking socket. Patch by Donghee Na.
  13825. - bpo-39310: Add :func:`math.ulp`: return the value of the least significant
  13826. bit of a float.
  13827. - bpo-39297: Improved performance of importlib.metadata distribution
  13828. discovery and resilients to inaccessible sys.path entries
  13829. (importlib_metadata v1.4.0).
  13830. - bpo-39259: :class:`~nntplib.NNTP` and :class:`~nntplib.NNTP_SSL` now raise
  13831. a :class:`ValueError` if the given timeout for their constructor is zero
  13832. to prevent the creation of a non-blocking socket. Patch by Donghee Na.
  13833. - bpo-38901: When you specify prompt='.' or equivalently python -m venv
  13834. --prompt . ... the basename of the current directory is used to set the
  13835. created venv's prompt when it's activated.
  13836. - bpo-39288: Add :func:`math.nextafter`: return the next floating-point
  13837. value after *x* towards *y*.
  13838. - bpo-39259: :class:`~poplib.POP3` and :class:`~poplib.POP3_SSL` now raise a
  13839. :class:`ValueError` if the given timeout for their constructor is zero to
  13840. prevent the creation of a non-blocking socket. Patch by Donghee Na.
  13841. - bpo-39242: Updated the Gmane domain from news.gmane.org to news.gmane.io
  13842. which is used for examples of :class:`~nntplib.NNTP` news reader server
  13843. and nntplib tests.
  13844. - bpo-35292: Proxy the ``SimpleHTTPRequestHandler.guess_type`` to
  13845. ``mimetypes.guess_type`` so the ``mimetypes.init`` is called lazily to
  13846. avoid unnecessary costs when :mod:`http.server` module is imported.
  13847. - bpo-39239: The :meth:`select.epoll.unregister` method no longer ignores
  13848. the :data:`~errno.EBADF` error.
  13849. - bpo-38907: In http.server script, restore binding to IPv4 on Windows.
  13850. - bpo-39152: Fix ttk.Scale.configure([name]) to return configuration tuple
  13851. for name or all options. Giovanni Lombardo contributed part of the patch.
  13852. - bpo-39198: If an exception were to be thrown in ``Logger.isEnabledFor``
  13853. (say, by asyncio timeouts or stopit) , the ``logging`` global lock may not
  13854. be released appropriately, resulting in deadlock. This change wraps that
  13855. block of code with ``try...finally`` to ensure the lock is released.
  13856. - bpo-39191: Perform a check for running loop before starting a new task in
  13857. ``loop.run_until_complete()`` to fail fast; it prevents the side effect of
  13858. new task spawning before exception raising.
  13859. - bpo-38871: Correctly parenthesize filter-based statements that contain
  13860. lambda expressions in :mod:`lib2to3`. Patch by Donghee Na.
  13861. - bpo-39142: A change was made to logging.config.dictConfig to avoid
  13862. converting instances of named tuples to ConvertingTuple. It's assumed that
  13863. named tuples are too specialised to be treated like ordinary tuples; if a
  13864. user of named tuples requires ConvertingTuple functionality, they will
  13865. have to implement that themselves in their named tuple class.
  13866. - bpo-39158: ast.literal_eval() now supports empty sets.
  13867. - bpo-39129: Fix import path for ``asyncio.TimeoutError``
  13868. - bpo-39057: :func:`urllib.request.proxy_bypass_environment` now ignores
  13869. leading dots and no longer ignores a trailing newline.
  13870. - bpo-39056: Fixed handling invalid warning category in the -W option. No
  13871. longer import the re module if it is not needed.
  13872. - bpo-39055: :func:`base64.b64decode` with ``validate=True`` raises now a
  13873. binascii.Error if the input ends with a single ``\n``.
  13874. - bpo-21600: Fix :func:`mock.patch.stopall` to stop active patches that were
  13875. created with :func:`mock.patch.dict`.
  13876. - bpo-39019: Implement dummy ``__class_getitem__`` for
  13877. :class:`tempfile.SpooledTemporaryFile`.
  13878. - bpo-39019: Implement dummy ``__class_getitem__`` for ``subprocess.Popen``,
  13879. ``subprocess.CompletedProcess``
  13880. - bpo-38914: Adjusted the wording of the warning issued by distutils'
  13881. ``check`` command when the ``author`` and ``maintainer`` fields are
  13882. supplied but no corresponding e-mail field (``author_email`` or
  13883. ``maintainer_email``) is found. The wording now reflects the fact that
  13884. these fields are suggested, but not required. Patch by Juergen Gmach.
  13885. - bpo-38878: Fixed __subclasshook__ of :class:`os.PathLike` to return a
  13886. correct result upon inheritance. Patch by Bar Harel.
  13887. - bpo-38615: :class:`~imaplib.IMAP4` and :class:`~imaplib.IMAP4_SSL` now
  13888. have an optional *timeout* parameter for their constructors. Also, the
  13889. :meth:`~imaplib.IMAP4.open` method now has an optional *timeout* parameter
  13890. with this change. The overridden methods of :class:`~imaplib.IMAP4_SSL`
  13891. and :class:`~imaplib.IMAP4_stream` were applied to this change. Patch by
  13892. Donghee Na.
  13893. - bpo-35182: Fixed :func:`Popen.communicate` subsequent call crash when the
  13894. child process has already closed any piped standard stream, but still
  13895. continues to be running. Patch by Andriy Maletsky.
  13896. - bpo-38630: On Unix, :meth:`subprocess.Popen.send_signal` now polls the
  13897. process status. Polling reduces the risk of sending a signal to the wrong
  13898. process if the process completed, the :attr:`subprocess.Popen.returncode`
  13899. attribute is still ``None``, and the pid has been reassigned (recycled) to
  13900. a new different process.
  13901. - bpo-38536: Removes trailing space in formatted currency with
  13902. ``international=True`` and a locale with symbol following value. E.g.
  13903. ``locale.currency(12.34, international=True)`` returned ``'12,34 EUR '``
  13904. instead of ``'12,34 EUR'``.
  13905. - bpo-38473: Use signature from inner mock for autospecced methods attached
  13906. with :func:`unittest.mock.attach_mock`. Patch by Karthikeyan Singaravelan.
  13907. - bpo-38361: Fixed an issue where ``ident`` could include a leading path
  13908. separator when :func:`syslog.openlog` was called without arguments.
  13909. - bpo-38293: Add :func:`copy.copy` and :func:`copy.deepcopy` support to
  13910. :func:`property` objects.
  13911. - bpo-37958: Added the pstats.Stats.get_profile_dict() method to return the
  13912. profile data as a StatsProfile instance.
  13913. - bpo-28367: Termios magic constants for the following baud rates: -
  13914. B500000 - B576000 - B921600 - B1000000 - B1152000 - B1500000 -
  13915. B2000000 - B2500000 - B3000000 - B3500000 - B4000000 Patch by
  13916. Andrey Smirnov
  13917. Documentation
  13918. -------------
  13919. - bpo-39381: Mention in docs that :func:`asyncio.get_event_loop` implicitly
  13920. creates new event loop only if called from the main thread.
  13921. - bpo-38918: Add an entry for ``__module__`` in the "function" & "method"
  13922. sections of the :mod:`inspect` docs' :ref:`inspect-types` table.
  13923. - bpo-3530: In the :mod:`ast` module documentation, fix a misleading
  13924. ``NodeTransformer`` example and add advice on when to use the
  13925. ``fix_missing_locations`` function.
  13926. Build
  13927. -----
  13928. - bpo-39395: On non-Windows platforms, the :c:func:`setenv` and
  13929. :c:func:`unsetenv` functions are now required to build Python.
  13930. - bpo-39160: Updated the documentation in ``./configure --help`` to show
  13931. default values, reference documentation where required and add additional
  13932. explanation where needed.
  13933. - bpo-39144: The ctags and etags build targets both include Modules/_ctypes
  13934. and Python standard library source files.
  13935. IDLE
  13936. ----
  13937. - bpo-39050: Make IDLE Settings dialog Help button work again.
  13938. - bpo-34118: Tag memoryview, range, and tuple as classes, the same as list,
  13939. etcetera, in the library manual built-in functions list.
  13940. - bpo-32989: Add tests for editor newline_and_indent_event method. Remove
  13941. dead code from pyparse find_good_parse_start method.
  13942. C API
  13943. -----
  13944. - bpo-39372: Clean header files of interfaces defined but with no
  13945. implementation. The public API symbols being removed are:
  13946. ``_PyBytes_InsertThousandsGroupingLocale``,
  13947. ``_PyBytes_InsertThousandsGrouping``, ``_Py_InitializeFromArgs``,
  13948. ``_Py_InitializeFromWideArgs``, ``_PyFloat_Repr``, ``_PyFloat_Digits``,
  13949. ``_PyFloat_DigitsInit``, ``PyFrame_ExtendStack``,
  13950. ``_PyAIterWrapper_Type``, ``PyNullImporter_Type``, ``PyCmpWrapper_Type``,
  13951. ``PySortWrapper_Type``, ``PyNoArgsFunction``.
  13952. - bpo-39164: Add a private ``_PyErr_GetExcInfo()`` function to retrieve
  13953. exception information of the specified Python thread state.
  13954. What's New in Python 3.9.0 alpha 2?
  13955. ===================================
  13956. *Release date: 2019-12-18*
  13957. Security
  13958. --------
  13959. - bpo-38945: Newline characters have been escaped when performing uu
  13960. encoding to prevent them from overflowing into to content section of the
  13961. encoded file. This prevents malicious or accidental modification of data
  13962. during the decoding process.
  13963. - bpo-37228: Due to significant security concerns, the *reuse_address*
  13964. parameter of :meth:`asyncio.loop.create_datagram_endpoint` is no longer
  13965. supported. This is because of the behavior of ``SO_REUSEADDR`` in UDP. For
  13966. more details, see the documentation for
  13967. ``loop.create_datagram_endpoint()``. (Contributed by Kyle Stanley, Antoine
  13968. Pitrou, and Yury Selivanov in :issue:`37228`.)
  13969. - bpo-38804: Fixes a ReDoS vulnerability in :mod:`http.cookiejar`. Patch by
  13970. Ben Caller.
  13971. Core and Builtins
  13972. -----------------
  13973. - bpo-39028: Slightly improve the speed of keyword argument parsing with
  13974. many kwargs by strengthening the assumption that kwargs are interned
  13975. strings.
  13976. - bpo-39080: Fix the value of *end_col_offset* for Starred Expression AST
  13977. nodes when they are among the elements in the *args* attribute of Call AST
  13978. nodes.
  13979. - bpo-39031: When parsing an "elif" node, lineno and col_offset of the node
  13980. now point to the "elif" keyword and not to its condition, making it
  13981. consistent with the "if" node. Patch by Lysandros Nikolaou.
  13982. - bpo-20443: In Python 3.9.0a1, sys.argv[0] was made an absolute path if a
  13983. filename was specified on the command line. Revert this change, since most
  13984. users expect sys.argv to be unmodified.
  13985. - bpo-39008: :c:func:`PySys_Audit` now requires ``Py_ssize_t`` to be used
  13986. for size arguments in the format string, regardless of whether
  13987. ``PY_SSIZE_T_CLEAN`` was defined at include time.
  13988. - bpo-38673: In REPL mode, don't switch to PS2 if the line starts with
  13989. comment or whitespace. Based on work by Batuhan Taşkaya.
  13990. - bpo-38922: Calling ``replace`` on a code object now raises the
  13991. ``code.__new__`` audit event.
  13992. - bpo-38920: Add audit hooks for when :func:`sys.excepthook` and
  13993. :func:`sys.unraisablehook` are invoked.
  13994. - bpo-38892: Improve documentation for audit events table and functions.
  13995. - bpo-38852: Set the thread stack size to 8 Mb for debug builds on android
  13996. platforms.
  13997. - bpo-38858: Each Python subinterpreter now has its own "small integer
  13998. singletons": numbers in [-5; 257] range. It is no longer possible to
  13999. change the number of small integers at build time by overriding
  14000. ``NSMALLNEGINTS`` and ``NSMALLPOSINTS`` macros: macros should now be
  14001. modified manually in ``pycore_pystate.h`` header file.
  14002. - bpo-36854: The garbage collector state becomes per interpreter
  14003. (``PyInterpreterState.gc``), rather than being global
  14004. (``_PyRuntimeState.gc``).
  14005. - bpo-38835: The ``PyFPE_START_PROTECT()`` and ``PyFPE_END_PROTECT()``
  14006. macros are empty: they have been doing nothing for the last year, so stop
  14007. using them.
  14008. - bpo-38328: Sped up the creation time of constant :class:`list` and
  14009. :class:`set` displays. Patch by Brandt Bucher.
  14010. - bpo-38707: ``MainThread.native_id`` is now correctly reset in child
  14011. processes spawned using :class:`multiprocessing.Process`, instead of
  14012. retaining the parent's value.
  14013. - bpo-38629: Added ``__floor__`` and ``__ceil__`` methods to float object.
  14014. Patch by Batuhan Taşkaya.
  14015. - bpo-27145: int + int and int - int operators can now return small integer
  14016. singletons. Patch by hongweipeng.
  14017. - bpo-38021: Provide a platform tag for AIX that is sufficient for PEP425
  14018. binary distribution identification. Patch by Michael Felt.
  14019. - bpo-35409: Ignore GeneratorExit exceptions when throwing an exception into
  14020. the aclose coroutine of an asynchronous generator.
  14021. - bpo-33387: Removed WITH_CLEANUP_START, WITH_CLEANUP_FINISH, BEGIN_FINALLY,
  14022. END_FINALLY, CALL_FINALLY and POP_FINALLY bytecodes. Replaced with RERAISE
  14023. and WITH_EXCEPT_START bytecodes. The compiler now generates different code
  14024. for exceptional and non-exceptional branches for 'with' and 'try-except'
  14025. statements. For 'try-finally' statements the 'finally' block is replicated
  14026. for each exit from the 'try' body.
  14027. Library
  14028. -------
  14029. - bpo-39033: Fix :exc:`NameError` in :mod:`zipimport`. Patch by Karthikeyan
  14030. Singaravelan.
  14031. - bpo-39022: Update importlib.metadata to include improvements from
  14032. importlib_metadata 1.3 including better serialization of EntryPoints and
  14033. improved documentation for custom finders.
  14034. - bpo-39006: Fix asyncio when the ssl module is missing: only check for
  14035. ssl.SSLSocket instance if the ssl module is available.
  14036. - bpo-38708: Fix a potential IndexError in email parser when parsing an
  14037. empty msg-id.
  14038. - bpo-38698: Add a new ``InvalidMessageID`` token to email parser to
  14039. represent invalid Message-ID headers. Also, add defects when there is
  14040. remaining value after parsing the header.
  14041. - bpo-38994: Implement ``__class_getitem__`` for ``os.PathLike``,
  14042. ``pathlib.Path``.
  14043. - bpo-38979: Return class from ``ContextVar.__class_getitem__`` to simplify
  14044. subclassing.
  14045. - bpo-38978: Implement ``__class_getitem__`` on asyncio objects (Future,
  14046. Task, Queue). Patch by Batuhan Taskaya.
  14047. - bpo-38916: :class:`array.array`: Remove ``tostring()`` and
  14048. ``fromstring()`` methods. They were aliases to ``tobytes()`` and
  14049. ``frombytes()``, deprecated since Python 3.2.
  14050. - bpo-38986: Make repr of C accelerated TaskWakeupMethWrapper the same as of
  14051. pure Python version.
  14052. - bpo-38982: Fix asyncio ``PidfdChildWatcher``: handle ``waitpid()`` error.
  14053. If ``waitpid()`` is called elsewhere, ``waitpid()`` call fails with
  14054. :exc:`ChildProcessError`: use return code 255 in this case, and log a
  14055. warning. It ensures that the pidfd file descriptor is closed if this error
  14056. occurs.
  14057. - bpo-38529: Drop too noisy asyncio warning about deletion of a stream
  14058. without explicit ``.close()`` call.
  14059. - bpo-27413: Added ability to pass through ``ensure_ascii`` options to
  14060. json.dumps in the ``json.tool`` command-line interface.
  14061. - bpo-38634: The :mod:`readline` module now detects if Python is linked to
  14062. libedit at runtime on all platforms. Previously, the check was only done
  14063. on macOS.
  14064. - bpo-33684: Fix ``json.tool`` failed to read a JSON file with non-ASCII
  14065. characters when locale encoding is not UTF-8.
  14066. - bpo-38698: Prevent UnboundLocalError to pop up in parse_message_id.
  14067. parse_message_id() was improperly using a token defined inside an
  14068. exception handler, which was raising ``UnboundLocalError`` on parsing an
  14069. invalid value. Patch by Claudiu Popa.
  14070. - bpo-38927: Use ``python -m pip`` instead of ``pip`` to upgrade
  14071. dependencies in venv.
  14072. - bpo-26730: Fix ``SpooledTemporaryFile.rollover()`` might corrupt the file
  14073. when it is in text mode. Patch by Serhiy Storchaka.
  14074. - bpo-38881: random.choices() now raises a ValueError when all the weights
  14075. are zero.
  14076. - bpo-38876: Raise pickle.UnpicklingError when loading an item from memo for
  14077. invalid input.
  14078. The previous code was raising a ``KeyError`` for both the Python and C
  14079. implementation. This was caused by the specified index of an invalid input
  14080. which did not exist in the memo structure, where the pickle stores what
  14081. objects it has seen. The malformed input would have caused either a
  14082. ``BINGET`` or ``LONG_BINGET`` load from the memo, leading to a
  14083. ``KeyError`` as the determined index was bogus. Patch by Claudiu Popa.
  14084. - bpo-38688: Calling func:``shutil.copytree`` to copy a directory tree from
  14085. one directory to another subdirectory resulted in an endless loop and a
  14086. RecursionError. A fix was added to consume an iterator and create the list
  14087. of the entries to be copied, avoiding the recursion for newly created
  14088. directories. Patch by Bruno P. Kinoshita.
  14089. - bpo-38863: Improve :func:`is_cgi` function in :mod:`http.server`, which
  14090. enables processing the case that cgi directory is a child of another
  14091. directory other than root.
  14092. - bpo-37838: :meth:`typing.get_type_hints` properly handles functions
  14093. decorated with :meth:`functools.wraps`.
  14094. - bpo-38870: Expose :func:`ast.unparse` as a function of the :mod:`ast`
  14095. module that can be used to unparse an :class:`ast.AST` object and produce
  14096. a string with code that would produce an equivalent :class:`ast.AST`
  14097. object when parsed. Patch by Pablo Galindo and Batuhan Taskaya.
  14098. - bpo-38859: AsyncMock now returns StopAsyncIteration on the exhaustion of a
  14099. side_effects iterable. Since PEP-479 its Impossible to raise a
  14100. StopIteration exception from a coroutine.
  14101. - bpo-38857: AsyncMock fix for return values that are awaitable types. This
  14102. also covers side_effect iterable values that happened to be awaitable, and
  14103. wraps callables that return an awaitable type. Before these awaitables
  14104. were being awaited instead of being returned as is.
  14105. - bpo-38834: :class:`typing.TypedDict` subclasses now track which keys are
  14106. optional using the ``__required_keys__`` and ``__optional_keys__``
  14107. attributes, to enable runtime validation by downstream projects. Patch by
  14108. Zac Hatfield-Dodds.
  14109. - bpo-38821: Fix unhandled exceptions in :mod:`argparse` when
  14110. internationalizing error messages for arguments with ``nargs`` set to
  14111. special (non-integer) values. Patch by Federico Bond.
  14112. - bpo-38820: Make Python compatible with OpenSSL 3.0.0.
  14113. :func:`ssl.SSLSocket.getpeercert` no longer returns IPv6 addresses with a
  14114. trailing new line.
  14115. - bpo-38811: Fix an unhandled exception in :mod:`pathlib` when
  14116. :meth:`os.link` is missing. Patch by Toke Høiland-Jørgensen.
  14117. - bpo-38686: Added support for multiple ``qop`` values in
  14118. :class:`urllib.request.AbstractDigestAuthHandler`.
  14119. - bpo-38712: Add the Linux-specific :func:`signal.pidfd_send_signal`
  14120. function, which allows sending a signal to a process identified by a file
  14121. descriptor rather than a pid.
  14122. - bpo-38348: Add ``-i`` and ``--indent`` (indentation level), and
  14123. ``--no-type-comments`` (type comments) command line options to ast parsing
  14124. tool.
  14125. - bpo-37523: Change :class:`zipfile.ZipExtFile` to raise ``ValueError`` when
  14126. trying to access the underlying file object after it has been closed. This
  14127. new behavior is consistent with how accessing closed files is handled in
  14128. other parts of Python.
  14129. - bpo-38045: Improve the performance of :func:`enum._decompose` in
  14130. :mod:`enum`. Patch by hongweipeng.
  14131. - bpo-36820: Break cycle generated when saving an exception in socket.py,
  14132. codeop.py and dyld.py as they keep alive not only the exception but user
  14133. objects through the ``__traceback__`` attribute. Patch by Mario Corchero.
  14134. - bpo-36406: Handle namespace packages in :mod:`doctest`. Patch by
  14135. Karthikeyan Singaravelan.
  14136. - bpo-34776: Fix dataclasses to support forward references in type
  14137. annotations
  14138. - bpo-20928: ElementTree supports recursive XInclude processing. Patch by
  14139. Stefan Behnel.
  14140. - bpo-29636: Add whitespace options for formatting JSON with the
  14141. ``json.tool`` CLI. The following mutually exclusive options are now
  14142. supported: ``--indent`` for setting the indent level in spaces; ``--tab``
  14143. for indenting with tabs; ``--no-indent`` for suppressing newlines; and
  14144. ``--compact`` for suppressing all whitespace. The default behavior remains
  14145. the same as ``--indent=4``.
  14146. Documentation
  14147. -------------
  14148. - bpo-38928: Correct when venv's ``upgrade_dependencies()`` and
  14149. ``--upgrade-deps`` are added.
  14150. - bpo-38899: Update documentation to state that to activate virtual
  14151. environments under fish one should use ``source``, not ``.`` as documented
  14152. at https://fishshell.com/docs/current/cmds/source.html.
  14153. - bpo-22377: Improves documentation of the values that
  14154. :meth:`datetime.datetime.strptime` accepts for ``%Z``. Patch by Karl
  14155. Dubost.
  14156. Tests
  14157. -----
  14158. - bpo-38546: Fix test_ressources_gced_in_workers() of
  14159. test_concurrent_futures: explicitly stop the manager to prevent leaking a
  14160. child process running in the background after the test completes.
  14161. - bpo-38546: Multiprocessing and concurrent.futures tests now stop the
  14162. resource tracker process when tests complete.
  14163. - bpo-38614: Replace hardcoded timeout constants in tests with new
  14164. :mod:`test.support` constants: :data:`~test.support.LOOPBACK_TIMEOUT`,
  14165. :data:`~test.support.INTERNET_TIMEOUT`,
  14166. :data:`~test.support.SHORT_TIMEOUT` and
  14167. :data:`~test.support.LONG_TIMEOUT`. It becomes easier to adjust these four
  14168. timeout constants for all tests at once, rather than having to adjust
  14169. every single test file.
  14170. - bpo-38547: Fix test_pty: if the process is the session leader, closing the
  14171. master file descriptor raises a SIGHUP signal: simply ignore SIGHUP when
  14172. running the tests.
  14173. - bpo-38992: Fix a test for :func:`math.fsum` that was failing due to
  14174. constant folding.
  14175. - bpo-38991: :mod:`test.support`:
  14176. :func:`~test.support.run_python_until_end`,
  14177. :func:`~test.support.assert_python_ok` and
  14178. :func:`~test.support.assert_python_failure` functions no longer strip
  14179. whitespaces from stderr. Remove ``test.support.strip_python_stderr()``
  14180. function.
  14181. - bpo-38965: Fix test_faulthandler on GCC 10. Use the "volatile" keyword in
  14182. ``faulthandler._stack_overflow()`` to prevent tail call optimization on
  14183. any compiler, rather than relying on compiler specific pragma.
  14184. - bpo-38875: test_capi: trashcan tests now require the test "cpu" resource.
  14185. - bpo-38841: Skip asyncio test_create_datagram_endpoint_existing_sock_unix
  14186. on platforms lacking a functional bind() for named unix domain sockets.
  14187. - bpo-38692: Skip the test_posix.test_pidfd_open() test if
  14188. ``os.pidfd_open()`` fails with a :exc:`PermissionError`. This situation
  14189. can happen in a Linux sandbox using a syscall whitelist which doesn't
  14190. allow the ``pidfd_open()`` syscall yet.
  14191. - bpo-38839: Fix some unused functions in tests. Patch by Adam Johnson.
  14192. - bpo-38669: Raise :exc:`TypeError` when passing target as a string with
  14193. :meth:`unittest.mock.patch.object`.
  14194. - bpo-37957: test.regrtest now can receive a list of test patterns to ignore
  14195. (using the -i/--ignore argument) or a file with a list of patterns to
  14196. ignore (using the --ignore-file argument). Patch by Pablo Galindo.
  14197. Build
  14198. -----
  14199. - bpo-37404: :mod:`asyncio` now raises :exc:`TyperError` when calling
  14200. incompatible methods with an :class:`ssl.SSLSocket` socket. Patch by Ido
  14201. Michael.
  14202. - bpo-36500: Added an optional "regen" project to the Visual Studio solution
  14203. that will regenerate all grammar, tokens, and opcodes.
  14204. Windows
  14205. -------
  14206. - bpo-39007: Add auditing events to functions in :mod:`winreg`.
  14207. - bpo-33125: Add support for building and releasing Windows ARM64 packages.
  14208. macOS
  14209. -----
  14210. - bpo-37931: Fixed a crash on OSX dynamic builds that occurred when
  14211. re-initializing the posix module after a Py_Finalize if the environment
  14212. had changed since the previous ``import posix``. Patch by Benoît Hudson.
  14213. IDLE
  14214. ----
  14215. - bpo-38944: Escape key now closes IDLE completion windows. Patch by Johnny
  14216. Najera.
  14217. - bpo-38943: Fix IDLE autocomplete windows not always appearing on some
  14218. systems. Patch by Johnny Najera.
  14219. - bpo-38862: 'Strip Trailing Whitespace' on the Format menu removes extra
  14220. newlines at the end of non-shell files.
  14221. - bpo-38636: Fix IDLE Format menu tab toggle and file indent width. These
  14222. functions (default shortcuts Alt-T and Alt-U) were mistakenly disabled in
  14223. 3.7.5 and 3.8.0.
  14224. C API
  14225. -----
  14226. - bpo-38896: Remove ``PyUnicode_ClearFreeList()`` function: the Unicode free
  14227. list has been removed in Python 3.3.
  14228. - bpo-37340: Remove ``PyMethod_ClearFreeList()`` and
  14229. ``PyCFunction_ClearFreeList()`` functions: the free lists of bound method
  14230. objects have been removed.
  14231. - bpo-38835: Exclude ``PyFPE_START_PROTECT()`` and ``PyFPE_END_PROTECT()``
  14232. macros of ``pyfpe.h`` from ``Py_LIMITED_API`` (stable API).
  14233. What's New in Python 3.9.0 alpha 1?
  14234. ===================================
  14235. *Release date: 2019-11-19*
  14236. Security
  14237. --------
  14238. - bpo-38722: :mod:`runpy` now uses :meth:`io.open_code` to open code files.
  14239. Patch by Jason Killen.
  14240. - bpo-38622: Add additional audit events for the :mod:`ctypes` module.
  14241. - bpo-38418: Fixes audit event for :func:`os.system` to be named
  14242. ``os.system``.
  14243. - bpo-38243: Escape the server title of
  14244. :class:`xmlrpc.server.DocXMLRPCServer` when rendering the document page as
  14245. HTML. (Contributed by Donghee Na in :issue:`38243`.)
  14246. - bpo-38174: Update vendorized expat library version to 2.2.8, which
  14247. resolves CVE-2019-15903.
  14248. - bpo-37764: Fixes email._header_value_parser.get_unstructured going into an
  14249. infinite loop for a specific case in which the email header does not have
  14250. trailing whitespace, and the case in which it contains an invalid encoded
  14251. word. Patch by Ashwin Ramaswami.
  14252. - bpo-37461: Fix an infinite loop when parsing specially crafted email
  14253. headers. Patch by Abhilash Raj.
  14254. - bpo-37363: Adds audit events for the range of supported run commands (see
  14255. :ref:`using-on-general`).
  14256. - bpo-37463: ssl.match_hostname() no longer accepts IPv4 addresses with
  14257. additional text after the address and only quad-dotted notation without
  14258. trailing whitespaces. Some inet_aton() implementations ignore whitespace
  14259. and all data after whitespace, e.g. '127.0.0.1 whatever'.
  14260. - bpo-37363: Adds audit events for :mod:`ensurepip`, :mod:`ftplib`,
  14261. :mod:`glob`, :mod:`imaplib`, :mod:`nntplib`, :mod:`pdb`, :mod:`poplib`,
  14262. :mod:`shutil`, :mod:`smtplib`, :mod:`sqlite3`, :mod:`subprocess`,
  14263. :mod:`telnetlib`, :mod:`tempfile` and :mod:`webbrowser`, as well as
  14264. :func:`os.listdir`, :func:`os.scandir` and :func:`breakpoint`.
  14265. - bpo-37364: :func:`io.open_code` is now used when reading :file:`.pth`
  14266. files.
  14267. - bpo-34631: Updated OpenSSL to 1.1.1c in Windows installer
  14268. - bpo-34155: Fix parsing of invalid email addresses with more than one ``@``
  14269. (e.g. a@b@c.com.) to not return the part before 2nd ``@`` as valid email
  14270. address. Patch by maxking & jpic.
  14271. Core and Builtins
  14272. -----------------
  14273. - bpo-38631: Replace ``Py_FatalError()`` call with a regular
  14274. :exc:`RuntimeError` exception in :meth:`float.__getformat__`.
  14275. - bpo-38639: Optimized :func:`math.floor()`, :func:`math.ceil()` and
  14276. :func:`math.trunc()` for floats.
  14277. - bpo-38640: Fixed a bug in the compiler that was causing to raise in the
  14278. presence of break statements and continue statements inside always false
  14279. while loops. Patch by Pablo Galindo.
  14280. - bpo-38613: Optimized some set operations (e.g. ``|``, ``^``, and ``-``) of
  14281. ``dict_keys``. ``d.keys() | other`` was slower than ``set(d) | other`` but
  14282. they are almost same performance for now.
  14283. - bpo-28029: ``"".replace("", s, n)`` now returns ``s`` instead of an empty
  14284. string for all non-zero ``n``. There are similar changes for
  14285. :class:`bytes` and :class:`bytearray` objects.
  14286. - bpo-38535: Fixed line numbers and column offsets for AST nodes for calls
  14287. without arguments in decorators.
  14288. - bpo-38525: Fix a segmentation fault when using reverse iterators of empty
  14289. ``dict`` objects. Patch by Donghee Na and Inada Naoki.
  14290. - bpo-38465: :class:`bytearray`, :class:`~array.array` and
  14291. :class:`~mmap.mmap` objects allow now to export more than ``2**31``
  14292. buffers at a time.
  14293. - bpo-38469: Fixed a bug where the scope of named expressions was not being
  14294. resolved correctly in the presence of the *global* keyword. Patch by Pablo
  14295. Galindo.
  14296. - bpo-38437: Activate the ``GC_DEBUG`` macro for debug builds of the
  14297. interpreter (when ``Py_DEBUG`` is set). Patch by Pablo Galindo.
  14298. - bpo-38379: When the garbage collector makes a collection in which some
  14299. objects resurrect (they are reachable from outside the isolated cycles
  14300. after the finalizers have been executed), do not block the collection of
  14301. all objects that are still unreachable. Patch by Pablo Galindo and Tim
  14302. Peters.
  14303. - bpo-38379: When cyclic garbage collection (gc) runs finalizers that
  14304. resurrect unreachable objects, the current gc run ends, without collecting
  14305. any cyclic trash. However, the statistics reported by ``collect()`` and
  14306. ``get_stats()`` claimed that all cyclic trash found was collected, and
  14307. that the resurrected objects were collected. Changed the stats to report
  14308. that none were collected.
  14309. - bpo-38392: In debug mode, :c:func:`PyObject_GC_Track` now calls
  14310. ``tp_traverse()`` of the object type to ensure that the object is valid:
  14311. test that objects visited by ``tp_traverse()`` are valid.
  14312. - bpo-38210: Remove unnecessary intersection and update set operation in
  14313. dictview with empty set. (Contributed by Donghee Na in :issue:`38210`.)
  14314. - bpo-38402: Check the error from the system's underlying ``crypt`` or
  14315. ``crypt_r``.
  14316. - bpo-37474: On FreeBSD, Python no longer calls ``fedisableexcept()`` at
  14317. startup to control the floating point control mode. The call became
  14318. useless since FreeBSD 6: it became the default mode.
  14319. - bpo-38006: Fix a bug due to the interaction of weakrefs and the cyclic
  14320. garbage collector. We must clear any weakrefs in garbage in order to
  14321. prevent their callbacks from executing and causing a crash.
  14322. - bpo-38317: Fix warnings options priority: ``PyConfig.warnoptions`` has the
  14323. highest priority, as stated in the :pep:`587`.
  14324. - bpo-38310: Predict ``BUILD_MAP_UNPACK_WITH_CALL`` -> ``CALL_FUNCTION_EX``
  14325. opcode pairs in the main interpreter loop. Patch by Brandt Bucher.
  14326. - bpo-36871: Improve error handling for the assert_has_calls and
  14327. assert_has_awaits methods of mocks. Fixed a bug where any errors
  14328. encountered while binding the expected calls to the mock's spec were
  14329. silently swallowed, leading to misleading error output.
  14330. - bpo-11410: Better control over symbol visibility is provided through use
  14331. of the visibility attributes available in gcc >= 4.0, provided in a
  14332. uniform way across POSIX and Windows. The POSIX build files have been
  14333. updated to compile with -fvisibility=hidden, minimising exported symbols.
  14334. - bpo-38219: Optimized the :class:`dict` constructor and the
  14335. :meth:`~dict.update` method for the case when the argument is a dict.
  14336. - bpo-38236: Python now dumps path configuration if it fails to import the
  14337. Python codecs of the filesystem and stdio encodings.
  14338. - bpo-38013: Allow to call ``async_generator_athrow().throw(...)`` even for
  14339. non-started async generator helper. It fixes annoying warning at the end
  14340. of :func:`asyncio.run` call.
  14341. - bpo-38124: Fix an off-by-one error in PyState_AddModule that could cause
  14342. out-of-bounds memory access.
  14343. - bpo-38116: The select module is now PEP-384 compliant and no longer has
  14344. static state
  14345. - bpo-38113: ast module updated to PEP-384 and all statics removed
  14346. - bpo-38076: The struct module is now PEP-384 compatible
  14347. - bpo-38075: The random module is now PEP-384 compatible
  14348. - bpo-38074: zlib module made PEP-384 compatible
  14349. - bpo-38073: Make pwd extension module PEP-384 compatible
  14350. - bpo-38072: grp module made PEP-384 compatible
  14351. - bpo-38069: Make _posixsubprocess PEP-384 compatible
  14352. - bpo-38071: Make termios extension module PEP-384 compatible
  14353. - bpo-38005: Fixed comparing and creating of InterpreterID and ChannelID.
  14354. - bpo-36946: Fix possible signed integer overflow when handling slices.
  14355. Patch by hongweipeng.
  14356. - bpo-37994: Fixed silencing arbitrary errors if an attribute lookup fails
  14357. in several sites. Only AttributeError should be silenced.
  14358. - bpo-8425: Optimize set difference_update for the case when the other set
  14359. is much larger than the base set. (Suggested by Evgeny Kapun with code
  14360. contributed by Michele Orrù).
  14361. - bpo-37966: The implementation of :func:`~unicodedata.is_normalized` has
  14362. been greatly sped up on strings that aren't normalized, by implementing
  14363. the full normalization-quick-check algorithm from the Unicode standard.
  14364. - bpo-37947: Adjust correctly the recursion level in the symtable generation
  14365. for named expressions. Patch by Pablo Galindo.
  14366. - bpo-37812: The ``CHECK_SMALL_INT`` macro used inside
  14367. :file:`Object/longobject.c` has been replaced with an explicit ``return``
  14368. at each call site.
  14369. - bpo-37751: Fix :func:`codecs.lookup` to normalize the encoding name the
  14370. same way than :func:`encodings.normalize_encoding`, except that
  14371. :func:`codecs.lookup` also converts the name to lower case.
  14372. - bpo-37830: Fixed compilation of :keyword:`break` and :keyword:`continue`
  14373. in the :keyword:`finally` block when the corresponding :keyword:`try`
  14374. block contains :keyword:`return` with a non-constant value.
  14375. - bpo-20490: Improve import error message for partially initialized module
  14376. on circular ``from`` imports - by Anthony Sottile.
  14377. - bpo-37840: Fix handling of negative indices in
  14378. :c:member:`~PySequenceMethods.sq_item` of :class:`bytearray`. Patch by
  14379. Sergey Fedoseev.
  14380. - bpo-37802: Slightly improve performance of
  14381. :c:func:`PyLong_FromUnsignedLong`, :c:func:`PyLong_FromUnsignedLongLong`
  14382. and :c:func:`PyLong_FromSize_t`. Patch by Sergey Fedoseev.
  14383. - bpo-37409: Ensure explicit relative imports from interactive sessions and
  14384. scripts (having no parent package) always raise ImportError, rather than
  14385. treating the current module as the package. Patch by Ben Lewis.
  14386. - bpo-32912: Reverted :issue:`32912`: emitting :exc:`SyntaxWarning` instead
  14387. of :exc:`DeprecationWarning` for invalid escape sequences in string and
  14388. bytes literals.
  14389. - bpo-37757: :pep:`572`: As described in the PEP, assignment expressions now
  14390. raise :exc:`SyntaxError` when their interaction with comprehension scoping
  14391. results in an ambiguous target scope.
  14392. The ``TargetScopeError`` subclass originally proposed by the PEP has been
  14393. removed in favour of just raising regular syntax errors for the disallowed
  14394. cases.
  14395. - bpo-36279: Fix potential use of uninitialized memory in :func:`os.wait3`.
  14396. - bpo-36311: Decoding bytes objects larger than 2GiB is faster and no longer
  14397. fails when a multibyte characters spans a chunk boundary.
  14398. - bpo-34880: The :keyword:`assert` statement now works properly if the
  14399. :exc:`AssertionError` exception is being shadowed. Patch by Zackery Spytz.
  14400. - bpo-37340: Removed object cache (``free_list``) for bound method objects.
  14401. Temporary bound method objects are less used than before thanks to the
  14402. ``LOAD_METHOD`` opcode and the ``_PyObject_VectorcallMethod`` C API.
  14403. - bpo-37648: Fixed minor inconsistency in :meth:`list.__contains__`,
  14404. :meth:`tuple.__contains__` and a few other places. The collection's item
  14405. is now always at the left and the needle is on the right of ``==``.
  14406. - bpo-37444: Update differing exception between :meth:`builtins.__import__`
  14407. and :meth:`importlib.__import__`.
  14408. - bpo-37619: When adding a wrapper descriptor from one class to a different
  14409. class (for example, setting ``__add__ = str.__add__`` on an ``int``
  14410. subclass), an exception is correctly raised when the operator is called.
  14411. - bpo-37593: Swap the positions of the *posonlyargs* and *args* parameters
  14412. in the constructor of :class:`ast.parameters` nodes.
  14413. - bpo-37543: Optimized pymalloc for non PGO build.
  14414. - bpo-37537: Compute allocated pymalloc blocks inside
  14415. _Py_GetAllocatedBlocks(). This slows down _Py_GetAllocatedBlocks() but
  14416. gives a small speedup to _PyObject_Malloc() and _PyObject_Free().
  14417. - bpo-37467: Fix :func:`sys.excepthook` and :c:func:`PyErr_Display` if a
  14418. filename is a bytes string. For example, for a SyntaxError exception where
  14419. the filename attribute is a bytes string.
  14420. - bpo-37433: Fix ``SyntaxError`` indicator printing too many spaces for
  14421. multi-line strings - by Anthony Sottile.
  14422. - bpo-37417: :meth:`bytearray.extend` now correctly handles errors that
  14423. arise during iteration. Patch by Brandt Bucher.
  14424. - bpo-37414: The undocumented ``sys.callstats()`` function has been removed.
  14425. Since Python 3.7, it was deprecated and always returned ``None``. It
  14426. required a special build option ``CALL_PROFILE`` which was already removed
  14427. in Python 3.7.
  14428. - bpo-37392: Remove ``sys.getcheckinterval()`` and
  14429. ``sys.setcheckinterval()`` functions. They were deprecated since Python
  14430. 3.2. Use :func:`sys.getswitchinterval` and :func:`sys.setswitchinterval`
  14431. instead. Remove also ``check_interval`` field of the
  14432. ``PyInterpreterState`` structure.
  14433. - bpo-37388: In development mode and in debug build, *encoding* and *errors*
  14434. arguments are now checked on string encoding and decoding operations.
  14435. Examples: :func:`open`, :meth:`str.encode` and :meth:`bytes.decode`.
  14436. By default, for best performances, the *errors* argument is only checked
  14437. at the first encoding/decoding error, and the *encoding* argument is
  14438. sometimes ignored for empty strings.
  14439. - bpo-37348: Optimized decoding short ASCII string with UTF-8 and ascii
  14440. codecs. ``b"foo".decode()`` is about 15% faster. Patch by Inada Naoki.
  14441. - bpo-24214: Improved support of the surrogatepass error handler in the
  14442. UTF-8 and UTF-16 incremental decoders.
  14443. - bpo-37330: :func:`open`, :func:`io.open`, :func:`codecs.open` and
  14444. :class:`fileinput.FileInput` no longer accept ``'U'`` ("universal
  14445. newline") in the file mode. This flag was deprecated since Python 3.3.
  14446. - bpo-35224: Reverse evaluation order of key: value in dict comprehensions
  14447. as proposed in PEP 572. I.e. in ``{k: v for ...}``, ``k`` will be
  14448. evaluated before ``v``.
  14449. - bpo-37316: Fix the :c:func:`PySys_Audit` call in :class:`mmap.mmap`.
  14450. - bpo-37300: Remove an unnecessary Py_XINCREF in classobject.c.
  14451. - bpo-37269: Fix a bug in the peephole optimizer that was not treating
  14452. correctly constant conditions with binary operators. Patch by Pablo
  14453. Galindo.
  14454. - bpo-20443: Python now gets the absolute path of the script filename
  14455. specified on the command line (ex: "python3 script.py"): the __file__
  14456. attribute of the __main__ module and sys.path[0] become an absolute path,
  14457. rather than a relative path.
  14458. - bpo-37257: Python's small object allocator (``obmalloc.c``) now allows (no
  14459. more than) one empty arena to remain available for immediate reuse,
  14460. without returning it to the OS. This prevents thrashing in simple loops
  14461. where an arena could be created and destroyed anew on each iteration.
  14462. - bpo-37231: The dispatching of type slots to special methods (for example
  14463. calling ``__mul__`` when doing ``x * y``) has been made faster.
  14464. - bpo-36974: Implemented separate vectorcall functions for every calling
  14465. convention of builtin functions and methods. This improves performance for
  14466. calls.
  14467. - bpo-37213: Handle correctly negative line offsets in the peephole
  14468. optimizer. Patch by Pablo Galindo.
  14469. - bpo-37219: Remove erroneous optimization for empty set differences.
  14470. - bpo-15913: Implement :c:func:`PyBuffer_SizeFromFormat()` function
  14471. (previously documented but not implemented): call :func:`struct.calcsize`.
  14472. Patch by Joannah Nanjekye.
  14473. - bpo-36922: Slot functions optimize any callable with
  14474. ``Py_TPFLAGS_METHOD_DESCRIPTOR`` instead of only instances of
  14475. ``function``.
  14476. - bpo-36974: The slot ``tp_vectorcall_offset`` is inherited unconditionally
  14477. to support ``super().__call__()`` when the base class uses vectorcall.
  14478. - bpo-37160: :func:`threading.get_native_id` now also supports NetBSD.
  14479. - bpo-37077: Add :func:`threading.get_native_id` support for AIX. Patch by
  14480. M. Felt
  14481. - bpo-36781: :func:`sum` has been optimized for boolean values.
  14482. - bpo-34556: Add ``--upgrade-deps`` to venv module. Patch by Cooper Ry Lees
  14483. - bpo-20523: ``pdb.Pdb`` supports ~/.pdbrc in Windows 7. Patch by Tim Hopper
  14484. and Dan Lidral-Porter.
  14485. - bpo-35551: Updated encodings: - Removed the "tis260" encoding, which was
  14486. an alias for the nonexistent "tactis" codec. - Added "mac_centeuro" as an
  14487. alias for the mac_latin2 encoding.
  14488. - bpo-19072: The :class:`classmethod` decorator can now wrap other
  14489. descriptors such as property objects. Adapted from a patch written by
  14490. Graham Dumpleton.
  14491. - bpo-27575: Improve speed of dictview intersection by directly using set
  14492. intersection logic. Patch by David Su.
  14493. - bpo-30773: Prohibit parallel running of aclose() / asend() / athrow(). Fix
  14494. ag_running to reflect the actual running status of the AG.
  14495. Library
  14496. -------
  14497. - bpo-36589: The :func:`curses.update_lines_cols` function now returns
  14498. ``None`` instead of ``1`` on success.
  14499. - bpo-38807: Update :exc:`TypeError` messages for :meth:`os.path.join` to
  14500. include :class:`os.PathLike` objects as acceptable input types.
  14501. - bpo-38724: Add a repr for ``subprocess.Popen`` objects. Patch by Andrey
  14502. Doroschenko.
  14503. - bpo-38786: pydoc now recognizes and parses HTTPS URLs. Patch by python273.
  14504. - bpo-38785: Prevent asyncio from crashing if parent ``__init__`` is not
  14505. called from a constructor of object derived from ``asyncio.Future``.
  14506. - bpo-38723: :mod:`pdb` now uses :meth:`io.open_code` to trigger auditing
  14507. events.
  14508. - bpo-27805: Allow opening pipes and other non-seekable files in append mode
  14509. with :func:`open`.
  14510. - bpo-38438: Simplify the :mod:`argparse` usage message for ``nargs="*"``.
  14511. - bpo-38761: WeakSet is now registered as a collections.abc.MutableSet.
  14512. - bpo-38716: logging: change RotatingHandler namer and rotator to
  14513. class-level attributes. This stops __init__ from setting them to None in
  14514. the case where a subclass defines them with eponymous methods.
  14515. - bpo-38713: Add :const:`os.P_PIDFD` constant, which may be passed to
  14516. :func:`os.waitid` to wait on a Linux process file descriptor.
  14517. - bpo-38692: Add :class:`asyncio.PidfdChildWatcher`, a Linux-specific child
  14518. watcher implementation that polls process file descriptors.
  14519. - bpo-38692: Expose the Linux ``pidfd_open`` syscall as
  14520. :func:`os.pidfd_open`.
  14521. - bpo-38602: Added constants :const:`~fcntl.F_OFD_GETLK`,
  14522. :const:`~fcntl.F_OFD_SETLK` and :const:`~fcntl.F_OFD_SETLKW` to the
  14523. :mod:`fcntl` module. Patch by Donghee Na.
  14524. - bpo-38334: Fixed seeking backward on an encrypted
  14525. :class:`zipfile.ZipExtFile`.
  14526. - bpo-38312: Add :func:`curses.get_escdelay`, :func:`curses.set_escdelay`,
  14527. :func:`curses.get_tabsize`, and :func:`curses.set_tabsize` functions - by
  14528. Anthony Sottile.
  14529. - bpo-38586: Now :func:`~logging.config.fileConfig` correctly sets the .name
  14530. of handlers loaded.
  14531. - bpo-38565: Add new cache_parameters() method for functools.lru_cache() to
  14532. better support pickling.
  14533. - bpo-34679: asynci.ProactorEventLoop.close() now only calls
  14534. signal.set_wakeup_fd() in the main thread.
  14535. - bpo-31202: The case the result of :func:`pathlib.WindowsPath.glob` matches
  14536. now the case of the pattern for literal parts.
  14537. - bpo-36321: Remove misspelled attribute. The 3.8 changelog noted that this
  14538. would be removed in 3.9.
  14539. - bpo-38521: Fixed erroneous equality comparison in statistics.NormalDist().
  14540. - bpo-38493: Added :const:`~os.CLD_KILLED` and :const:`~os.CLD_STOPPED` for
  14541. :attr:`si_code`. Patch by Donghee Na.
  14542. - bpo-38478: Fixed a bug in :meth:`inspect.signature.bind` that was causing
  14543. it to fail when handling a keyword argument with same name as
  14544. positional-only parameter. Patch by Pablo Galindo.
  14545. - bpo-33604: Fixed ``hmac.new`` and ``hmac.HMAC`` to raise TypeError instead
  14546. of ValueError when the digestmod parameter, now required in 3.8, is
  14547. omitted. Also clarified the hmac module documentation and docstrings.
  14548. - bpo-38378: Parameters *out* and *in* of :func:`os.sendfile` was renamed to
  14549. *out_fd* and *in_fd*.
  14550. - bpo-38417: Added support for setting the umask in the child process to the
  14551. subprocess module on POSIX systems.
  14552. - bpo-38449: Revert PR 15522, which introduces a regression in
  14553. :meth:`mimetypes.guess_type` due to improper handling of filenames as
  14554. urls.
  14555. - bpo-38431: Fix ``__repr__`` method for :class:`dataclasses.InitVar` to
  14556. support typing objects, patch by Samuel Colvin.
  14557. - bpo-38109: Add missing :const:`stat.S_IFDOOR`, :const:`stat.S_IFPORT`,
  14558. :const:`stat.S_IFWHT`, :func:`stat.S_ISDOOR`, :func:`stat.S_ISPORT`, and
  14559. :func:`stat.S_ISWHT` values to the Python implementation of :mod:`stat`.
  14560. - bpo-38422: Clarify docstrings of pathlib suffix(es)
  14561. - bpo-38405: Nested subclasses of :class:`typing.NamedTuple` are now
  14562. pickleable.
  14563. - bpo-38332: Prevent :exc:`KeyError` thrown by :func:`_encoded_words.decode`
  14564. when given an encoded-word with invalid content-type encoding from
  14565. propagating all the way to :func:`email.message.get`.
  14566. - bpo-38371: Deprecated the ``split()`` method in
  14567. :class:`_tkinter.TkappType` in favour of the ``splitlist()`` method which
  14568. has more consistent and predicable behavior.
  14569. - bpo-38341: Add :exc:`smtplib.SMTPNotSupportedError` to the :mod:`smtplib`
  14570. exported names.
  14571. - bpo-38319: sendfile() used in socket and shutil modules was raising
  14572. OverflowError for files >= 2GiB on 32-bit architectures. (patch by
  14573. Giampaolo Rodola)
  14574. - bpo-38242: Revert the new asyncio Streams API
  14575. - bpo-13153: OS native encoding is now used for converting between Python
  14576. strings and Tcl objects. This allows to display, copy and paste to
  14577. clipboard emoji and other non-BMP characters. Converting strings from Tcl
  14578. to Python and back now never fails (except MemoryError).
  14579. - bpo-38019: Correctly handle pause/resume reading of closed asyncio unix
  14580. pipe.
  14581. - bpo-38163: Child mocks will now detect their type as either synchronous or
  14582. asynchronous, asynchronous child mocks will be AsyncMocks and synchronous
  14583. child mocks will be either MagicMock or Mock (depending on their parent
  14584. type).
  14585. - bpo-38161: Removes _AwaitEvent from AsyncMock.
  14586. - bpo-38216: Allow the rare code that wants to send invalid http requests
  14587. from the ``http.client`` library a way to do so. The fixes for bpo-30458
  14588. led to breakage for some projects that were relying on this ability to
  14589. test their own behavior in the face of bad requests.
  14590. - bpo-28286: Deprecate opening :class:`~gzip.GzipFile` for writing
  14591. implicitly. Always specify the *mode* argument for writing.
  14592. - bpo-38108: Any synchronous magic methods on an AsyncMock now return a
  14593. MagicMock. Any asynchronous magic methods on a MagicMock now return an
  14594. AsyncMock.
  14595. - bpo-38265: Update the *length* parameter of :func:`os.pread` to accept
  14596. :c:type:`Py_ssize_t` instead of :c:expr:`int`.
  14597. - bpo-38112: :mod:`compileall` has a higher default recursion limit and new
  14598. command-line arguments for path manipulation, symlinks handling, and
  14599. multiple optimization levels.
  14600. - bpo-38248: asyncio: Fix inconsistent immediate Task cancellation
  14601. - bpo-38237: The arguments for the builtin pow function are more
  14602. descriptive. They can now also be passed in as keywords.
  14603. - bpo-34002: Improve efficiency in parts of email package by changing
  14604. while-pop to a for loop, using isdisjoint instead of set intersections.
  14605. - bpo-38191: Constructors of :class:`~typing.NamedTuple` and
  14606. :class:`~typing.TypedDict` types now accept arbitrary keyword argument
  14607. names, including "cls", "self", "typename", "_typename", "fields" and
  14608. "_fields".
  14609. - bpo-38155: Add ``__all__`` to :mod:`datetime`. Patch by Tahia Khan.
  14610. - bpo-38185: Fixed case-insensitive string comparison in
  14611. :class:`sqlite3.Row` indexing.
  14612. - bpo-38136: Changes AsyncMock call count and await count to be two
  14613. different counters. Now await count only counts when a coroutine has been
  14614. awaited, not when it has been called, and vice-versa. Update the
  14615. documentation around this.
  14616. - bpo-37828: Fix default mock name in
  14617. :meth:`unittest.mock.Mock.assert_called` exceptions. Patch by Abraham
  14618. Toriz Cruz.
  14619. - bpo-38175: Fix a memory leak in comparison of :class:`sqlite3.Row`
  14620. objects.
  14621. - bpo-33936: _hashlib no longer calls obsolete OpenSSL initialization
  14622. function with OpenSSL 1.1.0+.
  14623. - bpo-34706: Preserve subclassing in inspect.Signature.from_callable.
  14624. - bpo-38153: Names of hashing algorithms from OpenSSL are now normalized to
  14625. follow Python's naming conventions. For example OpenSSL uses sha3-512
  14626. instead of sha3_512 or blake2b512 instead of blake2b.
  14627. - bpo-38115: Fix a bug in dis.findlinestarts() where it would return invalid
  14628. bytecode offsets. Document that a code object's co_lnotab can contain
  14629. invalid bytecode offsets.
  14630. - bpo-38148: Add slots to :mod:`asyncio` transport classes, which can reduce
  14631. memory usage.
  14632. - bpo-38142: The _hashlib OpenSSL wrapper extension module is now PEP-384
  14633. compliant.
  14634. - bpo-9216: hashlib constructors now support usedforsecurity flag to signal
  14635. that a hashing algorithm is not used in a security context.
  14636. - bpo-36991: Fixes a potential incorrect AttributeError exception escaping
  14637. ZipFile.extract() in some unsupported input error situations.
  14638. - bpo-38134: Remove obsolete copy of PBKDF2_HMAC_fast. All supported OpenSSL
  14639. versions contain a fast implementation.
  14640. - bpo-38132: The OpenSSL hashlib wrapper uses a simpler implementation.
  14641. Several Macros and pointless caches are gone. The hash name now comes from
  14642. OpenSSL's EVP. The algorithm name stays the same, except it is now always
  14643. lower case.
  14644. - bpo-38008: Fix parent class check in protocols to correctly identify the
  14645. module that provides a builtin protocol, instead of assuming they all come
  14646. from the :mod:`collections.abc` module
  14647. - bpo-34037: For :mod:`asyncio`, add a new coroutine
  14648. :meth:`loop.shutdown_default_executor`. The new coroutine provides an API
  14649. to schedule an executor shutdown that waits on the threadpool to finish
  14650. closing. Also, :func:`asyncio.run` has been updated to utilize the new
  14651. coroutine. Patch by Kyle Stanley.
  14652. - bpo-37405: Fixed regression bug for socket.getsockname() for non-CAN_ISOTP
  14653. AF_CAN address family sockets by returning a 1-tuple instead of string.
  14654. - bpo-38121: Update parameter names on functions in importlib.metadata
  14655. matching the changes in the 0.22 release of importlib_metadata.
  14656. - bpo-38110: The os.closewalk() implementation now uses the libc fdwalk()
  14657. API on platforms where it is available.
  14658. - bpo-38093: Fixes AsyncMock so it doesn't crash when used with
  14659. AsyncContextManagers or AsyncIterators.
  14660. - bpo-37488: Add warning to :meth:`datetime.utctimetuple`,
  14661. :meth:`datetime.utcnow` and :meth:`datetime.utcfromtimestamp` .
  14662. - bpo-35640: Allow passing a :term:`path-like object` as ``directory``
  14663. argument to the :class:`http.server.SimpleHTTPRequestHandler` class. Patch
  14664. by Géry Ogam.
  14665. - bpo-38086: Update importlib.metadata with changes from `importlib_metadata
  14666. 0.21
  14667. <https://gitlab.com/python-devs/importlib_metadata/blob/0.21/importlib_metadata/docs/changelog.rst>`_.
  14668. - bpo-37251: Remove ``__code__`` check in AsyncMock that incorrectly
  14669. evaluated function specs as async objects but failed to evaluate classes
  14670. with ``__await__`` but no ``__code__`` attribute defined as async objects.
  14671. - bpo-38037: Fix reference counters in the :mod:`signal` module.
  14672. - bpo-38066: Hide internal asyncio.Stream methods: feed_eof(), feed_data(),
  14673. set_exception() and set_transport().
  14674. - bpo-38059: inspect.py now uses sys.exit() instead of exit()
  14675. - bpo-38049: Added command-line interface for the :mod:`ast` module.
  14676. - bpo-37953: In :mod:`typing`, improved the ``__hash__`` and ``__eq__``
  14677. methods for :class:`ForwardReferences`.
  14678. - bpo-38026: Fixed :func:`inspect.getattr_static` used ``isinstance`` while
  14679. it should avoid dynamic lookup.
  14680. - bpo-35923: Update :class:`importlib.machinery.BuiltinImporter` to use
  14681. ``loader._ORIGIN`` instead of a hardcoded value. Patch by Donghee Na.
  14682. - bpo-38010: In ``importlib.metadata`` sync with ``importlib_metadata``
  14683. 0.20, clarifying behavior of ``files()`` and fixing issue where only one
  14684. requirement was returned for ``requires()`` on ``dist-info`` packages.
  14685. - bpo-38006: weakref.WeakValueDictionary defines a local remove() function
  14686. used as callback for weak references. This function was created with a
  14687. closure. Modify the implementation to avoid the closure.
  14688. - bpo-37995: Added the *indent* option to :func:`ast.dump` which allows it
  14689. to produce a multiline indented output.
  14690. - bpo-34410: Fixed a crash in the :func:`tee` iterator when re-enter it.
  14691. RuntimeError is now raised in this case.
  14692. - bpo-37140: Fix a ctypes regression of Python 3.8. When a ctypes.Structure
  14693. is passed by copy to a function, ctypes internals created a temporary
  14694. object which had the side effect of calling the structure finalizer
  14695. (__del__) twice. The Python semantics requires a finalizer to be called
  14696. exactly once. Fix ctypes internals to no longer call the finalizer twice.
  14697. - bpo-37587: ``_json.scanstring`` is now up to 3x faster when there are many
  14698. backslash escaped characters in the JSON string.
  14699. - bpo-37834: Prevent shutil.rmtree exception when built on non-Windows
  14700. system without fd system call support, like older versions of macOS.
  14701. - bpo-10978: Semaphores and BoundedSemaphores can now release more than one
  14702. waiting thread at a time.
  14703. - bpo-37972: Subscripts to the ``unittest.mock.call`` objects now receive
  14704. the same chaining mechanism as any other custom attributes, so that the
  14705. following usage no longer raises a ``TypeError``:
  14706. ``call().foo().__getitem__('bar')``
  14707. Patch by blhsing
  14708. - bpo-37965: Fix C compiler warning caused by
  14709. distutils.ccompiler.CCompiler.has_function.
  14710. - bpo-37964: Add ``F_GETPATH`` command to :mod:`fcntl`.
  14711. - bpo-37960: ``repr()`` of buffered and text streams now silences only
  14712. expected exceptions when get the value of "name" and "mode" attributes.
  14713. - bpo-37961: Add a ``total_nframe`` field to the traces collected by the
  14714. tracemalloc module. This field indicates the original number of frames
  14715. before it was truncated.
  14716. - bpo-37951: Most features of the subprocess module now work again in
  14717. subinterpreters. Only *preexec_fn* is restricted in subinterpreters.
  14718. - bpo-36205: Fix the rusage implementation of time.process_time() to
  14719. correctly report the sum of the system and user CPU time.
  14720. - bpo-37950: Fix :func:`ast.dump` when call with incompletely initialized
  14721. node.
  14722. - bpo-34679: Restores instantiation of Windows IOCP event loops from the
  14723. non-main thread.
  14724. - bpo-36917: Add default implementation of the
  14725. :meth:`ast.NodeVisitor.visit_Constant` method which emits a deprecation
  14726. warning and calls corresponding methods ``visit_Num()``, ``visit_Str()``,
  14727. etc.
  14728. - bpo-37798: Update test_statistics.py to verify that the statistics module
  14729. works well for both C and Python implementations. Patch by Donghee Na
  14730. - bpo-26589: Added a new status code to the http module: 451
  14731. UNAVAILABLE_FOR_LEGAL_REASONS
  14732. - bpo-37915: Fix a segmentation fault that appeared when comparing instances
  14733. of ``datetime.timezone`` and ``datetime.tzinfo`` objects. Patch by Pablo
  14734. Galindo.
  14735. - bpo-32554: Deprecate having random.seed() call hash on arbitrary types.
  14736. - bpo-9938: Add optional keyword argument ``exit_on_error`` for
  14737. :class:`ArgumentParser`.
  14738. - bpo-37851: The :mod:`faulthandler` module no longer allocates its
  14739. alternative stack at Python startup. Now the stack is only allocated at
  14740. the first faulthandler usage.
  14741. - bpo-32793: Fix a duplicated debug message when
  14742. :meth:`smtplib.SMTP.connect` is called.
  14743. - bpo-37885: venv: Don't generate unset variable warning on deactivate.
  14744. - bpo-37868: Fix dataclasses.is_dataclass when given an instance that never
  14745. raises AttributeError in __getattr__. That is, an object that returns
  14746. something for __dataclass_fields__ even if it's not a dataclass.
  14747. - bpo-37811: Fix ``socket`` module's ``socket.connect(address)`` function
  14748. being unable to establish connection in case of interrupted system call.
  14749. The problem was observed on all OSes which ``poll(2)`` system call can
  14750. take only non-negative integers and -1 as a timeout value.
  14751. - bpo-37863: Optimizations for Fraction.__hash__ suggested by Tim Peters.
  14752. - bpo-21131: Fix ``faulthandler.register(chain=True)`` stack. faulthandler
  14753. now allocates a dedicated stack of ``SIGSTKSZ*2`` bytes, instead of just
  14754. ``SIGSTKSZ`` bytes. Calling the previous signal handler in faulthandler
  14755. signal handler uses more than ``SIGSTKSZ`` bytes of stack memory on some
  14756. platforms.
  14757. - bpo-37798: Add C fastpath for statistics.NormalDist.inv_cdf() Patch by
  14758. Donghee Na
  14759. - bpo-37804: Remove the deprecated method ``threading.Thread.isAlive()``.
  14760. Patch by Donghee Na.
  14761. - bpo-37819: Add Fraction.as_integer_ratio() to match the corresponding
  14762. methods in bool, int, float, and decimal.
  14763. - bpo-14465: Add an xml.etree.ElementTree.indent() function for
  14764. pretty-printing XML trees. Contributed by Stefan Behnel.
  14765. - bpo-37810: Fix :mod:`difflib` ``?`` hint in diff output when dealing with
  14766. tabs. Patch by Anthony Sottile.
  14767. - bpo-37772: In ``zipfile.Path``, when adding implicit dirs, ensure that
  14768. ancestral directories are added and that duplicates are excluded.
  14769. - bpo-18578: Renamed and documented ``test.bytecode_helper`` as
  14770. ``test.support.bytecode_helper``. Patch by Joannah Nanjekye.
  14771. - bpo-37785: Fix xgettext warnings in :mod:`argparse`.
  14772. - bpo-34488: :meth:`writelines` method of :class:`io.BytesIO` is now
  14773. slightly faster when many small lines are passed. Patch by Sergey
  14774. Fedoseev.
  14775. - bpo-37449: ``ensurepip`` now uses ``importlib.resources.read_binary()`` to
  14776. read data instead of ``pkgutil.get_data()``. Patch by Joannah Nanjekye.
  14777. - bpo-28292: Mark calendar.py helper functions as being private. The
  14778. follows PEP 8 guidance to maintain the style conventions in the module and
  14779. it addresses a known case of user confusion.
  14780. - bpo-18049: Add definition of THREAD_STACK_SIZE for AIX in
  14781. Python/thread_pthread.h The default thread stacksize caused crashes with
  14782. the default recursion limit Patch by M Felt
  14783. - bpo-37742: The logging.getLogger() API now returns the root logger when
  14784. passed the name 'root', whereas previously it returned a non-root logger
  14785. named 'root'. This could affect cases where user code explicitly wants a
  14786. non-root logger named 'root', or instantiates a logger using
  14787. logging.getLogger(__name__) in some top-level module called 'root.py'.
  14788. - bpo-37738: Fix the implementation of curses ``addch(str, color_pair)``:
  14789. pass the color pair to ``setcchar()``, instead of always passing 0 as the
  14790. color pair.
  14791. - bpo-37723: Fix performance regression on regular expression parsing with
  14792. huge character sets. Patch by Yann Vaginay.
  14793. - bpo-35943: The function :c:func:`PyImport_GetModule` now ensures any
  14794. module it returns is fully initialized. Patch by Joannah Nanjekye.
  14795. - bpo-32178: Fix IndexError in :mod:`email` package when trying to parse
  14796. invalid address fields starting with ``:``.
  14797. - bpo-37268: The :mod:`parser` module is deprecated and will be removed in
  14798. future versions of Python.
  14799. - bpo-11953: Completing WSA* error codes in :mod:`socket`.
  14800. - bpo-37685: Fixed comparisons of :class:`datetime.timedelta` and
  14801. :class:`datetime.timezone`.
  14802. - bpo-37697: Synchronize ``importlib.metadata`` with `importlib_metadata
  14803. 0.19
  14804. <https://gitlab.com/python-devs/importlib_metadata/-/milestones/20>`_,
  14805. improving handling of EGG-INFO files and fixing a crash when entry point
  14806. names contained colons.
  14807. - bpo-37695: Correct :func:`curses.unget_wch` error message. Patch by
  14808. Anthony Sottile.
  14809. - bpo-37689: Add :meth:`is_relative_to` in :class:`PurePath` to determine
  14810. whether or not one path is relative to another.
  14811. - bpo-29553: Fixed :meth:`argparse.ArgumentParser.format_usage` for mutually
  14812. exclusive groups. Patch by Andrew Nester.
  14813. - bpo-37691: Let math.dist() accept coordinates as sequences (or iterables)
  14814. rather than just tuples.
  14815. - bpo-37685: Fixed ``__eq__``, ``__lt__`` etc implementations in some
  14816. classes. They now return :data:`NotImplemented` for unsupported type of
  14817. the other operand. This allows the other operand to play role (for example
  14818. the equality comparison with :data:`~unittest.mock.ANY` will return
  14819. ``True``).
  14820. - bpo-37354: Make Activate.ps1 Powershell script static to allow for signing
  14821. it.
  14822. - bpo-37664: Update wheels bundled with ensurepip (pip 19.2.3 and setuptools
  14823. 41.2.0)
  14824. - bpo-37663: Bring consistency to venv shell activation scripts by always
  14825. using __VENV_PROMPT__.
  14826. - bpo-37642: Allowed the pure Python implementation of
  14827. :class:`datetime.timezone` to represent sub-minute offsets close to
  14828. minimum and maximum boundaries, specifically in the ranges (23:59, 24:00)
  14829. and (-23:59, 24:00). Patch by Ngalim Siregar
  14830. - bpo-36161: In :mod:`posix`, use ``ttyname_r`` instead of ``ttyname`` for
  14831. thread safety.
  14832. - bpo-36324: Make internal attributes for statistics.NormalDist() private.
  14833. - bpo-37555: Fix ``NonCallableMock._call_matcher`` returning tuple instead
  14834. of ``_Call`` object when ``self._spec_signature`` exists. Patch by
  14835. Elizabeth Uselton
  14836. - bpo-29446: Make ``from tkinter import *`` import only the expected
  14837. objects.
  14838. - bpo-16970: Adding a value error when an invalid value in passed to nargs
  14839. Patch by Robert Leenders
  14840. - bpo-34443: Exceptions from :mod:`enum` now use the ``__qualname`` of the
  14841. enum class in the exception message instead of the ``__name__``.
  14842. - bpo-37491: Fix ``IndexError`` when parsing email headers with unexpectedly
  14843. ending bare-quoted string value. Patch by Abhilash Raj.
  14844. - bpo-37587: Make json.loads faster for long strings. (Patch by Marco
  14845. Paolini)
  14846. - bpo-18378: Recognize "UTF-8" as a valid value for LC_CTYPE in
  14847. locale._parse_localename.
  14848. - bpo-37579: Return :exc:`NotImplemented` in Python implementation of
  14849. ``__eq__`` for :class:`~datetime.timedelta` and :class:`~datetime.time`
  14850. when the other object being compared is not of the same type to match C
  14851. implementation. Patch by Karthikeyan Singaravelan.
  14852. - bpo-21478: Record calls to parent when autospecced object is attached to a
  14853. mock using :func:`unittest.mock.attach_mock`. Patch by Karthikeyan
  14854. Singaravelan.
  14855. - bpo-37531: "python3 -m test -jN --timeout=TIMEOUT" now kills a worker
  14856. process if it runs longer than *TIMEOUT* seconds.
  14857. - bpo-37482: Fix serialization of display name in originator or destination
  14858. address fields with both encoded words and special chars.
  14859. - bpo-36993: Improve error reporting for corrupt zip files with bad zip64
  14860. extra data. Patch by Daniel Hillier.
  14861. - bpo-37502: pickle.loads() no longer raises TypeError when the buffers
  14862. argument is set to None
  14863. - bpo-37520: Correct behavior for zipfile.Path.parent when the path object
  14864. identifies a subdirectory.
  14865. - bpo-18374: Fix the ``.col_offset`` attribute of nested :class:`ast.BinOp`
  14866. instances which had a too large value in some situations.
  14867. - bpo-37424: Fixes a possible hang when using a timeout on
  14868. ``subprocess.run()`` while capturing output. If the child process spawned
  14869. its own children or otherwise connected its stdout or stderr handles with
  14870. another process, we could hang after the timeout was reached and our child
  14871. was killed when attempting to read final output from the pipes.
  14872. - bpo-37421: Fix :func:`multiprocessing.util.get_temp_dir` finalizer: clear
  14873. also the 'tempdir' configuration of the current process, so next call to
  14874. ``get_temp_dir()`` will create a new temporary directory, rather than
  14875. reusing the removed temporary directory.
  14876. - bpo-37481: The distutils ``bdist_wininst`` command is deprecated in Python
  14877. 3.8, use ``bdist_wheel`` (wheel packages) instead.
  14878. - bpo-37479: When ``Enum.__str__`` is overridden in a derived class, the
  14879. override will be used by ``Enum.__format__`` regardless of whether mixin
  14880. classes are present.
  14881. - bpo-37440: http.client now enables TLS 1.3 post-handshake authentication
  14882. for default context or if a cert_file is passed to HTTPSConnection.
  14883. - bpo-37437: Update vendorized expat version to 2.2.7.
  14884. - bpo-37428: SSLContext.post_handshake_auth = True no longer sets
  14885. SSL_VERIFY_POST_HANDSHAKE verify flag for client connections. Although the
  14886. option is documented as ignored for clients, OpenSSL implicitly enables
  14887. cert chain validation when the flag is set.
  14888. - bpo-37420: :func:`os.sched_setaffinity` now correctly handles errors that
  14889. arise during iteration over its ``mask`` argument. Patch by Brandt Bucher.
  14890. - bpo-37412: The :func:`os.getcwdb` function now uses the UTF-8 encoding on
  14891. Windows, rather than the ANSI code page: see :pep:`529` for the rationale.
  14892. The function is no longer deprecated on Windows.
  14893. - bpo-37406: The sqlite3 module now raises TypeError, rather than
  14894. ValueError, if operation argument type is not str: execute(),
  14895. executemany() and calling a connection.
  14896. - bpo-29412: Fix IndexError in parsing a header value ending unexpectedly.
  14897. Patch by Abhilash Raj.
  14898. - bpo-36546: The *dist* argument for statistics.quantiles() is now
  14899. positional only. The current name doesn't reflect that the argument can be
  14900. either a dataset or a distribution. Marking the parameter as positional
  14901. avoids confusion and makes it possible to change the name later.
  14902. - bpo-37394: Fix a bug that was causing the :mod:`queue` module to fail if
  14903. the accelerator module was not available. Patch by Pablo Galindo.
  14904. - bpo-37376: :mod:`pprint` now has support for
  14905. :class:`types.SimpleNamespace`. Patch by Carl Bordum Hansen.
  14906. - bpo-26967: An :class:`~argparse.ArgumentParser` with
  14907. ``allow_abbrev=False`` no longer disables grouping of short flags, such as
  14908. ``-vv``, but only disables abbreviation of long flags as documented. Patch
  14909. by Zac Hatfield-Dodds.
  14910. - bpo-37212: :func:`unittest.mock.call` now preserves the order of keyword
  14911. arguments in repr output. Patch by Karthikeyan Singaravelan.
  14912. - bpo-37372: Fix error unpickling datetime.time objects from Python 2 with
  14913. seconds>=24. Patch by Justin Blanchard.
  14914. - bpo-37345: Add formal support for UDPLITE sockets. Support was present
  14915. before, but it is now easier to detect support with ``hasattr(socket,
  14916. 'IPPROTO_UDPLITE')`` and there are constants defined for each of the
  14917. values needed: ``socket.IPPROTO_UDPLITE``, ``UDPLITE_SEND_CSCOV``, and
  14918. ``UDPLITE_RECV_CSCOV``. Patch by Gabe Appleton.
  14919. - bpo-37358: Optimized ``functools.partial`` by using vectorcall.
  14920. - bpo-37347: :meth:`sqlite3.Connection.create_aggregate`,
  14921. :meth:`sqlite3.Connection.create_function`,
  14922. :meth:`sqlite3.Connection.set_authorizer`,
  14923. :meth:`sqlite3.Connection.set_progress_handler`
  14924. :meth:`sqlite3.Connection.set_trace_callback` methods lead to segfaults if
  14925. some of these methods are called twice with an equal object but not the
  14926. same. Now callbacks are stored more carefully. Patch by Aleksandr Balezin.
  14927. - bpo-37163: The *obj* argument of :func:`dataclasses.replace` is
  14928. positional-only now.
  14929. - bpo-37085: Add the optional Linux SocketCAN Broadcast Manager constants,
  14930. used as flags to configure the BCM behaviour, in the socket module. Patch
  14931. by Karl Ding.
  14932. - bpo-37328: ``HTMLParser.unescape`` is removed. It was undocumented and
  14933. deprecated since Python 3.4.
  14934. - bpo-37305: Add .webmanifest -> application/manifest+json to list of
  14935. recognized file types and content type headers
  14936. - bpo-37320: ``aifc.openfp()`` alias to ``aifc.open()``, ``sunau.openfp()``
  14937. alias to ``sunau.open()``, and ``wave.openfp()`` alias to ``wave.open()``
  14938. have been removed. They were deprecated since Python 3.7.
  14939. - bpo-37315: Deprecated accepting floats with integral value (like ``5.0``)
  14940. in :func:`math.factorial`.
  14941. - bpo-37312: ``_dummy_thread`` and ``dummy_threading`` modules have been
  14942. removed. These modules were deprecated since Python 3.7 which requires
  14943. threading support.
  14944. - bpo-33972: Email with single part but content-type set to ``multipart/*``
  14945. doesn't raise AttributeError anymore.
  14946. - bpo-37280: Use threadpool for reading from file for sendfile fallback
  14947. mode.
  14948. - bpo-37279: Fix asyncio sendfile support when sendfile sends extra data in
  14949. fallback mode.
  14950. - bpo-19865: :func:`ctypes.create_unicode_buffer()` now also supports
  14951. non-BMP characters on platforms with 16-bit :c:type:`wchar_t` (for
  14952. example, Windows and AIX).
  14953. - bpo-37266: In a subinterpreter, spawning a daemon thread now raises an
  14954. exception. Daemon threads were never supported in subinterpreters.
  14955. Previously, the subinterpreter finalization crashed with a Python fatal
  14956. error if a daemon thread was still running.
  14957. - bpo-37210: Allow pure Python implementation of :mod:`pickle` to work even
  14958. when the C :mod:`_pickle` module is unavailable.
  14959. - bpo-21872: Fix :mod:`lzma`: module decompresses data incompletely. When
  14960. decompressing a FORMAT_ALONE format file, and it doesn't have the end
  14961. marker, sometimes the last one to dozens bytes can't be output. Patch by
  14962. Ma Lin.
  14963. - bpo-35922: Fix :meth:`RobotFileParser.crawl_delay` and
  14964. :meth:`RobotFileParser.request_rate` to return ``None`` rather than raise
  14965. :exc:`AttributeError` when no relevant rule is defined in the robots.txt
  14966. file. Patch by Rémi Lapeyre.
  14967. - bpo-35766: Change the format of feature_version to be a (major, minor)
  14968. tuple.
  14969. - bpo-36607: Eliminate :exc:`RuntimeError` raised by
  14970. :func:`asyncio.all_tasks()` if internal tasks weak set is changed by
  14971. another thread during iteration.
  14972. - bpo-18748: :class:`_pyio.IOBase` destructor now does nothing if getting
  14973. the ``closed`` attribute fails to better mimic :class:`_io.IOBase`
  14974. finalizer.
  14975. - bpo-36402: Fix a race condition at Python shutdown when waiting for
  14976. threads. Wait until the Python thread state of all non-daemon threads get
  14977. deleted (join all non-daemon threads), rather than just wait until
  14978. non-daemon Python threads complete.
  14979. - bpo-37206: Default values which cannot be represented as Python objects no
  14980. longer improperly represented as ``None`` in function signatures.
  14981. - bpo-37111: Added ``encoding`` and ``errors`` keyword parameters to
  14982. ``logging.basicConfig``.
  14983. - bpo-12144: Ensure cookies with ``expires`` attribute are handled in
  14984. :meth:`CookieJar.make_cookies`.
  14985. - bpo-34886: Fix an unintended ValueError from :func:`subprocess.run` when
  14986. checking for conflicting *input* and *stdin* or *capture_output* and
  14987. *stdout* or *stderr* args when they were explicitly provided but with
  14988. ``None`` values within a passed in ``**kwargs`` dict rather than as passed
  14989. directly by name. Patch contributed by Rémi Lapeyre.
  14990. - bpo-37173: The exception message for ``inspect.getfile()`` now correctly
  14991. reports the passed class rather than the builtins module.
  14992. - bpo-37178: Give math.perm() a one argument form that means the same as
  14993. math.factorial().
  14994. - bpo-37178: For math.perm(n, k), let k default to n, giving the same result
  14995. as factorial.
  14996. - bpo-37165: Converted _collections._count_elements to use the Argument
  14997. Clinic.
  14998. - bpo-34767: Do not always create a :class:`collections.deque` in
  14999. :class:`asyncio.Lock`.
  15000. - bpo-37158: Speed-up statistics.fmean() by switching from a function to a
  15001. generator.
  15002. - bpo-34282: Remove ``Enum._convert`` method, deprecated in 3.8.
  15003. - bpo-37150: ``argparse._ActionsContainer.add_argument`` now throws error,
  15004. if someone accidentally pass FileType class object instead of instance of
  15005. FileType as ``type`` argument.
  15006. - bpo-28724: The socket module now has the :func:`socket.send_fds` and
  15007. :func:`socket.recv.fds` methods. Contributed by Joannah Nanjekye, Shinya
  15008. Okano and Victor Stinner.
  15009. - bpo-35621: Support running asyncio subprocesses when execution event loop
  15010. in a thread on UNIX.
  15011. - bpo-36520: Lengthy email headers with UTF-8 characters are now properly
  15012. encoded when they are folded. Patch by Jeffrey Kintscher.
  15013. - bpo-30835: Fixed a bug in email parsing where a message with invalid bytes
  15014. in content-transfer-encoding of a multipart message can cause an
  15015. AttributeError. Patch by Andrew Donnellan.
  15016. - bpo-31163: pathlib.Path instance's rename and replace methods now return
  15017. the new Path instance.
  15018. - bpo-25068: :class:`urllib.request.ProxyHandler` now lowercases the keys of
  15019. the passed dictionary.
  15020. - bpo-26185: Fix :func:`repr` on empty :class:`ZipInfo` object. Patch by
  15021. Mickaël Schoentgen.
  15022. - bpo-21315: Email headers containing RFC2047 encoded words are parsed
  15023. despite the missing whitespace, and a defect registered. Also missing
  15024. trailing whitespace after encoded words is now registered as a defect.
  15025. - bpo-31904: Port test_datetime to VxWorks: skip zoneinfo tests on VxWorks
  15026. - bpo-35805: Add parser for Message-ID header and add it to default
  15027. HeaderRegistry. This should prevent folding of Message-ID using RFC 2048
  15028. encoded words.
  15029. - bpo-36871: Ensure method signature is used instead of constructor
  15030. signature of a class while asserting mock object against method calls.
  15031. Patch by Karthikeyan Singaravelan.
  15032. - bpo-35070: posix.getgrouplist() now works correctly when the user belongs
  15033. to NGROUPS_MAX supplemental groups. Patch by Jeffrey Kintscher.
  15034. - bpo-31783: Fix race condition in ThreadPoolExecutor when worker threads
  15035. are created during interpreter shutdown.
  15036. - bpo-36582: Fix ``UserString.encode()`` to correctly return ``bytes``
  15037. rather than a ``UserString`` instance.
  15038. - bpo-32424: Deprecate xml.etree.ElementTree.Element.copy() in favor of
  15039. copy.copy().
  15040. Patch by Gordon P. Hemsley
  15041. - bpo-36564: Fix infinite loop in email header folding logic that would be
  15042. triggered when an email policy's max_line_length is not long enough to
  15043. include the required markup and any values in the message. Patch by Paul
  15044. Ganssle
  15045. - bpo-36543: Removed methods Element.getchildren(), Element.getiterator()
  15046. and ElementTree.getiterator() and the xml.etree.cElementTree module.
  15047. - bpo-36409: Remove the old plistlib API deprecated in Python 3.4
  15048. - bpo-36302: distutils sorts source file lists so that Extension .so files
  15049. build more reproducibly by default
  15050. - bpo-36250: Ignore ``ValueError`` from ``signal`` with ``interaction`` in
  15051. non-main thread.
  15052. - bpo-36046: Added ``user``, ``group`` and ``extra_groups`` parameters to
  15053. the subprocess.Popen constructor. Patch by Patrick McLean.
  15054. - bpo-32627: Fix compile error when ``_uuid`` headers conflicting included.
  15055. - bpo-35800: Deprecate ``smtpd.MailmanProxy`` ready for future removal.
  15056. - bpo-35168: :attr:`shlex.shlex.punctuation_chars` is now a read-only
  15057. property.
  15058. - bpo-8538: Add support for boolean actions like ``--foo`` and ``--no-foo``
  15059. to argparse. Patch contributed by Rémi Lapeyre.
  15060. - bpo-20504: Fixes a bug in :mod:`cgi` module when a multipart/form-data
  15061. request has no ``Content-Length`` header.
  15062. - bpo-25988: The abstract base classes in :mod:`collections.abc` no longer
  15063. are exposed in the regular :mod:`collections` module.
  15064. - bpo-11122: Distutils won't check for rpmbuild in specified paths only.
  15065. - bpo-34775: Division handling of PurePath now returns NotImplemented
  15066. instead of raising a TypeError when passed something other than an
  15067. instance of str or PurePath. Patch by Roger Aiudi.
  15068. - bpo-34749: :func:`binascii.a2b_base64` is now up to 2 times faster. Patch
  15069. by Sergey Fedoseev.
  15070. - bpo-34519: Add additional aliases for HP Roman 8. Patch by Michael Osipov.
  15071. - bpo-28009: Fix uuid.getnode() on platforms with '.' as MAC Addr delimiter
  15072. as well fix for MAC Addr format that omits a leading 0 in MAC Addr values.
  15073. Currently, AIX is the only know platform with these settings. Patch by
  15074. Michael Felt.
  15075. - bpo-30618: Add :meth:`~pathlib.Path.readlink`. Patch by Girts Folkmanis.
  15076. - bpo-32498: Made :func:`urllib.parse.unquote()` accept bytes in addition to
  15077. strings. Patch by Stein Karlsen.
  15078. - bpo-33348: lib2to3 now recognizes expressions after ``*`` and ``**`` like
  15079. in ``f(*[] or [])``.
  15080. - bpo-32689: Update :func:`shutil.move` function to allow for Path objects
  15081. to be used as source argument. Patch by Emily Morehouse and Maxwell
  15082. "5.13b" McKinnon.
  15083. - bpo-32820: Added ``__format__`` to IPv4 and IPv6 classes. Always outputs
  15084. a fully zero-padded string. Supports b/x/n modifiers (bin/hex/native
  15085. format). Native format for IPv4 is bin, native format for IPv6 is hex.
  15086. Also supports '#' and '_' modifiers.
  15087. - bpo-27657: Fix urllib.parse.urlparse() with numeric paths. A string like
  15088. "path:80" is no longer parsed as a path but as a scheme ("path") and a
  15089. path ("80").
  15090. - bpo-4963: Fixed non-deterministic behavior related to mimetypes extension
  15091. mapping and module reinitialization.
  15092. Documentation
  15093. -------------
  15094. - bpo-21767: Explicitly mention abc support in functools.singledispatch
  15095. - bpo-38816: Provides more details about the interaction between
  15096. :c:func:`fork` and CPython's runtime, focusing just on the C-API. This
  15097. includes cautions about where :c:func:`fork` should and shouldn't be
  15098. called.
  15099. - bpo-38351: Modernize :mod:`email` examples from %-formatting to f-strings.
  15100. - bpo-38778: Document the fact that :exc:`RuntimeError` is raised if
  15101. :meth:`os.fork` is called in a subinterpreter.
  15102. - bpo-38592: Add Brazilian Portuguese to the language switcher at Python
  15103. Documentation website.
  15104. - bpo-38294: Add list of no-longer-escaped chars to re.escape documentation
  15105. - bpo-38053: Modernized the plistlib documentation
  15106. - bpo-26868: Fix example usage of :c:func:`PyModule_AddObject` to properly
  15107. handle errors.
  15108. - bpo-36797: Fix a dead link in the distutils API Reference.
  15109. - bpo-37977: Warn more strongly and clearly about pickle insecurity
  15110. - bpo-37979: Added a link to dateutil.parser.isoparse in the
  15111. datetime.fromisoformat documentation. Patch by Paul Ganssle
  15112. - bpo-12707: Deprecate info(), geturl(), getcode() methods in favor of the
  15113. headers, url, and status properties, respectively, for HTTPResponse and
  15114. addinfourl. Also deprecate the code attribute of addinfourl in favor of
  15115. the status attribute. Patch by Ashwin Ramaswami
  15116. - bpo-37937: Mention ``frame.f_trace`` in :func:`sys.settrace` docs.
  15117. - bpo-37878: Make :c:func:`PyThreadState_DeleteCurrent` Internal.
  15118. - bpo-37759: Beginning edits to Whatsnew 3.8
  15119. - bpo-37726: Stop recommending getopt in the tutorial for command line
  15120. argument parsing and promote argparse.
  15121. - bpo-32910: Remove implementation-specific behaviour of how venv's
  15122. Deactivate works.
  15123. - bpo-37256: Fix wording of arguments for :class:`Request` in
  15124. :mod:`urllib.request`
  15125. - bpo-37284: Add a brief note to indicate that any new
  15126. ``sys.implementation`` required attributes must go through the PEP
  15127. process.
  15128. - bpo-30088: Documented that :class:`mailbox.Maildir` constructor doesn't
  15129. attempt to verify the maildir folder layout correctness. Patch by
  15130. Sviatoslav Sydorenko.
  15131. - bpo-37521: Fix ``importlib`` examples to insert any newly created modules
  15132. via importlib.util.module_from_spec() immediately into sys.modules instead
  15133. of after calling loader.exec_module().
  15134. Thanks to Benjamin Mintz for finding the bug.
  15135. - bpo-37456: Slash ('/') is now part of syntax.
  15136. - bpo-37487: Fix PyList_GetItem index description to include 0.
  15137. - bpo-37149: Replace the dead link to the Tkinter 8.5 reference by John
  15138. Shipman, New Mexico Tech, with a link to the archive.org copy.
  15139. - bpo-37478: Added possible exceptions to the description of os.chdir().
  15140. - bpo-34903: Documented that in :meth:`datetime.datetime.strptime()`, the
  15141. leading zero in some two-digit formats is optional. Patch by Mike Gleen.
  15142. - bpo-36260: Add decompression pitfalls to zipfile module documentation.
  15143. - bpo-37004: In the documentation for difflib, a note was added explicitly
  15144. warning that the results of SequenceMatcher's ratio method may depend on
  15145. the order of the input strings.
  15146. - bpo-36960: Restructured the :mod:`datetime` docs in the interest of making
  15147. them more user-friendly and improving readability. Patch by Brad Solomon.
  15148. - bpo-36487: Make C-API docs clear about what the "main" interpreter is.
  15149. - bpo-23460: The documentation for decimal string formatting using the
  15150. ``:g`` specifier has been updated to reflect the correct exponential
  15151. notation cutoff point. Original patch contributed by Tuomas Suutari.
  15152. - bpo-35803: Document and test that ``tempfile`` functions may accept a
  15153. :term:`path-like object` for the ``dir`` argument. Patch by Anthony
  15154. Sottile.
  15155. - bpo-33944: Added a note about the intended use of code in .pth files.
  15156. - bpo-34293: Fix the Doc/Makefile regarding PAPER environment variable and
  15157. PDF builds
  15158. - bpo-25237: Add documentation for tkinter modules
  15159. Tests
  15160. -----
  15161. - bpo-38614: Fix test_communicate() of test_asyncio.test_subprocess: use
  15162. ``support.LONG_TIMEOUT`` (5 minutes), instead of just 1 minute.
  15163. - bpo-38614: Add timeout constants to :mod:`test.support`:
  15164. :data:`~test.support.LOOPBACK_TIMEOUT`,
  15165. :data:`~test.support.INTERNET_TIMEOUT`,
  15166. :data:`~test.support.SHORT_TIMEOUT` and
  15167. :data:`~test.support.LONG_TIMEOUT`.
  15168. - bpo-38502: test.regrtest now uses process groups in the multiprocessing
  15169. mode (-jN command line option) if process groups are available: if
  15170. :func:`os.setsid` and :func:`os.killpg` functions are available.
  15171. - bpo-35998: Fix a race condition in test_asyncio.test_start_tls_server_1().
  15172. Previously, there was a race condition between the test main() function
  15173. which replaces the protocol and the test ServerProto protocol which sends
  15174. ANSWER once it gets HELLO. Now, only the test main() function is
  15175. responsible to send data, ServerProto no longer sends data.
  15176. - bpo-38470: Fix ``test_compileall.test_compile_dir_maxlevels()`` on Windows
  15177. without long path support: only create 3 subdirectories instead of between
  15178. 20 and 100 subdirectories.
  15179. - bpo-37531: On timeout, regrtest no longer attempts to call
  15180. ``popen.communicate()`` again: it can hang until all child processes using
  15181. stdout and stderr pipes completes. Kill the worker process and ignores its
  15182. output. Change also the faulthandler timeout of the main process from 1
  15183. minute to 5 minutes, for Python slowest buildbots.
  15184. - bpo-38239: Fix test_gdb for Link Time Optimization (LTO) builds.
  15185. - bpo-38275: test_ssl now handles disabled TLS/SSL versions better.
  15186. OpenSSL's crypto policy and run-time settings are recognized and tests for
  15187. disabled versions are skipped. Tests also accept more TLS minimum_versions
  15188. for platforms that override OpenSSL's default with strict settings.
  15189. - bpo-38271: The private keys for test_ssl were encrypted with 3DES in
  15190. traditional PKCS#5 format. 3DES and the digest algorithm of PKCS#5 are
  15191. blocked by some strict crypto policies. Use PKCS#8 format with AES256
  15192. encryption instead.
  15193. - bpo-38270: test.support now has a helper function to check for
  15194. availability of a hash digest function. Several tests are refactored avoid
  15195. MD5 and use SHA256 instead. Other tests are marked to use MD5 and skipped
  15196. when MD5 is disabled.
  15197. - bpo-37123: Multiprocessing test test_mymanager() now also expects
  15198. -SIGTERM, not only exitcode 0. BaseManager._finalize_manager() sends
  15199. SIGTERM to the manager process if it takes longer than 1 second to stop,
  15200. which happens on slow buildbots.
  15201. - bpo-38212: Multiprocessing tests: increase
  15202. test_queue_feeder_donot_stop_onexc() timeout from 1 to 60 seconds.
  15203. - bpo-38117: Test with OpenSSL 1.1.1d
  15204. - bpo-38018: Increase code coverage for multiprocessing.shared_memory.
  15205. - bpo-37805: Add tests for json.dump(..., skipkeys=True). Patch by Donghee
  15206. Na.
  15207. - bpo-37531: Enhance regrtest multiprocess timeout: write a message when
  15208. killing a worker process, catch popen.kill() and popen.wait() exceptions,
  15209. put a timeout on the second call to popen.communicate().
  15210. - bpo-37876: Add tests for ROT-13 codec.
  15211. - bpo-36833: Added tests for :samp:`PyDateTime_{xxx}_GET_{xxx}()` macros of
  15212. the C API of the :mod:`datetime` module. Patch by Joannah Nanjekye.
  15213. - bpo-37558: Fix test_shared_memory_cleaned_after_process_termination name
  15214. handling
  15215. - bpo-37526: Add :func:`test.support.catch_threading_exception`: context
  15216. manager catching :class:`threading.Thread` exception using
  15217. :func:`threading.excepthook`.
  15218. - bpo-37421: test_concurrent_futures now explicitly stops the ForkServer
  15219. instance if it's running.
  15220. - bpo-37421: multiprocessing tests now stop the ForkServer instance if it's
  15221. running: close the "alive" file descriptor to ask the server to stop and
  15222. then remove its UNIX address.
  15223. - bpo-37421: test_distutils.test_build_ext() is now able to remove the
  15224. temporary directory on Windows: don't import the newly built C extension
  15225. ("xx") in the current process, but test it in a separated process.
  15226. - bpo-37421: test_concurrent_futures now cleans up multiprocessing to remove
  15227. immediately temporary directories created by
  15228. multiprocessing.util.get_temp_dir().
  15229. - bpo-37421: test_winconsoleio doesn't leak a temporary file anymore: use
  15230. tempfile.TemporaryFile() to remove it when the test completes.
  15231. - bpo-37421: multiprocessing tests now explicitly call ``_run_finalizers()``
  15232. to immediately remove temporary directories created by tests.
  15233. - bpo-37421: urllib.request tests now call
  15234. :func:`~urllib.request.urlcleanup` to remove temporary files created by
  15235. ``urlretrieve()`` tests and to clear the ``_opener`` global variable set
  15236. by ``urlopen()`` and functions calling indirectly ``urlopen()``.
  15237. - bpo-37472: Remove ``Lib/test/outstanding_bugs.py``.
  15238. - bpo-37199: Fix test failures when IPv6 is unavailable or disabled.
  15239. - bpo-19696: Replace deprecated method "random.choose" with "random.choice"
  15240. in "test_pkg_import.py".
  15241. - bpo-37335: Remove no longer necessary code from c locale coercion tests
  15242. - bpo-37421: Fix test_shutil to no longer leak temporary files.
  15243. - bpo-37411: Fix test_wsgiref.testEnviron() to no longer depend on the
  15244. environment variables (don't fail if "X" variable is set).
  15245. - bpo-37400: Fix test_os.test_chown(): use os.getgroups() rather than
  15246. grp.getgrall() to get groups. Rename also the test to test_chown_gid().
  15247. - bpo-37359: Add --cleanup option to python3 -m test to remove
  15248. ``test_python_*`` directories of previous failed jobs. Add "make
  15249. cleantest" to run ``python3 -m test --cleanup``.
  15250. - bpo-37362: test_gdb no longer fails if it gets an "unexpected" message on
  15251. stderr: it now ignores stderr. The purpose of test_gdb is to test that
  15252. python-gdb.py commands work as expected, not to test gdb.
  15253. - bpo-35998: Avoid TimeoutError in test_asyncio: test_start_tls_server_1()
  15254. - bpo-37278: Fix test_asyncio ProactorLoopCtrlC: join the thread to prevent
  15255. leaking a running thread and leaking a reference.
  15256. - bpo-37261: Fix :func:`test.support.catch_unraisable_exception`: its
  15257. __exit__() method now ignores unraisable exception raised when clearing
  15258. its ``unraisable`` attribute.
  15259. - bpo-37069: regrtest now uses :func:`sys.unraisablehook` to mark a test as
  15260. "environment altered" (ENV_CHANGED) if it emits an "unraisable exception".
  15261. Moreover, regrtest logs a warning in this case.
  15262. Use ``python3 -m test --fail-env-changed`` to catch unraisable exceptions
  15263. in tests.
  15264. - bpo-37252: Fix assertions in ``test_close`` and
  15265. ``test_events_mask_overflow`` devpoll tests.
  15266. - bpo-37169: Rewrite ``_PyObject_IsFreed()`` unit tests.
  15267. - bpo-37153: ``test_venv.test_multiprocessing()`` now explicitly calls
  15268. ``pool.terminate()`` to wait until the pool completes.
  15269. - bpo-34001: Make test_ssl pass with LibreSSL. LibreSSL handles minimum and
  15270. maximum TLS version differently than OpenSSL.
  15271. - bpo-36919: Make ``test_source_encoding.test_issue2301`` implementation
  15272. independent. The test will work now for both CPython and IronPython.
  15273. - bpo-30202: Update ``test.test_importlib.test_abc`` to test
  15274. ``find_spec()``.
  15275. - bpo-28009: Modify the test_uuid logic to test when a program is available
  15276. AND can be used to obtain a MACADDR as basis for an UUID. Patch by M. Felt
  15277. - bpo-34596: Fallback to a default reason when :func:`unittest.skip` is
  15278. uncalled. Patch by Naitree Zhu.
  15279. Build
  15280. -----
  15281. - bpo-38809: On Windows, build scripts will now recognize and use python.exe
  15282. from an active virtual env.
  15283. - bpo-38684: Fix _hashlib build when Blake2 is disabled, but OpenSSL
  15284. supports it.
  15285. - bpo-38468: Misc/python-config.in now uses ``getvar()`` for all still
  15286. existing ``sysconfig.get_config_var()`` calls. Patch by Joannah Nanjekye.
  15287. - bpo-37415: Fix stdatomic.h header check for ICC compiler: the ICC
  15288. implementation lacks atomic_uintptr_t type which is needed by Python.
  15289. - bpo-38301: In Solaris family, we must be sure to use ``-D_REENTRANT``.
  15290. Patch by Jesús Cea Avión.
  15291. - bpo-36002: Locate ``llvm-profdata`` and ``llvm-ar`` binaries using
  15292. ``AC_PATH_TOOL`` rather than ``AC_PATH_TARGET_TOOL``.
  15293. - bpo-37936: The :file:`.gitignore` file systematically keeps "rooted", with
  15294. a non-trailing slash, all the rules that are meant to apply to files in a
  15295. specific place in the repo. Previously, when the intended file to ignore
  15296. happened to be at the root of the repo, we'd most often accidentally also
  15297. ignore files and directories with the same name anywhere in the tree.
  15298. - bpo-37760: The :file:`Tools/unicode/makeunicodedata.py` script, which is
  15299. used for converting information from the Unicode Character Database into
  15300. generated code and data used by the methods of :class:`str` and by the
  15301. :mod:`unicodedata` module, now handles each character's data as a
  15302. ``dataclass`` with named attributes, rather than a length-18 list of
  15303. different fields.
  15304. - bpo-37936: The :file:`.gitignore` file no longer applies to any files that
  15305. are in fact tracked in the Git repository. Patch by Greg Price.
  15306. - bpo-37725: Change "clean" makefile target to also clean the program guided
  15307. optimization (PGO) data. Previously you would have to use "make clean"
  15308. and "make profile-removal", or "make clobber".
  15309. - bpo-37707: Mark some individual tests to skip when --pgo is used. The
  15310. tests marked increase the PGO task time significantly and likely don't
  15311. help improve optimization of the final executable.
  15312. - bpo-36044: Reduce the number of unit tests run for the PGO generation
  15313. task. This speeds up the task by a factor of about 15x. Running the full
  15314. unit test suite is slow. This change may result in a slightly less
  15315. optimized build since not as many code branches will be executed. If you
  15316. are willing to wait for the much slower build, the old behavior can be
  15317. restored using './configure [..] PROFILE_TASK="-m test --pgo-extended"'.
  15318. We make no guarantees as to which PGO task set produces a faster build.
  15319. Users who care should run their own relevant benchmarks as results can
  15320. depend on the environment, workload, and compiler tool chain.
  15321. - bpo-37468: ``make install`` no longer installs ``wininst-*.exe`` files
  15322. used by distutils bdist_wininst: bdist_wininst only works on Windows.
  15323. - bpo-37189: Many :samp:`PyRun_{XXX}()` functions like
  15324. :c:func:`PyRun_String` were no longer exported in ``libpython38.dll`` by
  15325. mistake. Export them again to fix the ABI compatibility.
  15326. - bpo-25361: Enables use of SSE2 instructions in Windows 32-bit build.
  15327. - bpo-36210: Update optional extension module detection for AIX. ossaudiodev
  15328. and spwd are not applicable for AIX, and are no longer reported as
  15329. missing. 3rd-party packaging of ncurses (with ASIS support) conflicts with
  15330. officially supported AIX curses library, so configure AIX to use
  15331. libcurses.a. However, skip trying to build _curses_panel.
  15332. patch by M Felt
  15333. Windows
  15334. -------
  15335. - bpo-38589: Fixes HTML Help shortcut when Windows is not installed to C
  15336. drive
  15337. - bpo-38453: Ensure ntpath.realpath() correctly resolves relative paths.
  15338. - bpo-38519: Restores the internal C headers that were missing from the
  15339. nuget.org and Microsoft Store packages.
  15340. - bpo-38492: Remove ``pythonw.exe`` dependency on the Microsoft C++ runtime.
  15341. - bpo-38344: Fix error message in activate.bat
  15342. - bpo-38359: Ensures ``pyw.exe`` launcher reads correct registry key.
  15343. - bpo-38355: Fixes ``ntpath.realpath`` failing on ``sys.executable``.
  15344. - bpo-38117: Update bundled OpenSSL to 1.1.1d
  15345. - bpo-38092: Reduce overhead when using multiprocessing in a Windows virtual
  15346. environment.
  15347. - bpo-38133: Allow py.exe launcher to locate installations from the
  15348. Microsoft Store and improve display of active virtual environments.
  15349. - bpo-38114: The ``pip.ini`` is no longer included in the Nuget package.
  15350. - bpo-32592: Set Windows 8 as the minimum required version for API support
  15351. - bpo-36634: :func:`os.cpu_count` now returns active processors rather than
  15352. maximum processors.
  15353. - bpo-36634: venv activate.bat now works when the existing variables contain
  15354. double quote characters.
  15355. - bpo-38081: Prevent error calling :func:`os.path.realpath` on ``'NUL'``.
  15356. - bpo-38087: Fix case sensitivity in test_pathlib and test_ntpath.
  15357. - bpo-38088: Fixes distutils not finding vcruntime140.dll with only the v142
  15358. toolset installed.
  15359. - bpo-37283: Ensure command-line and unattend.xml setting override
  15360. previously detected states in Windows installer.
  15361. - bpo-38030: Fixes :func:`os.stat` failing for block devices on Windows
  15362. - bpo-38020: Fixes potential crash when calling :func:`os.readlink` (or
  15363. indirectly through :func:`~os.path.realpath`) on a file that is not a
  15364. supported link.
  15365. - bpo-37705: Improve the implementation of ``winerror_to_errno()``.
  15366. - bpo-37549: :func:`os.dup` no longer fails for standard streams on Windows
  15367. 7.
  15368. - bpo-1311: The ``nul`` file on Windows now returns True from
  15369. :func:`~os.path.exists` and a valid result from :func:`os.stat` with
  15370. ``S_IFCHR`` set.
  15371. - bpo-9949: Enable support for following symlinks in :func:`os.realpath`.
  15372. - bpo-37834: Treat all name surrogate reparse points on Windows in
  15373. :func:`os.lstat` and other reparse points as regular files in
  15374. :func:`os.stat`.
  15375. - bpo-36266: Add the module name in the formatted error message when DLL
  15376. load fail happens during module import in
  15377. ``_PyImport_FindSharedFuncptrWindows()``. Patch by Srinivas Nyayapati.
  15378. - bpo-25172: Trying to import the :mod:`crypt` module on Windows will result
  15379. in an :exc:`ImportError` with a message explaining that the module isn't
  15380. supported on Windows. On other platforms, if the underlying ``_crypt``
  15381. module is not available, the ImportError will include a message explaining
  15382. the problem.
  15383. - bpo-37778: Fixes the icons used for file associations to the Microsoft
  15384. Store package.
  15385. - bpo-37734: Fix use of registry values to launch Python from Microsoft
  15386. Store app.
  15387. - bpo-37702: Fix memory leak on Windows in creating an SSLContext object or
  15388. running ``urllib.request.urlopen('https://...')``.
  15389. - bpo-37672: Switch Windows Store package's pip to use bundled
  15390. :file:`pip.ini` instead of :envvar:`PIP_USER` variable.
  15391. - bpo-10945: Officially drop support for creating bdist_wininst installers
  15392. on non-Windows systems.
  15393. - bpo-37445: Include the ``FORMAT_MESSAGE_IGNORE_INSERTS`` flag in
  15394. ``FormatMessageW()`` calls.
  15395. - bpo-37369: Fixes path for :data:`sys.executable` when running from the
  15396. Microsoft Store.
  15397. - bpo-37380: Don't collect unfinished processes with ``subprocess._active``
  15398. on Windows to cleanup later. Patch by Ruslan Kuprieiev.
  15399. - bpo-37351: Removes libpython38.a from standard Windows distribution.
  15400. - bpo-35360: Update Windows builds to use SQLite 3.28.0.
  15401. - bpo-37267: On Windows, :func:`os.dup` no longer creates an inheritable fd
  15402. when handling a character file.
  15403. - bpo-36779: Ensure ``time.tzname`` is correct on Windows when the active
  15404. code page is set to CP_UTF7 or CP_UTF8.
  15405. - bpo-32587: Make :const:`winreg.REG_MULTI_SZ` support zero-length strings.
  15406. - bpo-28269: Replace use of :c:func:`strcasecmp` for the system function
  15407. :c:func:`_stricmp`. Patch by Minmin Gong.
  15408. - bpo-36590: Add native Bluetooth RFCOMM support to socket module.
  15409. macOS
  15410. -----
  15411. - bpo-38117: Updated OpenSSL to 1.1.1d in macOS installer.
  15412. - bpo-38089: Move Azure Pipelines to latest VM versions and make macOS tests
  15413. optional
  15414. - bpo-18049: Increase the default stack size of threads from 5MB to 16MB on
  15415. macOS, to match the stack size of the main thread. This avoids crashes on
  15416. deep recursion in threads.
  15417. - bpo-34602: Avoid test suite failures on macOS by no longer calling
  15418. resource.setrlimit to increase the process stack size limit at runtime.
  15419. The runtime change is no longer needed since the interpreter is being
  15420. built with a larger default stack size.
  15421. - bpo-35360: Update macOS installer to use SQLite 3.28.0.
  15422. - bpo-34631: Updated OpenSSL to 1.1.1c in macOS installer.
  15423. IDLE
  15424. ----
  15425. - bpo-26353: Stop adding newline when saving an IDLE shell window.
  15426. - bpo-4630: Add an option to toggle IDLE's cursor blink for shell, editor,
  15427. and output windows. See Settings, General, Window Preferences, Cursor
  15428. Blink. Patch by Zackery Spytz.
  15429. - bpo-38598: Do not try to compile IDLE shell or output windows
  15430. - bpo-36698: IDLE no longer fails when write non-encodable characters to
  15431. stderr. It now escapes them with a backslash, as the regular Python
  15432. interpreter. Added the ``errors`` field to the standard streams.
  15433. - bpo-35379: When exiting IDLE, catch any AttributeError. One happens when
  15434. EditorWindow.close is called twice. Printing a traceback, when IDLE is
  15435. run from a terminal, is useless and annoying.
  15436. - bpo-38183: To avoid problems, test_idle ignores the user config directory.
  15437. It no longer tries to create or access .idlerc or any files within. Users
  15438. must run IDLE to discover problems with saving settings.
  15439. - bpo-38077: IDLE no longer adds 'argv' to the user namespace when
  15440. initializing it. This bug only affected 3.7.4 and 3.8.0b2 to 3.8.0b4.
  15441. - bpo-38041: Shell restart lines now fill the window width, always start
  15442. with '=', and avoid wrapping unnecessarily. The line will still wrap if
  15443. the included file name is long relative to the width.
  15444. - bpo-35771: To avoid occasional spurious test_idle failures on slower
  15445. machines, increase the ``hover_delay`` in test_tooltip.
  15446. - bpo-37824: Properly handle user input warnings in IDLE shell. Cease
  15447. turning SyntaxWarnings into SyntaxErrors.
  15448. - bpo-37929: IDLE Settings dialog now closes properly when there is no shell
  15449. window.
  15450. - bpo-37902: Add mousewheel scrolling for IDLE module, path, and stack
  15451. browsers. Patch by George Zhang.
  15452. - bpo-37849: Fixed completions list appearing too high or low when shown
  15453. above the current line.
  15454. - bpo-36419: Refactor IDLE autocomplete and improve testing.
  15455. - bpo-37748: Reorder the Run menu. Put the most common choice, Run Module,
  15456. at the top.
  15457. - bpo-37692: Improve highlight config sample with example shell interaction
  15458. and better labels for shell elements.
  15459. - bpo-37628: Settings dialog no longer expands with font size.
  15460. - bpo-37627: Initialize the Customize Run dialog with the command line
  15461. arguments most recently entered before. The user can optionally edit
  15462. before submitting them.
  15463. - bpo-33610: Fix code context not showing the correct context when first
  15464. toggled on.
  15465. - bpo-37530: Optimize code context to reduce unneeded background activity.
  15466. Font and highlight changes now occur along with text changes instead of
  15467. after a random delay.
  15468. - bpo-27452: Cleanup ``config.py`` by inlining ``RemoveFile`` and
  15469. simplifying the handling of ``file`` in ``CreateConfigHandlers``.
  15470. - bpo-37325: Fix tab focus traversal order for help source and custom run
  15471. dialogs.
  15472. - bpo-37321: Both subprocess connection error messages now refer to the
  15473. 'Startup failure' section of the IDLE doc.
  15474. - bpo-17535: Add optional line numbers for IDLE editor windows. Windows
  15475. open without line numbers unless set otherwise in the General tab of the
  15476. configuration dialog.
  15477. - bpo-26806: To compensate for stack frames added by IDLE and avoid possible
  15478. problems with low recursion limits, add 30 to limits in the user code
  15479. execution process. Subtract 30 when reporting recursion limits to make
  15480. this addition mostly transparent.
  15481. - bpo-37177: Properly 'attach' search dialogs to their main window so that
  15482. they behave like other dialogs and do not get hidden behind their main
  15483. window.
  15484. - bpo-37039: Adjust "Zoom Height" to individual screens by momentarily
  15485. maximizing the window on first use with a particular screen. Changing
  15486. screen settings may invalidate the saved height. While a window is
  15487. maximized, "Zoom Height" has no effect.
  15488. - bpo-35763: Make calltip reminder about '/' meaning positional-only less
  15489. obtrusive by only adding it when there is room on the first line.
  15490. - bpo-5680: Add 'Run... Customized' to the Run menu to run a module with
  15491. customized settings. Any 'command line arguments' entered are added to
  15492. sys.argv. One can suppress the normal Shell main module restart.
  15493. - bpo-36390: Gather Format menu functions into format.py. Combine
  15494. paragraph.py, rstrip.py, and format methods from editor.py.
  15495. Tools/Demos
  15496. -----------
  15497. - bpo-38118: Update Valgrind suppression file to ignore a false alarm in
  15498. :c:func:`PyUnicode_Decode` when using GCC builtin strcmp().
  15499. - bpo-38347: pathfix.py: Assume all files that end on '.py' are Python
  15500. scripts when working recursively.
  15501. - bpo-37803: pdb's ``--help`` and ``--version`` long options now work.
  15502. - bpo-37942: Improve ArgumentClinic converter for floats.
  15503. - bpo-37704: Remove ``Tools/scripts/h2py.py``: use cffi to access a C API in
  15504. Python.
  15505. - bpo-37675: 2to3 now works when run from a zipped standard library.
  15506. - bpo-37034: Argument Clinic now uses the argument name on errors with
  15507. keyword-only argument instead of their position. Patch contributed by Rémi
  15508. Lapeyre.
  15509. - bpo-37064: Add option -k to pathscript.py script: preserve shebang flags.
  15510. Add option -a to pathscript.py script: add flags.
  15511. C API
  15512. -----
  15513. - bpo-37633: Re-export some function compatibility wrappers for macros in
  15514. ``pythonrun.h``.
  15515. - bpo-38644: Provide :c:func:`Py_EnterRecursiveCall` and
  15516. :c:func:`Py_LeaveRecursiveCall` as regular functions for the limited API.
  15517. Previously, there were defined as macros, but these macros didn't work
  15518. with the limited API which cannot access ``PyThreadState.recursion_depth``
  15519. field. Remove ``_Py_CheckRecursionLimit`` from the stable ABI.
  15520. - bpo-38650: The global variable :c:data:`PyStructSequence_UnnamedField` is
  15521. now a constant and refers to a constant string.
  15522. - bpo-38540: Fixed possible leak in :c:func:`PyArg_Parse` and similar
  15523. functions for format units ``"es#"`` and ``"et#"`` when the macro
  15524. :c:macro:`PY_SSIZE_T_CLEAN` is not defined.
  15525. - bpo-38395: Fix a crash in :class:`weakref.proxy` objects due to incorrect
  15526. lifetime management when calling some associated methods that may delete
  15527. the last reference to object being referenced by the proxy. Patch by Pablo
  15528. Galindo.
  15529. - bpo-36389: The ``_PyObject_CheckConsistency()`` function is now also
  15530. available in release mode. For example, it can be used to debug a crash in
  15531. the ``visit_decref()`` function of the GC.
  15532. - bpo-38266: Revert the removal of PyThreadState_DeleteCurrent() with
  15533. documentation.
  15534. - bpo-38303: Update audioop extension module to use the stable ABI
  15535. (PEP-384). Patch by Tyler Kieft.
  15536. - bpo-38234: :c:func:`!Py_SetPath` now sets :data:`sys.executable` to the
  15537. program full path (:c:func:`Py_GetProgramFullPath`) rather than to the
  15538. program name (:c:func:`Py_GetProgramName`).
  15539. - bpo-38234: Python ignored arguments passed to :c:func:`!Py_SetPath`,
  15540. :c:func:`!Py_SetPythonHome` and :c:func:`!Py_SetProgramName`: fix Python
  15541. initialization to use specified arguments.
  15542. - bpo-38205: The :c:func:`Py_UNREACHABLE` macro now calls
  15543. :c:func:`Py_FatalError`.
  15544. - bpo-38140: Make dict and weakref offsets opaque for C heap types by
  15545. passing the offsets through PyMemberDef
  15546. - bpo-15088: The C function ``PyGen_NeedsFinalizing`` has been removed. It
  15547. was not documented, tested or used anywhere within CPython after the
  15548. implementation of :pep:`442`. Patch by Joannah Nanjekye. (Patch by Joannah
  15549. Nanjekye)
  15550. - bpo-36763: Options added by ``PySys_AddXOption()`` are now handled the
  15551. same way than ``PyConfig.xoptions`` and command line ``-X`` options.
  15552. - bpo-37926: Fix a crash in ``PySys_SetArgvEx(0, NULL, 0)``.
  15553. - bpo-37879: Fix subtype_dealloc to suppress the type decref when the base
  15554. type is a C heap type
  15555. - bpo-37645: Add :c:func:`_PyObject_FunctionStr` to get a user-friendly
  15556. string representation of a function-like object. Patch by Jeroen Demeyer.
  15557. - bpo-29548: The functions ``PyEval_CallObject``, ``PyEval_CallFunction``,
  15558. ``PyEval_CallMethod`` and ``PyEval_CallObjectWithKeywords`` are
  15559. deprecated. Use :c:func:`PyObject_Call` and its variants instead.
  15560. - bpo-37151: ``PyCFunction_Call`` is now a deprecated alias of
  15561. :c:func:`PyObject_Call`.
  15562. - bpo-37540: The vectorcall protocol now requires that the caller passes
  15563. only strings as keyword names.
  15564. - bpo-37207: The vectorcall protocol is now enabled for ``type`` objects:
  15565. set ``tp_vectorcall`` to a vectorcall function to be used instead of
  15566. ``tp_new`` and ``tp_init`` when calling the class itself.
  15567. - bpo-21120: Exclude Python-ast.h, ast.h and asdl.h from the limited API.
  15568. - bpo-37483: Add new function ``_PyObject_CallOneArg`` for calling an object
  15569. with one positional argument.
  15570. - bpo-36763: Add :c:func:`PyConfig_SetWideStringList` function.
  15571. - bpo-37337: Add fast functions for calling methods:
  15572. :c:func:`_PyObject_VectorcallMethod`, :c:func:`_PyObject_CallMethodNoArgs`
  15573. and :c:func:`_PyObject_CallMethodOneArg`.
  15574. - bpo-28805: The :c:macro:`METH_FASTCALL` calling convention has been
  15575. documented.
  15576. - bpo-37221: The new function :c:func:`!PyCode_NewWithPosOnlyArgs` allows to
  15577. create code objects like :c:func:`!PyCode_New`, but with an extra
  15578. *posonlyargcount* parameter for indicating the number of positonal-only
  15579. arguments.
  15580. - bpo-37215: Fix dtrace issue introduce by bpo-36842
  15581. - bpo-37194: Add a new public :c:func:`PyObject_CallNoArgs` function to the
  15582. C API: call a callable Python object without any arguments. It is the most
  15583. efficient way to call a callback without any argument. On x86-64, for
  15584. example, ``PyObject_CallFunctionObjArgs(func, NULL)`` allocates 960 bytes
  15585. on the stack per call, whereas ``PyObject_CallNoArgs(func)`` only
  15586. allocates 624 bytes per call.
  15587. - bpo-37170: Fix the cast on error in
  15588. :c:func:`PyLong_AsUnsignedLongLongMask()`.
  15589. - bpo-35381: Convert posixmodule.c statically allocated types
  15590. ``DirEntryType`` and ``ScandirIteratorType`` to heap-allocated types.
  15591. - bpo-34331: Use singular/plural noun in error message when instantiating an
  15592. abstract class with non-overridden abstract method(s).
  15593. What's New in Python 3.8.0 beta 1?
  15594. ==================================
  15595. *Release date: 2019-06-04*
  15596. Security
  15597. --------
  15598. - bpo-35907: CVE-2019-9948: Avoid file reading by disallowing
  15599. ``local-file://`` and ``local_file://`` URL schemes in
  15600. ``URLopener().open()`` and ``URLopener().retrieve()`` of
  15601. :mod:`urllib.request`.
  15602. - bpo-33529: Prevent fold function used in email header encoding from
  15603. entering infinite loop when there are too many non-ASCII characters in a
  15604. header.
  15605. - bpo-33164: Updated blake2 implementation which uses secure memset
  15606. implementation provided by platform.
  15607. Core and Builtins
  15608. -----------------
  15609. - bpo-35814: Allow unpacking in the right hand side of annotated
  15610. assignments. In particular, ``t: Tuple[int, ...] = x, y, *z`` is now
  15611. allowed.
  15612. - bpo-37126: All structseq objects are now tracked by the garbage collector.
  15613. Patch by Pablo Galindo.
  15614. - bpo-37122: Make the *co_argcount* attribute of code objects represent the
  15615. total number of positional arguments (including positional-only
  15616. arguments). The value of *co_posonlyargcount* can be used to distinguish
  15617. which arguments are positional only, and the difference (*co_argcount* -
  15618. *co_posonlyargcount*) is the number of positional-or-keyword arguments.
  15619. Patch by Pablo Galindo.
  15620. - bpo-20092: Constructors of :class:`int`, :class:`float` and
  15621. :class:`complex` will now use the :meth:`~object.__index__` special
  15622. method, if available and the corresponding method :meth:`~object.__int__`,
  15623. :meth:`~object.__float__` or :meth:`~object.__complex__` is not available.
  15624. - bpo-37087: Add native thread ID (TID) support to OpenBSD.
  15625. - bpo-26219: Implemented per opcode cache mechanism and ``LOAD_GLOBAL``
  15626. instruction use it. ``LOAD_GLOBAL`` is now about 40% faster. Contributed
  15627. by Yury Selivanov, and Inada Naoki.
  15628. - bpo-37072: Fix crash in PyAST_FromNodeObject() when flags is NULL.
  15629. - bpo-37029: Freeing a great many small objects could take time quadratic in
  15630. the number of arenas, due to using linear search to keep ``obmalloc.c``'s
  15631. list of usable arenas sorted by order of number of free memory pools.
  15632. This is accomplished without search now, leaving the worst-case time
  15633. linear in the number of arenas. For programs where this quite visibly
  15634. matters (typically with more than 100 thousand small objects alive
  15635. simultaneously), this can greatly reduce the time needed to release their
  15636. memory.
  15637. - bpo-26423: Fix possible overflow in ``wrap_lenfunc()`` when ``sizeof(long)
  15638. < sizeof(Py_ssize_t)`` (e.g., 64-bit Windows).
  15639. - bpo-37050: Improve the AST for "debug" f-strings, which use '=' to print
  15640. out the source of the expression being evaluated. Delete expr_text from
  15641. the FormattedValue node, and instead use a Constant string node (possibly
  15642. merged with adjacent constant expressions inside the f-string).
  15643. - bpo-22385: The ``bytes.hex``, ``bytearray.hex``, and ``memoryview.hex``
  15644. methods as well as the ``binascii.hexlify`` and ``b2a_hex`` functions now
  15645. have the ability to include an optional separator between hex bytes. This
  15646. functionality was inspired by MicroPython's hexlify implementation.
  15647. - bpo-26836: Add :func:`os.memfd_create`.
  15648. - bpo-37032: Added new ``replace()`` method to the code type
  15649. (:class:`types.CodeType`).
  15650. - bpo-37007: Implement :func:`socket.if_nameindex()`,
  15651. :func:`socket.if_nametoindex()`, and :func:`socket.if_indextoname()` on
  15652. Windows.
  15653. - bpo-36829: :c:func:`PyErr_WriteUnraisable` now creates a traceback object
  15654. if there is no current traceback. Moreover, call
  15655. :c:func:`PyErr_NormalizeException` and :c:func:`PyException_SetTraceback`
  15656. to normalize the exception value. Ignore any error.
  15657. - bpo-36878: Only accept text after ``# type: ignore`` if the first
  15658. character is ASCII. This is to disallow things like ``# type: ignoreé``.
  15659. - bpo-36878: Store text appearing after a ``# type: ignore`` comment in the
  15660. AST. For example a type ignore like ``# type: ignore[E1000]`` will have
  15661. the string ``"[E1000]"`` stored in its AST node.
  15662. - bpo-2180: Treat line continuation at EOF as a ``SyntaxError`` by Anthony
  15663. Sottile.
  15664. - bpo-36907: Fix a crash when calling a C function with a keyword dict
  15665. (``f(**kwargs)``) and changing the dict ``kwargs`` while that function is
  15666. running.
  15667. - bpo-36946: Fix possible signed integer overflow when handling slices.
  15668. - bpo-36826: Add NamedExpression kind support to ast_unparse.c
  15669. - bpo-1875: A :exc:`SyntaxError` is now raised if a code blocks that will be
  15670. optimized away (e.g. if conditions that are always false) contains syntax
  15671. errors. Patch by Pablo Galindo.
  15672. - bpo-36027: Allow computation of modular inverses via three-argument
  15673. ``pow``: the second argument is now permitted to be negative in the case
  15674. where the first and third arguments are relatively prime.
  15675. - bpo-36861: Update the Unicode database to version 12.1.0.
  15676. - bpo-28866: Avoid caching attributes of classes which type defines mro() to
  15677. avoid a hard cache invalidation problem.
  15678. - bpo-36851: The ``FrameType`` stack is now correctly cleaned up if the
  15679. execution ends with a return and the stack is not empty.
  15680. - bpo-34616: The ``compile()`` builtin functions now support the
  15681. ``ast.PyCF_ALLOW_TOP_LEVEL_AWAIT`` flag, which allow to compile sources
  15682. that contains top-level ``await``, ``async with`` or ``async for``. This
  15683. is useful to evaluate async-code from with an already async functions; for
  15684. example in a custom REPL.
  15685. - bpo-36842: Implement PEP 578, adding sys.audit, io.open_code and related
  15686. APIs.
  15687. - bpo-27639: Correct return type for UserList slicing operations. Patch by
  15688. Michael Blahay, Erick Cervantes, and vaultah
  15689. - bpo-36737: Move PyRuntimeState.warnings into per-interpreter state (via
  15690. "module state").
  15691. - bpo-36793: Removed ``__str__`` implementations from builtin types
  15692. :class:`bool`, :class:`int`, :class:`float`, :class:`complex` and few
  15693. classes from the standard library. They now inherit ``__str__()`` from
  15694. :class:`object`.
  15695. - bpo-36817: Add a ``=`` feature f-strings for debugging. This can precede
  15696. ``!s``, ``!r``, or ``!a``. It produces the text of the expression,
  15697. followed by an equal sign, followed by the repr of the value of the
  15698. expression. So ``f'{3*9+15=}'`` would be equal to the string
  15699. ``'3*9+15=42'``. If ``=`` is specified, the default conversion is set to
  15700. ``!r``, unless a format spec is given, in which case the formatting
  15701. behavior is unchanged, and __format__ will be used.
  15702. - bpo-24048: Save the live exception during import.c's ``remove_module()``.
  15703. - bpo-27987: pymalloc returns memory blocks aligned by 16 bytes, instead of
  15704. 8 bytes, on 64-bit platforms to conform x86-64 ABI. Recent compilers
  15705. assume this alignment more often. Patch by Inada Naoki.
  15706. - bpo-36601: A long-since-meaningless check for ``getpid() == main_pid`` was
  15707. removed from Python's internal C signal handler.
  15708. - bpo-36594: Fix incorrect use of ``%p`` in format strings. Patch by Zackery
  15709. Spytz.
  15710. - bpo-36045: ``builtins.help()`` now prefixes ``async`` for async functions.
  15711. - bpo-36084: Add native thread ID (TID) to threading.Thread objects
  15712. (supported platforms: Windows, FreeBSD, Linux, macOS)
  15713. - bpo-36035: Added fix for broken symlinks in combination with pathlib
  15714. - bpo-35983: Added new trashcan macros to deal with a double deallocation
  15715. that could occur when the ``tp_dealloc`` of a subclass calls the
  15716. ``tp_dealloc`` of a base class and that base class uses the trashcan
  15717. mechanism. Patch by Jeroen Demeyer.
  15718. - bpo-20602: Do not clear :data:`sys.flags` and :data:`sys.float_info`
  15719. during shutdown. Patch by Zackery Spytz.
  15720. - bpo-26826: Expose :func:`copy_file_range` as a low level API in the
  15721. :mod:`os` module.
  15722. - bpo-32388: Remove cross-version binary compatibility requirement in
  15723. tp_flags.
  15724. - bpo-31862: Port binascii to PEP 489 multiphase initialization. Patch by
  15725. Marcel Plch.
  15726. Library
  15727. -------
  15728. - bpo-37128: Added :func:`math.perm`.
  15729. - bpo-37120: Add SSLContext.num_tickets to control the number of TLSv1.3
  15730. session tickets.
  15731. - bpo-12202: Fix the error handling in
  15732. :meth:`msilib.SummaryInformation.GetProperty`. Patch by Zackery Spytz.
  15733. - bpo-26835: The fcntl module now contains file sealing constants for
  15734. sealing of memfds.
  15735. - bpo-29262: Add ``get_origin()`` and ``get_args()`` introspection helpers
  15736. to ``typing`` module.
  15737. - bpo-12639: :meth:`msilib.Directory.start_component()` no longer fails if
  15738. *keyfile* is not ``None``.
  15739. - bpo-36999: Add the ``asyncio.Task.get_coro()`` method to publicly expose
  15740. the tasks's coroutine object.
  15741. - bpo-35246: Make :func:`asyncio.create_subprocess_exec` accept path-like
  15742. arguments.
  15743. - bpo-35279: Change default *max_workers* of ``ThreadPoolExecutor`` from
  15744. ``cpu_count() * 5`` to ``min(32, cpu_count() + 4)``. Previous value was
  15745. unreasonably large on many cores machines.
  15746. - bpo-37076: :func:`_thread.start_new_thread` now logs uncaught exception
  15747. raised by the function using :func:`sys.unraisablehook`, rather than
  15748. :func:`sys.excepthook`, so the hook gets access to the function which
  15749. raised the exception.
  15750. - bpo-33725: On macOS, the :mod:`multiprocessing` module now uses *spawn*
  15751. start method by default.
  15752. - bpo-37054: Fix destructor :class:`_pyio.BytesIO` and
  15753. :class:`_pyio.TextIOWrapper`: initialize their ``_buffer`` attribute as
  15754. soon as possible (in the class body), because it's used by ``__del__()``
  15755. which calls ``close()``.
  15756. - bpo-37058: PEP 544: Add ``Protocol`` and ``@runtime_checkable`` to the
  15757. ``typing`` module.
  15758. - bpo-36933: The functions ``sys.set_coroutine_wrapper`` and
  15759. ``sys.get_coroutine_wrapper`` that were deprecated and marked for removal
  15760. in 3.8 have been removed.
  15761. - bpo-37047: Handle late binding and attribute access in
  15762. :class:`unittest.mock.AsyncMock` setup for autospeccing. Document newly
  15763. implemented async methods in :class:`unittest.mock.MagicMock`.
  15764. - bpo-37049: PEP 589: Add ``TypedDict`` to the ``typing`` module.
  15765. - bpo-37046: PEP 586: Add ``Literal`` to the ``typing`` module.
  15766. - bpo-37045: PEP 591: Add ``Final`` qualifier and ``@final`` decorator to
  15767. the ``typing`` module.
  15768. - bpo-37035: Don't log OSError based exceptions if a fatal error has
  15769. occurred in asyncio transport. Peer can generate almost any OSError, user
  15770. cannot avoid these exceptions by fixing own code. Errors are still
  15771. propagated to user code, it's just logging them is pointless and pollute
  15772. asyncio logs.
  15773. - bpo-37001: :func:`symtable.symtable` now accepts the same input types for
  15774. source code as the built-in :func:`compile` function. Patch by Dino
  15775. Viehland.
  15776. - bpo-37028: Implement asyncio REPL
  15777. - bpo-37027: Return safe to use proxy socket object from
  15778. transport.get_extra_info('socket')
  15779. - bpo-32528: Make asyncio.CancelledError a BaseException.
  15780. This will address the common mistake many asyncio users make: an "except
  15781. Exception" clause breaking Tasks cancellation.
  15782. In addition to this change, we stop inheriting asyncio.TimeoutError and
  15783. asyncio.InvalidStateError from their concurrent.futures.* counterparts.
  15784. There's no point for these exceptions to share the inheritance chain.
  15785. - bpo-1230540: Add a new :func:`threading.excepthook` function which handles
  15786. uncaught :meth:`threading.Thread.run` exception. It can be overridden to
  15787. control how uncaught :meth:`threading.Thread.run` exceptions are handled.
  15788. - bpo-36996: Handle :func:`unittest.mock.patch` used as a decorator on async
  15789. functions.
  15790. - bpo-37008: Add support for calling :func:`next` with the mock resulting
  15791. from :func:`unittest.mock.mock_open`
  15792. - bpo-27737: Allow whitespace only header encoding in ``email.header`` - by
  15793. Batuhan Taskaya
  15794. - bpo-36969: PDB command ``args`` now display positional only arguments.
  15795. Patch contributed by Rémi Lapeyre.
  15796. - bpo-36969: PDB command ``args`` now display keyword only arguments. Patch
  15797. contributed by Rémi Lapeyre.
  15798. - bpo-36983: Add missing names to ``typing.__all__``: ``ChainMap``,
  15799. ``ForwardRef``, ``OrderedDict`` - by Anthony Sottile.
  15800. - bpo-36972: Add SupportsIndex protocol to the typing module to allow type
  15801. checking to detect classes that can be passed to ``hex()``, ``oct()`` and
  15802. ``bin()``.
  15803. - bpo-32972: Implement ``unittest.IsolatedAsyncioTestCase`` to help testing
  15804. asyncio-based code.
  15805. - bpo-36952: :func:`fileinput.input` and :class:`fileinput.FileInput`
  15806. **bufsize** argument has been removed (was deprecated and ignored since
  15807. Python 3.6), and as a result the **mode** and **openhook** arguments have
  15808. been made keyword-only.
  15809. - bpo-36952: Starting with Python 3.3, importing ABCs from
  15810. :mod:`collections` is deprecated, and import should be done from
  15811. :mod:`collections.abc`. Still being able to import from :mod:`collections`
  15812. was marked for removal in 3.8, but has been delayed to 3.9; documentation
  15813. and ``DeprecationWarning`` clarified.
  15814. - bpo-36949: Implement __repr__ for WeakSet objects.
  15815. - bpo-36948: Fix :exc:`NameError` in
  15816. :meth:`urllib.request.URLopener.retrieve`. Patch by Karthikeyan
  15817. Singaravelan.
  15818. - bpo-33524: Fix the folding of email header when the max_line_length is 0
  15819. or None and the header contains non-ascii characters. Contributed by
  15820. Licht Takeuchi (@Licht-T).
  15821. - bpo-24564: :func:`shutil.copystat` now ignores :const:`errno.EINVAL` on
  15822. :func:`os.setxattr` which may occur when copying files on filesystems
  15823. without extended attributes support.
  15824. Original patch by Giampaolo Rodola, updated by Ying Wang.
  15825. - bpo-36888: Python child processes can now access the status of their
  15826. parent process using multiprocessing.process.parent_process
  15827. - bpo-36921: Deprecate ``@coroutine`` for sake of ``async def``.
  15828. - bpo-25652: Fix bug in ``__rmod__`` of ``UserString`` - by Batuhan Taskaya.
  15829. - bpo-36916: Remove a message about an unhandled exception in a task when
  15830. writer.write() is used without await and writer.drain() fails with an
  15831. exception.
  15832. - bpo-36889: Introduce :class:`asyncio.Stream` class that merges
  15833. :class:`asyncio.StreamReader` and :class:`asyncio.StreamWriter`
  15834. functionality. :class:`asyncio.Stream` can work in readonly, writeonly and
  15835. readwrite modes. Provide :func:`asyncio.connect`,
  15836. :func:`asyncio.connect_unix`, :func:`asyncio.connect_read_pipe` and
  15837. :func:`asyncio.connect_write_pipe` factories to open
  15838. :class:`asyncio.Stream` connections. Provide :class:`asyncio.StreamServer`
  15839. and :class:`UnixStreamServer` to serve servers with asyncio.Stream API.
  15840. Modify :func:`asyncio.create_subprocess_shell` and
  15841. :func:`asyncio.create_subprocess_exec` to use :class:`asyncio.Stream`
  15842. instead of deprecated :class:`StreamReader` and :class:`StreamWriter`.
  15843. Deprecate :class:`asyncio.StreamReader` and :class:`asyncio.StreamWriter`.
  15844. Deprecate usage of private classes, e.g.
  15845. :class:`asyncio.FlowControlMixing` and
  15846. :class:`asyncio.StreamReaderProtocol` outside of asyncio package.
  15847. - bpo-36845: Added validation of integer prefixes to the construction of IP
  15848. networks and interfaces in the ipaddress module.
  15849. - bpo-23378: Add an extend action to argparser.
  15850. - bpo-36867: Fix a bug making a SharedMemoryManager instance and its parent
  15851. process use two separate resource_tracker processes.
  15852. - bpo-23896: Adds a grammar to lib2to3.pygram that contains exec as a
  15853. function not as statement.
  15854. - bpo-36895: The function ``time.clock()`` was deprecated in 3.3 in favor of
  15855. ``time.perf_counter()`` and marked for removal in 3.8, it has removed.
  15856. - bpo-35545: Fix asyncio discarding IPv6 scopes when ensuring hostname
  15857. resolutions internally
  15858. - bpo-36887: Add new function :func:`math.isqrt` to compute integer square
  15859. roots.
  15860. - bpo-34632: Introduce the ``importlib.metadata`` module with (provisional)
  15861. support for reading metadata from third-party packages.
  15862. - bpo-36878: When using ``type_comments=True`` in ``ast.parse``, treat ``#
  15863. type: ignore`` followed by a non-alphanumeric character and then arbitrary
  15864. text as a type ignore, instead of requiring nothing but whitespace or
  15865. another comment. This is to permit formations such as ``# type:
  15866. ignore[E1000]``.
  15867. - bpo-36778: ``cp65001`` encoding (Windows code page 65001) becomes an alias
  15868. to ``utf_8`` encoding.
  15869. - bpo-36867: The multiprocessing.resource_tracker replaces the
  15870. multiprocessing.semaphore_tracker module. Other than semaphores,
  15871. resource_tracker also tracks shared_memory segments.
  15872. - bpo-30262: The ``Cache`` and ``Statement`` objects of the :mod:`sqlite3`
  15873. module are not exposed to the user. Patch by Aviv Palivoda.
  15874. - bpo-24538: In ``shutil.copystat()``, first copy extended file attributes
  15875. and then file permissions, since extended attributes can only be set on
  15876. the destination while it is still writeable.
  15877. - bpo-36829: Add new :func:`sys.unraisablehook` function which can be
  15878. overridden to control how "unraisable exceptions" are handled. It is
  15879. called when an exception has occurred but there is no way for Python to
  15880. handle it. For example, when a destructor raises an exception or during
  15881. garbage collection (:func:`gc.collect`).
  15882. - bpo-36832: Introducing ``zipfile.Path``, a pathlib-compatible wrapper for
  15883. traversing zip files.
  15884. - bpo-36814: Fix an issue where os.posix_spawnp() would incorrectly raise a
  15885. TypeError when file_actions is None.
  15886. - bpo-33110: Handle exceptions raised by functions added by
  15887. concurrent.futures add_done_callback correctly when the Future has already
  15888. completed.
  15889. - bpo-26903: Limit ``max_workers`` in ``ProcessPoolExecutor`` to 61 to work
  15890. around a WaitForMultipleObjects limitation.
  15891. - bpo-36813: Fix :class:`~logging.handlers.QueueListener` to call
  15892. ``queue.task_done()`` upon stopping. Patch by Bar Harel.
  15893. - bpo-36806: Forbid creation of asyncio stream objects like StreamReader,
  15894. StreamWriter, Process, and their protocols outside of asyncio package.
  15895. - bpo-36802: Provide both sync and async calls for StreamWriter.write() and
  15896. StreamWriter.close()
  15897. - bpo-36801: Properly handle SSL connection closing in asyncio
  15898. StreamWriter.drain() call.
  15899. - bpo-36785: Implement PEP 574 (pickle protocol 5 with out-of-band buffers).
  15900. - bpo-36772: functools.lru_cache() can now be used as a straight decorator
  15901. in addition to its existing usage as a function that returns a decorator.
  15902. - bpo-6584: Add a :exc:`~gzip.BadGzipFile` exception to the :mod:`gzip`
  15903. module.
  15904. - bpo-36748: Optimized write buffering in C implementation of
  15905. ``TextIOWrapper``. Writing ASCII string to ``TextIOWrapper`` with ascii,
  15906. latin1, or utf-8 encoding is about 20% faster. Patch by Inada Naoki.
  15907. - bpo-8138: Don't mark ``wsgiref.simple_server.SimpleServer`` as
  15908. multi-threaded since ``wsgiref.simple_server.WSGIServer`` is
  15909. single-threaded.
  15910. - bpo-22640: :func:`py_compile.compile` now supports silent mode. Patch by
  15911. Joannah Nanjekye
  15912. - bpo-29183: Fix double exceptions in :class:`wsgiref.handlers.BaseHandler`
  15913. by calling its :meth:`~wsgiref.handlers.BaseHandler.close` method only
  15914. when no exception is raised.
  15915. - bpo-36548: Improved the repr of regular expression flags.
  15916. - bpo-36542: The signature of Python functions can now be overridden by
  15917. specifying the ``__text_signature__`` attribute.
  15918. - bpo-36533: Reinitialize logging.Handler locks in forked child processes
  15919. instead of attempting to acquire them all in the parent before forking
  15920. only to be released in the child process. The acquire/release pattern was
  15921. leading to deadlocks in code that has implemented any form of chained
  15922. logging handlers that depend upon one another as the lock acquisition
  15923. order cannot be guaranteed.
  15924. - bpo-35252: Throw a TypeError instead of an AssertionError when using an
  15925. invalid type annotation with singledispatch.
  15926. - bpo-35900: Allow reduction methods to return a 6-item tuple where the 6th
  15927. item specifies a custom state-setting method that's called instead of the
  15928. regular ``__setstate__`` method.
  15929. - bpo-35900: enable custom reduction callback registration for functions and
  15930. classes in _pickle.c, using the new Pickler's attribute
  15931. ``reducer_override``
  15932. - bpo-36368: Fix a bug crashing SharedMemoryManager instances in interactive
  15933. sessions after a ctrl-c (KeyboardInterrupt) was sent
  15934. - bpo-31904: Fix mmap fail for VxWorks
  15935. - bpo-27497: :meth:`csv.DictWriter.writeheader` now returns the return value
  15936. of the underlying :meth:`csv.Writer.writerow` method. Patch contributed by
  15937. Ashish Nitin Patil.
  15938. - bpo-36239: Parsing .mo files now ignores comments starting and ending with
  15939. #-#-#-#-#.
  15940. - bpo-26707: Enable plistlib to read and write binary plist files that were
  15941. created as a KeyedArchive file. Specifically, this allows the plistlib to
  15942. process 0x80 tokens as UID objects.
  15943. - bpo-31904: Add posix module support for VxWorks.
  15944. - bpo-35125: Asyncio: Remove inner callback on outer cancellation in shield
  15945. - bpo-35721: Fix :meth:`asyncio.SelectorEventLoop.subprocess_exec()` leaks
  15946. file descriptors if ``Popen`` fails and called with
  15947. ``stdin=subprocess.PIPE``. Patch by Niklas Fiekas.
  15948. - bpo-31855: :func:`unittest.mock.mock_open` results now respects the
  15949. argument of read([size]). Patch contributed by Rémi Lapeyre.
  15950. - bpo-35431: Implement :func:`math.comb` that returns binomial coefficient,
  15951. that computes the number of ways to choose k items from n items without
  15952. repetition and without order. Patch by Yash Aggarwal and Keller Fuchs.
  15953. - bpo-26660: Fixed permission errors in
  15954. :class:`~tempfile.TemporaryDirectory` clean up. Previously
  15955. ``TemporaryDirectory.cleanup()`` failed when non-writeable or
  15956. non-searchable files or directories were created inside a temporary
  15957. directory.
  15958. - bpo-34271: Add debugging helpers to ssl module. It's now possible to dump
  15959. key material and to trace TLS protocol. The default and stdlib contexts
  15960. also support SSLKEYLOGFILE env var.
  15961. - bpo-26467: Added AsyncMock to support using unittest to mock asyncio
  15962. coroutines. Patch by Lisa Roach.
  15963. - bpo-33569: dataclasses.InitVar: Exposes the type used to create the init
  15964. var.
  15965. - bpo-34424: Fix serialization of messages containing encoded strings when
  15966. the policy.linesep is set to a multi-character string. Patch by Jens
  15967. Troeger.
  15968. - bpo-34303: Performance of :func:`functools.reduce` is slightly improved.
  15969. Patch by Sergey Fedoseev.
  15970. - bpo-33361: Fix a bug in :class:`codecs.StreamRecoder` where seeking might
  15971. leave old data in a buffer and break subsequent read calls. Patch by Ammar
  15972. Askar.
  15973. - bpo-22454: The :mod:`shlex` module now exposes :func:`shlex.join`, the
  15974. inverse of :func:`shlex.split`. Patch by Bo Bayles.
  15975. - bpo-31922: :meth:`asyncio.AbstractEventLoop.create_datagram_endpoint`: Do
  15976. not connect UDP socket when broadcast is allowed. This allows to receive
  15977. replies after a UDP broadcast.
  15978. - bpo-24882: Change ThreadPoolExecutor to use existing idle threads before
  15979. spinning up new ones.
  15980. - bpo-31961: Added support for bytes and path-like objects in
  15981. :func:`subprocess.Popen` on Windows. The *args* parameter now accepts a
  15982. :term:`path-like object` if *shell* is ``False`` and a sequence containing
  15983. bytes and path-like objects. The *executable* parameter now accepts a
  15984. bytes and :term:`path-like object`. The *cwd* parameter now accepts a
  15985. bytes object. Based on patch by Anders Lorentsen.
  15986. - bpo-33123: :class:`pathlib.Path.unlink` now accepts a *missing_ok*
  15987. parameter to avoid a :exc:`FileNotFoundError` from being raised. Patch by
  15988. Robert Buchholz.
  15989. - bpo-32941: Allow :class:`mmap.mmap` objects to access the madvise() system
  15990. call (through :meth:`mmap.mmap.madvise`).
  15991. - bpo-22102: Added support for ZIP files with disks set to 0. Such files are
  15992. commonly created by builtin tools on Windows when use ZIP64 extension.
  15993. Patch by Francisco Facioni.
  15994. - bpo-32515: trace.py can now run modules via python3 -m trace -t --module
  15995. module_name
  15996. - bpo-32299: Changed :func:`unittest.mock.patch.dict` to return the patched
  15997. dictionary when used as context manager. Patch by Vadim Tsander.
  15998. - bpo-27141: Added a ``__copy__()`` to ``collections.UserList`` and
  15999. ``collections.UserDict`` in order to correctly implement shallow copying
  16000. of the objects. Patch by Bar Harel.
  16001. - bpo-31829: ``\r``, ``\0`` and ``\x1a`` (end-of-file on Windows) are now
  16002. escaped in protocol 0 pickles of Unicode strings. This allows to load them
  16003. without loss from files open in text mode in Python 2.
  16004. - bpo-23395: ``_thread.interrupt_main()`` now avoids setting the Python
  16005. error status if the ``SIGINT`` signal is ignored or not handled by Python.
  16006. Documentation
  16007. -------------
  16008. - bpo-36896: Clarify that some types have unstable constructor signature
  16009. between Python versions.
  16010. - bpo-36686: Improve documentation of the stdin, stdout, and stderr
  16011. arguments of the ``asyncio.subprocess_exec`` function to specify which
  16012. values are supported. Also mention that decoding as text is not supported.
  16013. Add a few tests to verify that the various values passed to the std*
  16014. arguments actually work.
  16015. - bpo-36984: Improve version added references in ``typing`` module - by
  16016. Anthony Sottile.
  16017. - bpo-36868: What's new now mentions SSLContext.hostname_checks_common_name
  16018. instead of SSLContext.host_flags.
  16019. - bpo-35924: Add a note to the ``curses.addstr()`` documentation to warn
  16020. that multiline strings can cause segfaults because of an ncurses bug.
  16021. - bpo-36783: Added C API Documentation for Time_FromTimeAndFold and
  16022. PyDateTime_FromDateAndTimeAndFold as per PEP 495. Patch by Edison
  16023. Abahurire.
  16024. - bpo-36797: More of the legacy distutils documentation has been either
  16025. pruned, or else more clearly marked as being retained solely until the
  16026. setuptools documentation covers it independently.
  16027. - bpo-22865: Add detail to the documentation on the ``pty.spawn`` function.
  16028. - bpo-35397: Remove deprecation and document urllib.parse.unwrap(). Patch
  16029. contributed by Rémi Lapeyre.
  16030. - bpo-32995: Added the context variable in glossary.
  16031. - bpo-33519: Clarify that ``copy()`` is not part of the ``MutableSequence``
  16032. ABC.
  16033. - bpo-33482: Make ``codecs.StreamRecoder.writelines`` take a list of bytes.
  16034. - bpo-25735: Added documentation for func factorial to indicate that returns
  16035. integer values
  16036. - bpo-20285: Expand object.__doc__ (docstring) to make it clearer. Modify
  16037. pydoc.py so that help(object) lists object methods (for other classes,
  16038. help omits methods of the object base class.)
  16039. Tests
  16040. -----
  16041. - bpo-37069: Modify test_coroutines, test_cprofile, test_generators,
  16042. test_raise, test_ssl and test_yield_from to use
  16043. :func:`test.support.catch_unraisable_exception` rather than
  16044. :func:`test.support.captured_stderr`.
  16045. - bpo-37098: Fix test_memfd_create on older Linux Kernels.
  16046. - bpo-37081: Test with OpenSSL 1.1.1c
  16047. - bpo-36829: Add :func:`test.support.catch_unraisable_exception`: context
  16048. manager catching unraisable exception using :func:`sys.unraisablehook`.
  16049. - bpo-36915: The main regrtest process now always removes all temporary
  16050. directories of worker processes even if they crash or if they are killed
  16051. on KeyboardInterrupt (CTRL+c).
  16052. - bpo-36719: "python3 -m test -jN ..." now continues the execution of next
  16053. tests when a worker process crash (CHILD_ERROR state). Previously, the
  16054. test suite stopped immediately. Use --failfast to stop at the first error.
  16055. - bpo-36816: Update Lib/test/selfsigned_pythontestdotnet.pem to match
  16056. self-signed.pythontest.net's new TLS certificate.
  16057. - bpo-35925: Skip httplib and nntplib networking tests when they would
  16058. otherwise fail due to a modern OS or distro with a default OpenSSL policy
  16059. of rejecting connections to servers with weak certificates.
  16060. - bpo-36782: Add tests for several C API functions in the :mod:`datetime`
  16061. module. Patch by Edison Abahurire.
  16062. - bpo-36342: Fix test_multiprocessing in test_venv if platform lacks
  16063. functioning sem_open.
  16064. Build
  16065. -----
  16066. - bpo-36721: To embed Python into an application, a new ``--embed`` option
  16067. must be passed to ``python3-config --libs --embed`` to get ``-lpython3.8``
  16068. (link the application to libpython). To support both 3.8 and older, try
  16069. ``python3-config --libs --embed`` first and fallback to ``python3-config
  16070. --libs`` (without ``--embed``) if the previous command fails.
  16071. Add a pkg-config ``python-3.8-embed`` module to embed Python into an
  16072. application: ``pkg-config python-3.8-embed --libs`` includes
  16073. ``-lpython3.8``. To support both 3.8 and older, try ``pkg-config
  16074. python-X.Y-embed --libs`` first and fallback to ``pkg-config python-X.Y
  16075. --libs`` (without ``--embed``) if the previous command fails (replace
  16076. ``X.Y`` with the Python version).
  16077. On the other hand, ``pkg-config python3.8 --libs`` no longer contains
  16078. ``-lpython3.8``. C extensions must not be linked to libpython (except on
  16079. Android, case handled by the script); this change is backward incompatible
  16080. on purpose.
  16081. - bpo-36786: "make install" now runs compileall in parallel.
  16082. Windows
  16083. -------
  16084. - bpo-36965: include of STATUS_CONTROL_C_EXIT without depending on MSC
  16085. compiler
  16086. - bpo-35926: Update to OpenSSL 1.1.1b for Windows.
  16087. - bpo-29883: Add Windows support for UDP transports for the Proactor Event
  16088. Loop. Patch by Adam Meily.
  16089. - bpo-33407: The :c:macro:`Py_DEPRECATED()` macro has been implemented for
  16090. MSVC.
  16091. macOS
  16092. -----
  16093. - bpo-36231: Support building Python on macOS without /usr/include
  16094. installed. As of macOS 10.14, system header files are only available
  16095. within an SDK provided by either the Command Line Tools or the Xcode app.
  16096. IDLE
  16097. ----
  16098. - bpo-35610: Replace now redundant .context_use_ps1 with .prompt_last_line.
  16099. This finishes change started in bpo-31858.
  16100. - bpo-37038: Make idlelib.run runnable; add test clause.
  16101. - bpo-36958: Print any argument other than None or int passed to SystemExit
  16102. or sys.exit().
  16103. - bpo-36807: When saving a file, call os.fsync() so bits are flushed to e.g.
  16104. USB drive.
  16105. - bpo-32411: In browser.py, remove extraneous sorting by line number since
  16106. dictionary was created in line number order.
  16107. Tools/Demos
  16108. -----------
  16109. - bpo-37053: Handle strings like u"bar" correctly in
  16110. Tools/parser/unparse.py. Patch by Chih-Hsuan Yen.
  16111. C API
  16112. -----
  16113. - bpo-36763: Implement the :pep:`587` "Python Initialization Configuration".
  16114. - bpo-36379: Fix crashes when attempting to use the *modulo* parameter when
  16115. ``__ipow__`` is implemented in C.
  16116. - bpo-37107: Update :c:func:`PyObject_CallMethodObjArgs` and
  16117. ``_PyObject_CallMethodIdObjArgs`` to use ``_PyObject_GetMethod`` to avoid
  16118. creating a bound method object in many cases. Patch by Michael J.
  16119. Sullivan.
  16120. - bpo-36974: Implement :pep:`590`: Vectorcall: a fast calling protocol for
  16121. CPython. This is a new protocol to optimize calls of custom callable
  16122. objects.
  16123. - bpo-36763: ``Py_Main()`` now returns the exitcode rather than calling
  16124. ``Py_Exit(exitcode)`` when calling ``PyErr_Print()`` if the current
  16125. exception type is ``SystemExit``.
  16126. - bpo-36922: Add new type flag ``Py_TPFLAGS_METHOD_DESCRIPTOR`` for objects
  16127. behaving like unbound methods. These are objects supporting the
  16128. optimization given by the ``LOAD_METHOD``/``CALL_METHOD`` opcodes. See PEP
  16129. 590.
  16130. - bpo-36728: The :c:func:`!PyEval_ReInitThreads` function has been removed
  16131. from the C API. It should not be called explicitly: use
  16132. :c:func:`PyOS_AfterFork_Child` instead.
  16133. What's New in Python 3.8.0 alpha 4?
  16134. ===================================
  16135. *Release date: 2019-05-06*
  16136. Security
  16137. --------
  16138. - bpo-36742: Fixes mishandling of pre-normalization characters in
  16139. urlsplit().
  16140. - bpo-30458: Address CVE-2019-9740 by disallowing URL paths with embedded
  16141. whitespace or control characters through into the underlying http client
  16142. request. Such potentially malicious header injection URLs now cause an
  16143. http.client.InvalidURL exception to be raised.
  16144. - bpo-35755: :func:`shutil.which` now uses ``os.confstr("CS_PATH")`` if
  16145. available and if the :envvar:`PATH` environment variable is not set.
  16146. Remove also the current directory from :data:`posixpath.defpath`. On Unix,
  16147. :func:`shutil.which` and the :mod:`subprocess` module no longer search the
  16148. executable in the current directory if the :envvar:`PATH` environment
  16149. variable is not set.
  16150. Core and Builtins
  16151. -----------------
  16152. - bpo-36722: In debug build, import now also looks for C extensions compiled
  16153. in release mode and for C extensions compiled in the stable ABI.
  16154. - bpo-32849: Fix Python Initialization code on FreeBSD to detect properly
  16155. when stdin file descriptor (fd 0) is invalid.
  16156. - bpo-36623: Remove parser headers and related function declarations that
  16157. lack implementations after the removal of pgen.
  16158. - bpo-20180: ``dict.pop()`` is now up to 33% faster thanks to Argument
  16159. Clinic. Patch by Inada Naoki.
  16160. - bpo-36611: Debug memory allocators: disable serialno field by default from
  16161. debug hooks on Python memory allocators to reduce the memory footprint by
  16162. 5%. Enable :mod:`tracemalloc` to get the traceback where a memory block
  16163. has been allocated when a fatal memory error is logged to decide where to
  16164. put a breakpoint. Compile Python with ``PYMEM_DEBUG_SERIALNO`` defined to
  16165. get back the field.
  16166. - bpo-36588: On AIX, :data:`sys.platform` doesn't contain the major version
  16167. anymore. Always return ``'aix'``, instead of ``'aix3'`` .. ``'aix7'``.
  16168. Since older Python versions include the version number, it is recommended
  16169. to always use ``sys.platform.startswith('aix')``. Contributed by M. Felt.
  16170. - bpo-36549: Change str.capitalize to use titlecase for the first character
  16171. instead of uppercase.
  16172. - bpo-36540: Implement :pep:`570` (Python positional-only parameters). Patch
  16173. by Pablo Galindo.
  16174. - bpo-36475: :c:func:`!PyEval_AcquireLock` and
  16175. :c:func:`!PyEval_AcquireThread` now terminate the current thread if called
  16176. while the interpreter is finalizing, making them consistent with
  16177. :c:func:`PyEval_RestoreThread`, :c:func:`Py_END_ALLOW_THREADS`, and
  16178. :c:func:`PyGILState_Ensure`.
  16179. - bpo-36504: Fix signed integer overflow in _ctypes.c's
  16180. ``PyCArrayType_new()``.
  16181. - bpo-20844: Fix running script with encoding cookie and LF line ending may
  16182. fail on Windows.
  16183. - bpo-24214: Fixed support of the surrogatepass error handler in the UTF-8
  16184. incremental decoder.
  16185. - bpo-36452: Changing ``dict`` keys during iteration of the dict itself,
  16186. ``keys()``, ``values()``, or ``items()`` will now be detected in certain
  16187. corner cases where keys are deleted/added so that the number of keys isn't
  16188. changed. A ``RuntimeError`` will be raised after ``len(dict)`` iterations.
  16189. Contributed by Thomas Perl.
  16190. - bpo-36459: Fix a possible double ``PyMem_FREE()`` due to tokenizer.c's
  16191. ``tok_nextc()``.
  16192. - bpo-36433: Fixed TypeError message in classmethoddescr_call.
  16193. - bpo-36430: Fix a possible reference leak in :func:`itertools.count`.
  16194. - bpo-36440: Include node names in ``ParserError`` messages, instead of
  16195. numeric IDs. Patch by A. Skrobov.
  16196. - bpo-36143: Regenerate :mod:`keyword` from the Grammar and Tokens file
  16197. using pgen. Patch by Pablo Galindo.
  16198. - bpo-18372: Add missing :c:func:`PyObject_GC_Track` calls in the
  16199. :mod:`pickle` module. Patch by Zackery Spytz.
  16200. Library
  16201. -------
  16202. - bpo-35952: Fix pythoninfo when the compiler is missing.
  16203. - bpo-28238: The ``.find*()`` methods of xml.etree.ElementTree can now
  16204. search for wildcards like ``{*}tag`` and ``{ns}*`` that match a tag in any
  16205. namespace or all tags in a namespace. Patch by Stefan Behnel.
  16206. - bpo-26978: ``pathlib.path.link_to()`` is now implemented. It creates a
  16207. hard link pointing to a path.
  16208. - bpo-1613500: :class:`fileinput.FileInput` now uses the input file mode to
  16209. correctly set the output file mode (previously it was hardcoded to
  16210. ``'w'``) when ``inplace=True`` is passed to its constructor.
  16211. - bpo-36734: Fix compilation of ``faulthandler.c`` on HP-UX. Initialize
  16212. ``stack_t current_stack`` to zero using ``memset()``.
  16213. - bpo-13611: The xml.etree.ElementTree packages gained support for C14N 2.0
  16214. serialisation. Patch by Stefan Behnel.
  16215. - bpo-36669: Add missing matrix multiplication operator support to
  16216. weakref.proxy.
  16217. - bpo-36676: The XMLParser() in xml.etree.ElementTree provides namespace
  16218. prefix context to the parser target if it defines the callback methods
  16219. "start_ns()" and/or "end_ns()". Patch by Stefan Behnel.
  16220. - bpo-36673: The TreeBuilder and XMLPullParser in xml.etree.ElementTree
  16221. gained support for parsing comments and processing instructions. Patch by
  16222. Stefan Behnel.
  16223. - bpo-36650: The C version of functools.lru_cache() was treating calls with
  16224. an empty ``**kwargs`` dictionary as being distinct from calls with no
  16225. keywords at all. This did not result in an incorrect answer, but it did
  16226. trigger an unexpected cache miss.
  16227. - bpo-28552: Fix ``distutils.sysconfig`` if :data:`sys.executable` is
  16228. ``None`` or an empty string: use :func:`os.getcwd` to initialize
  16229. ``project_base``. Fix also the distutils build command: don't use
  16230. :data:`sys.executable` if it is ``None`` or an empty string.
  16231. - bpo-35755: :func:`shutil.which` and ``distutils.spawn.find_executable``
  16232. now use ``os.confstr("CS_PATH")`` if available instead of
  16233. :data:`os.defpath`, if the ``PATH`` environment variable is not set.
  16234. Moreover, don't use ``os.confstr("CS_PATH")`` nor :data:`os.defpath` if
  16235. the ``PATH`` environment variable is set to an empty string.
  16236. - bpo-25430: improve performance of ``IPNetwork.__contains__()``
  16237. - bpo-30485: Path expressions in xml.etree.ElementTree can now avoid
  16238. explicit namespace prefixes for tags (or the "{namespace}tag" notation) by
  16239. passing a default namespace with an empty string prefix.
  16240. - bpo-36613: Fix :mod:`asyncio` wait() not removing callback if exception
  16241. - bpo-36598: Fix ``isinstance`` check for Mock objects with spec when the
  16242. code is executed under tracing. Patch by Karthikeyan Singaravelan.
  16243. - bpo-18748: In development mode (:option:`-X` ``dev``) and in debug build,
  16244. the :class:`io.IOBase` destructor now logs ``close()`` exceptions. These
  16245. exceptions are silent by default in release mode.
  16246. - bpo-36575: The ``_lsprof`` module now uses internal timer same to
  16247. ``time.perf_counter()`` by default. ``gettimeofday(2)`` was used on Unix.
  16248. New timer has better resolution on most Unix platforms and timings are no
  16249. longer impacted by system clock updates since ``perf_counter()`` is
  16250. monotonic. Patch by Inada Naoki.
  16251. - bpo-33461: ``json.loads`` now emits ``DeprecationWarning`` when
  16252. ``encoding`` option is specified. Patch by Matthias Bussonnier.
  16253. - bpo-36559: The random module now prefers the lean internal _sha512 module
  16254. over hashlib for seed(version=2) to optimize import time.
  16255. - bpo-17561: Set backlog=None as the default for socket.create_server.
  16256. - bpo-34373: Fix :func:`time.mktime` error handling on AIX for year before
  16257. 1970.
  16258. - bpo-36232: Improve error message when trying to open existing DBM database
  16259. that actually doesn't exist. Patch by Marco Rougeth.
  16260. - bpo-36546: Add statistics.quantiles()
  16261. - bpo-36050: Optimized ``http.client.HTTPResponse.read()`` for large
  16262. response. Patch by Inada Naoki.
  16263. - bpo-36522: If *debuglevel* is set to >0 in :mod:`http.client`, print all
  16264. values for headers with multiple values for the same header name. Patch by
  16265. Matt Houglum.
  16266. - bpo-36492: Deprecated passing required arguments like *func* as keyword
  16267. arguments in functions which should accept arbitrary keyword arguments and
  16268. pass them to other function. Arbitrary keyword arguments (even with names
  16269. "self" and "func") can now be passed to these functions if the required
  16270. arguments are passed as positional arguments.
  16271. - bpo-27181: Add statistics.geometric_mean().
  16272. - bpo-30427: ``os.path.normcase()`` relies on ``os.fspath()`` to check the
  16273. type of its argument. Redundant checks have been removed from its
  16274. ``posixpath.normcase()`` and ``ntpath.normcase()`` implementations. Patch
  16275. by Wolfgang Maier.
  16276. - bpo-36385: Stop rejecting IPv4 octets for being ambiguously octal. Leading
  16277. zeros are ignored, and no longer are assumed to specify octal octets.
  16278. Octets are always decimal numbers. Octets must still be no more than three
  16279. digits, including leading zeroes.
  16280. - bpo-36434: Errors during writing to a ZIP file no longer prevent to
  16281. properly close it.
  16282. - bpo-36407: Fixed wrong indentation writing for CDATA section in
  16283. xml.dom.minidom. Patch by Vladimir Surjaninov.
  16284. - bpo-36326: inspect.getdoc() can now find docstrings for member objects
  16285. when __slots__ is a dictionary.
  16286. - bpo-36366: Calling ``stop()`` on an unstarted or stopped
  16287. :func:`unittest.mock.patch` object will now return ``None`` instead of
  16288. raising :exc:`RuntimeError`, making the method idempotent. Patch by
  16289. Karthikeyan Singaravelan.
  16290. - bpo-36348: The :meth:`imap.IMAP4.logout` method no longer ignores silently
  16291. arbitrary exceptions.
  16292. - bpo-31904: Add time module support and fix test_time faiures for VxWorks.
  16293. - bpo-36227: Added support for keyword arguments ``default_namespace`` and
  16294. ``xml_declaration`` in functions ``ElementTree.tostring()`` and
  16295. ``ElementTree.tostringlist()``.
  16296. - bpo-36004: Added new alternate constructors
  16297. :meth:`datetime.date.fromisocalendar` and
  16298. :meth:`datetime.datetime.fromisocalendar`, which construct date objects
  16299. from ISO year, week number and weekday; these are the inverse of each
  16300. class's ``isocalendar`` method. Patch by Paul Ganssle.
  16301. - bpo-35936: :mod:`modulefinder` no longer depends on the deprecated
  16302. :mod:`imp` module, and the initializer for
  16303. :class:`modulefinder.ModuleFinder` now has immutable default arguments.
  16304. Patch by Brandt Bucher.
  16305. - bpo-35376: :mod:`modulefinder` correctly handles modules that have the
  16306. same name as a bad package. Patch by Brandt Bucher.
  16307. - bpo-17396: :mod:`modulefinder` no longer crashes when encountering syntax
  16308. errors in followed imports. Patch by Brandt Bucher.
  16309. - bpo-35934: Added :meth:`~socket.create_server()` and
  16310. :meth:`~socket.has_dualstack_ipv6()` convenience functions to automate the
  16311. necessary tasks usually involved when creating a server socket, including
  16312. accepting both IPv4 and IPv6 connections on the same socket. (Contributed
  16313. by Giampaolo Rodola in :issue:`17561`.)
  16314. - bpo-23078: Add support for :func:`classmethod` and :func:`staticmethod` to
  16315. :func:`unittest.mock.create_autospec`. Initial patch by Felipe Ochoa.
  16316. - bpo-35416: Fix potential resource warnings in distutils. Patch by Mickaël
  16317. Schoentgen.
  16318. - bpo-25451: Add transparency methods to :class:`tkinter.PhotoImage`. Patch
  16319. by Zackery Spytz.
  16320. - bpo-35082: Don't return deleted attributes when calling dir on a
  16321. :class:`unittest.mock.Mock`.
  16322. - bpo-34547: :class:`wsgiref.handlers.BaseHandler` now handles abrupt client
  16323. connection terminations gracefully. Patch by Petter Strandmark.
  16324. - bpo-31658: :func:`xml.sax.parse` now supports :term:`path-like <path-like
  16325. object>`. Patch by Mickaël Schoentgen.
  16326. - bpo-34139: Remove stale unix datagram socket before binding
  16327. - bpo-33530: Implemented Happy Eyeballs in ``asyncio.create_connection()``.
  16328. Added two new arguments, *happy_eyeballs_delay* and *interleave*, to
  16329. specify Happy Eyeballs behavior.
  16330. - bpo-33291: Do not raise AttributeError when calling the inspect functions
  16331. isgeneratorfunction, iscoroutinefunction, isasyncgenfunction on a method
  16332. created from an arbitrary callable. Instead, return False.
  16333. - bpo-31310: Fix the multiprocessing.semaphore_tracker so it is reused by
  16334. child processes
  16335. - bpo-31292: Fix ``setup.py check --restructuredtext`` for files containing
  16336. ``include`` directives.
  16337. Documentation
  16338. -------------
  16339. - bpo-36625: Remove obsolete comments from docstrings in fractions.Fraction
  16340. - bpo-30840: Document relative imports
  16341. - bpo-36523: Add docstring for io.IOBase.writelines().
  16342. - bpo-36425: New documentation translation: `Simplified Chinese
  16343. <https://docs.python.org/zh-cn/>`_.
  16344. - bpo-36345: Avoid the duplication of code from ``Tools/scripts/serve.py``
  16345. in using the :rst:dir:`literalinclude` directive for the basic
  16346. wsgiref-based web server in the documentation of :mod:`wsgiref`.
  16347. Contributed by Stéphane Wirtel.
  16348. - bpo-36345: Using the code of the ``Tools/scripts/serve.py`` script as an
  16349. example in the :mod:`wsgiref` documentation. Contributed by Stéphane
  16350. Wirtel.
  16351. - bpo-36157: Added Documention for PyInterpreterState_Main().
  16352. - bpo-33043: Updates the docs.python.org page with the addition of a
  16353. 'Contributing to Docs' link at the end of the page (between 'Reporting
  16354. Bugs' and 'About Documentation'). Updates the 'Found a Bug' page with
  16355. additional links and information in the Documentation Bugs section.
  16356. - bpo-35581: @typing.type_check_only now allows type stubs to mark functions
  16357. and classes not available during runtime.
  16358. - bpo-33832: Add glossary entry for 'magic method'.
  16359. - bpo-32913: Added re.Match.groupdict example to regex HOWTO.
  16360. Tests
  16361. -----
  16362. - bpo-36719: regrtest now always detects uncollectable objects. Previously,
  16363. the check was only enabled by ``--findleaks``. The check now also works
  16364. with ``-jN/--multiprocess N``. ``--findleaks`` becomes a deprecated alias
  16365. to ``--fail-env-changed``.
  16366. - bpo-36725: When using multiprocessing mode (-jN), regrtest now better
  16367. reports errors if a worker process fails, and it exits immediately on a
  16368. worker thread failure or when interrupted.
  16369. - bpo-36454: Change test_time.test_monotonic() to test only the lower bound
  16370. of elapsed time after a sleep command rather than the upper bound. This
  16371. prevents unnecessary test failures on slow buildbots. Patch by Victor
  16372. Stinner.
  16373. - bpo-32424: Improve test coverage for xml.etree.ElementTree. Patch by
  16374. Gordon P. Hemsley.
  16375. - bpo-32424: Fix typo in test_cyclic_gc() test for xml.etree.ElementTree.
  16376. Patch by Gordon P. Hemsley.
  16377. - bpo-36635: Add a new :mod:`_testinternalcapi` module to test the internal
  16378. C API.
  16379. - bpo-36629: Fix ``test_imap4_host_default_value()`` of ``test_imaplib``:
  16380. catch also :const:`errno.ENETUNREACH` error.
  16381. - bpo-36611: Fix ``test_sys.test_getallocatedblocks()`` when
  16382. :mod:`tracemalloc` is enabled.
  16383. - bpo-36560: Fix reference leak hunting in regrtest: compute also deltas (of
  16384. reference count, allocated memory blocks, file descriptor count) during
  16385. warmup, to ensure that everything is initialized before starting to hunt
  16386. reference leaks.
  16387. - bpo-36565: Fix reference hunting (``python3 -m test -R 3:3``) when Python
  16388. has no built-in abc module.
  16389. - bpo-31904: Port test_resource to VxWorks: skip tests cases setting
  16390. RLIMIT_FSIZE and RLIMIT_CPU.
  16391. - bpo-31904: Fix test_tabnanny on VxWorks: adjust ENOENT error message.
  16392. - bpo-36436: Fix ``_testcapi.pymem_buffer_overflow()``: handle memory
  16393. allocation failure.
  16394. - bpo-31904: Fix test_utf8_mode on VxWorks: Python always use UTF-8 on
  16395. VxWorks.
  16396. - bpo-36341: Fix tests that may fail with PermissionError upon calling
  16397. bind() on AF_UNIX sockets.
  16398. Build
  16399. -----
  16400. - bpo-36747: Remove the stale scriptsinstall Makefile target.
  16401. - bpo-21536: On Unix, C extensions are no longer linked to libpython except
  16402. on Android and Cygwin.
  16403. It is now possible for a statically linked Python to load a C extension
  16404. built using a shared library Python.
  16405. When Python is embedded, ``libpython`` must not be loaded with
  16406. ``RTLD_LOCAL``, but ``RTLD_GLOBAL`` instead. Previously, using
  16407. ``RTLD_LOCAL``, it was already not possible to load C extensions which
  16408. were not linked to ``libpython``, such as C extensions of the standard
  16409. library built by the ``*shared*`` section of ``Modules/Setup``.
  16410. distutils, python-config and python-config.py have been modified.
  16411. - bpo-36707: ``./configure --with-pymalloc`` no longer adds the ``m`` flag
  16412. to SOABI (sys.implementation.cache_tag). Enabling or disabling pymalloc
  16413. has no impact on the ABI.
  16414. - bpo-36635: Change ``PyAPI_FUNC(type)``, ``PyAPI_DATA(type)`` and
  16415. ``PyMODINIT_FUNC`` macros of ``pyport.h`` when ``Py_BUILD_CORE_MODULE`` is
  16416. defined. The ``Py_BUILD_CORE_MODULE`` define must be now be used to build
  16417. a C extension as a dynamic library accessing Python internals: export the
  16418. :samp:`PyInit_{xxx}()` function in DLL exports on Windows.
  16419. - bpo-31904: Don't build the ``_crypt`` extension on VxWorks.
  16420. - bpo-36618: Add ``-fmax-type-align=8`` to CFLAGS when clang compiler is
  16421. detected. The pymalloc memory allocator aligns memory on 8 bytes. On
  16422. x86-64, clang expects alignment on 16 bytes by default and so uses MOVAPS
  16423. instruction which can lead to segmentation fault. Instruct clang that
  16424. Python is limited to alignment on 8 bytes to use MOVUPS instruction
  16425. instead: slower but don't trigger a SIGSEGV if the memory is not aligned
  16426. on 16 bytes. Sadly, the flag must be added to ``CFLAGS`` and not just
  16427. ``CFLAGS_NODIST``, since third party C extensions can have the same issue.
  16428. - bpo-36605: ``make tags`` and ``make TAGS`` now also parse
  16429. ``Modules/_io/*.c`` and ``Modules/_io/*.h``.
  16430. - bpo-36465: Release builds and debug builds are now ABI compatible:
  16431. defining the ``Py_DEBUG`` macro no longer implies the ``Py_TRACE_REFS``
  16432. macro, which introduces the only ABI incompatibility. The
  16433. ``Py_TRACE_REFS`` macro, which adds the :func:`sys.getobjects` function
  16434. and the :envvar:`PYTHONDUMPREFS` environment variable, can be set using
  16435. the new ``./configure --with-trace-refs`` build option.
  16436. - bpo-36577: setup.py now correctly reports missing OpenSSL headers and
  16437. libraries again.
  16438. - bpo-36544: Fix regression introduced in bpo-36146 refactoring setup.py
  16439. - bpo-36508: ``python-config --ldflags`` no longer includes flags of the
  16440. ``LINKFORSHARED`` variable. The ``LINKFORSHARED`` variable must only be
  16441. used to build executables.
  16442. - bpo-36503: Remove references to "aix3" and "aix4". Patch by M. Felt.
  16443. Windows
  16444. -------
  16445. - bpo-35920: Added platform.win32_edition() and platform.win32_is_iot().
  16446. Added support for cross-compiling packages for Windows ARM32. Skip tests
  16447. that are not expected to work on Windows IoT Core ARM32.
  16448. - bpo-36649: Remove trailing spaces for registry keys when installed via the
  16449. Store.
  16450. - bpo-34144: Fixed activate.bat to correctly update codepage when chcp.com
  16451. returns dots in output. Patch by Lorenz Mende.
  16452. - bpo-36509: Added preset-iot layout for Windows IoT ARM containers. This
  16453. layout doesn't contain UI components like tkinter or IDLE. It also doesn't
  16454. contain files to support on-target builds since Windows ARM32 builds must
  16455. be cross-compiled when using MSVC.
  16456. - bpo-35941: enum_certificates function of the ssl module now returns
  16457. certificates from all available certificate stores inside windows in a
  16458. query instead of returning only certificates from the system wide
  16459. certificate store. This includes certificates from these certificate
  16460. stores: local machine, local machine enterprise, local machine group
  16461. policy, current user, current user group policy, services, users.
  16462. ssl.enum_crls() function is changed in the same way to return all
  16463. certificate revocation lists inside the windows certificate revocation
  16464. list stores.
  16465. - bpo-36441: Fixes creating a venv when debug binaries are installed.
  16466. - bpo-36085: Enable better DLL resolution on Windows by using safe DLL
  16467. search paths and adding :func:`os.add_dll_directory`.
  16468. - bpo-36010: Add the venv standard library module to the nuget distribution
  16469. for Windows.
  16470. - bpo-29515: Add the following socket module constants on Windows:
  16471. IPPROTO_AH IPPROTO_CBT IPPROTO_DSTOPTS IPPROTO_EGP IPPROTO_ESP
  16472. IPPROTO_FRAGMENT IPPROTO_GGP IPPROTO_HOPOPTS IPPROTO_ICLFXBM
  16473. IPPROTO_ICMPV6 IPPROTO_IDP IPPROTO_IGMP IPPROTO_IGP IPPROTO_IPV4
  16474. IPPROTO_IPV6 IPPROTO_L2TP IPPROTO_MAX IPPROTO_ND IPPROTO_NONE IPPROTO_PGM
  16475. IPPROTO_PIM IPPROTO_PUP IPPROTO_RDP IPPROTO_ROUTING IPPROTO_SCTP
  16476. IPPROTO_ST
  16477. - bpo-35947: Added current version of libffi to cpython-source-deps. Change
  16478. _ctypes to use current version of libffi on Windows.
  16479. - bpo-34060: Report system load when running test suite on Windows. Patch by
  16480. Ammar Askar. Based on prior work by Jeremy Kloth.
  16481. - bpo-31512: With the Windows 10 Creators Update, non-elevated users can now
  16482. create symlinks as long as the computer has Developer Mode enabled.
  16483. macOS
  16484. -----
  16485. - bpo-34602: Avoid failures setting macOS stack resource limit with
  16486. resource.setrlimit. This reverts an earlier fix for bpo-18075 which forced
  16487. a non-default stack size when building the interpreter executable on
  16488. macOS.
  16489. IDLE
  16490. ----
  16491. - bpo-36429: Fix starting IDLE with pyshell. Add idlelib.pyshell alias at
  16492. top; remove pyshell alias at bottom. Remove obsolete __name__=='__main__'
  16493. command.
  16494. Tools/Demos
  16495. -----------
  16496. - bpo-14546: Fix the argument handling in Tools/scripts/lll.py.
  16497. C API
  16498. -----
  16499. - bpo-36763: Fix memory leak in :c:func:`Py_SetStandardStreamEncoding`:
  16500. release memory if the function is called twice.
  16501. - bpo-36641: :c:expr:`PyDoc_VAR(name)` and :c:expr:`PyDoc_STRVAR(name,str)`
  16502. now create ``static const char name[]`` instead of ``static char name[]``.
  16503. Patch by Inada Naoki.
  16504. - bpo-36389: Change the value of ``CLEANBYTE``, ``DEADDYTE`` and
  16505. ``FORBIDDENBYTE`` internal constants used by debug hooks on Python memory
  16506. allocators (:c:func:`PyMem_SetupDebugHooks` function). Byte patterns
  16507. ``0xCB``, ``0xDB`` and ``0xFB`` have been replaced with ``0xCD``, ``0xDD``
  16508. and ``0xFD`` to use the same values than Windows CRT debug ``malloc()``
  16509. and ``free()``.
  16510. - bpo-36443: Since Python 3.7.0, calling :c:func:`Py_DecodeLocale` before
  16511. :c:func:`Py_Initialize` produces mojibake if the ``LC_CTYPE`` locale is
  16512. coerced and/or if the UTF-8 Mode is enabled by the user configuration. The
  16513. LC_CTYPE coercion and UTF-8 Mode are now disabled by default to fix the
  16514. mojibake issue. They must now be enabled explicitly (opt-in) using the new
  16515. :c:func:`_Py_PreInitialize` API with ``_PyPreConfig``.
  16516. - bpo-36025: Fixed an accidental change to the datetime C API where the
  16517. arguments to the :c:func:`PyDate_FromTimestamp` function were incorrectly
  16518. interpreted as a single timestamp rather than an arguments tuple, which
  16519. causes existing code to start raising :exc:`TypeError`. The
  16520. backwards-incompatible change was only present in alpha releases of Python
  16521. 3.8. Patch by Paul Ganssle.
  16522. - bpo-35810: Modify ``PyObject_Init`` to correctly increase the refcount of
  16523. heap-allocated Type objects. Also fix the refcounts of the heap-allocated
  16524. types that were either doing this manually or not decreasing the type's
  16525. refcount in tp_dealloc
  16526. What's New in Python 3.8.0 alpha 3?
  16527. ===================================
  16528. *Release date: 2019-03-25*
  16529. Security
  16530. --------
  16531. - bpo-36216: Changes urlsplit() to raise ValueError when the URL contains
  16532. characters that decompose under IDNA encoding (NFKC-normalization) into
  16533. characters that affect how the URL is parsed.
  16534. - bpo-35121: Don't send cookies of domain A without Domain attribute to
  16535. domain B when domain A is a suffix match of domain B while using a
  16536. cookiejar with :class:`http.cookiejar.DefaultCookiePolicy` policy. Patch
  16537. by Karthikeyan Singaravelan.
  16538. Core and Builtins
  16539. -----------------
  16540. - bpo-36421: Fix a possible double decref in _ctypes.c's
  16541. ``PyCArrayType_new()``.
  16542. - bpo-36412: Fix a possible crash when creating a new dictionary.
  16543. - bpo-36398: Fix a possible crash in ``structseq_repr()``.
  16544. - bpo-36256: Fix bug in parsermodule when parsing a state in a DFA that has
  16545. two or more arcs with labels of the same type. Patch by Pablo Galindo.
  16546. - bpo-36365: repr(structseq) is no longer limited to 512 bytes.
  16547. - bpo-36374: Fix a possible null pointer dereference in
  16548. ``merge_consts_recursive()``. Patch by Zackery Spytz.
  16549. - bpo-36236: At Python initialization, the current directory is no longer
  16550. prepended to :data:`sys.path` if it has been removed.
  16551. - bpo-36352: Python initialization now fails with an error, rather than
  16552. silently truncating paths, if a path is too long.
  16553. - bpo-36301: Python initialization now fails if decoding ``pybuilddir.txt``
  16554. configuration file fails at startup.
  16555. - bpo-36333: Fix leak in _PyRuntimeState_Fini. Contributed by Stéphane
  16556. Wirtel.
  16557. - bpo-36332: The builtin :func:`compile` can now handle AST objects that
  16558. contain assignment expressions. Patch by Pablo Galindo.
  16559. - bpo-36282: Improved error message for too much positional arguments in
  16560. some builtin functions.
  16561. - bpo-30040: New empty dict uses fewer memory for now. It used more memory
  16562. than empty dict created by ``dict.clear()``. And empty dict creation and
  16563. deletion is about 2x faster. Patch by Inada Naoki.
  16564. - bpo-36262: Fix an unlikely memory leak on conversion from string to float
  16565. in the function ``_Py_dg_strtod()`` used by ``float(str)``,
  16566. ``complex(str)``, :func:`pickle.load`, :func:`marshal.load`, etc.
  16567. - bpo-36252: Update Unicode databases to version 12.0.0.
  16568. - bpo-36218: Fix a segfault occurring when sorting a list of heterogeneous
  16569. values. Patch contributed by Rémi Lapeyre and Elliot Gorokhovsky.
  16570. - bpo-36188: Cleaned up left-over vestiges of Python 2 unbound method
  16571. handling in method objects and documentation. Patch by Martijn Pieters
  16572. - bpo-36124: Add a new interpreter-specific dict and expose it in the C-API
  16573. via PyInterpreterState_GetDict(). This parallels PyThreadState_GetDict().
  16574. However, extension modules should continue using PyModule_GetState() for
  16575. their own internal per-interpreter state.
  16576. - bpo-35975: Add a ``feature_version`` flag to ``ast.parse()`` (documented)
  16577. and ``compile()`` (hidden) that allows tweaking the parser to support
  16578. older versions of the grammar. In particular, if ``feature_version`` is 5
  16579. or 6, the hacks for the ``async`` and ``await`` keyword from PEP 492 are
  16580. reinstated. (For 7 or higher, these are unconditionally treated as
  16581. keywords, but they are still special tokens rather than ``NAME`` tokens
  16582. that the parser driver recognizes.)
  16583. - bpo-31904: Use UTF-8 as the system encoding on VxWorks.
  16584. - bpo-36048: The :meth:`~object.__index__` special method will be used
  16585. instead of :meth:`~object.__int__` for implicit conversion of Python
  16586. numbers to C integers. Using the ``__int__()`` method in implicit
  16587. conversions has been deprecated.
  16588. - bpo-35808: Retire pgen and use a modified version of pgen2 to generate the
  16589. parser. Patch by Pablo Galindo.
  16590. Library
  16591. -------
  16592. - bpo-36401: The class documentation created by pydoc now has a separate
  16593. section for readonly properties.
  16594. - bpo-36320: The typing.NamedTuple() class has deprecated the _field_types
  16595. attribute in favor of the __annotations__ attribute which carried the same
  16596. information. Also, both attributes were converted from OrderedDict to a
  16597. regular dict.
  16598. - bpo-34745: Fix :mod:`asyncio` ssl memory issues caused by circular
  16599. references
  16600. - bpo-36324: Add method to statistics.NormalDist for computing the inverse
  16601. cumulative normal distribution.
  16602. - bpo-36321: collections.namedtuple() misspelled the name of an attribute.
  16603. To be consistent with typing.NamedTuple, the attribute name should have
  16604. been "_field_defaults" instead of "_fields_defaults". For backwards
  16605. compatibility, both spellings are now created. The misspelled version may
  16606. be removed in the future.
  16607. - bpo-36297: "unicode_internal" codec is removed. It was deprecated since
  16608. Python 3.3. Patch by Inada Naoki.
  16609. - bpo-36298: Raise ModuleNotFoundError in pyclbr when a module can't be
  16610. found. Thanks to 'mental' for the bug report.
  16611. - bpo-36268: Switch the default format used for writing tars with
  16612. :mod:`tarfile` to the modern POSIX.1-2001 pax standard, from the
  16613. vendor-specific GNU. Contributed by C.A.M. Gerlach.
  16614. - bpo-36285: Fix integer overflows in the array module. Patch by Stephan
  16615. Hohe.
  16616. - bpo-31904: Add _signal module support for VxWorks.
  16617. - bpo-36272: :mod:`logging` does not silently ignore RecursionError anymore.
  16618. Patch contributed by Rémi Lapeyre.
  16619. - bpo-36280: Add a kind field to ast.Constant. It is 'u' if the literal has
  16620. a 'u' prefix (i.e. a Python 2 style unicode literal), else None.
  16621. - bpo-35931: The :mod:`pdb` ``debug`` command now gracefully handles all
  16622. exceptions.
  16623. - bpo-36251: Fix format strings used for stderrprinter and re.Match reprs.
  16624. Patch by Stephan Hohe.
  16625. - bpo-36235: Fix ``CFLAGS`` in ``customize_compiler()`` of
  16626. ``distutils.sysconfig``: when the ``CFLAGS`` environment variable is
  16627. defined, don't override ``CFLAGS`` variable with the ``OPT`` variable
  16628. anymore. Initial patch written by David Malcolm.
  16629. - bpo-35807: Update ensurepip to install pip 19.0.3 and setuptools 40.8.0.
  16630. - bpo-36139: Release GIL when closing :class:`~mmap.mmap` objects.
  16631. - bpo-36179: Fix two unlikely reference leaks in _hashopenssl. The leaks
  16632. only occur in out-of-memory cases.
  16633. - bpo-36169: Add overlap() method to statistics.NormalDist. Computes the
  16634. overlapping coefficient for two normal distributions.
  16635. - bpo-36103: Default buffer size used by ``shutil.copyfileobj()`` is changed
  16636. from 16 KiB to 64 KiB on non-Windows platform to reduce system call
  16637. overhead. Contributed by Inada Naoki.
  16638. - bpo-36130: Fix ``pdb`` with ``skip=...`` when stepping into a frame
  16639. without a ``__name__`` global. Patch by Anthony Sottile.
  16640. - bpo-35652: shutil.copytree(copy_function=...) erroneously pass DirEntry
  16641. instead of a path string.
  16642. - bpo-35178: Ensure custom :func:`warnings.formatwarning` function can
  16643. receive ``line`` as positional argument. Based on patch by Tashrif Billah.
  16644. - bpo-36106: Resolve potential name clash with libm's sinpi(). Patch by
  16645. Dmitrii Pasechnik.
  16646. - bpo-36091: Clean up reference to async generator in Lib/types. Patch by
  16647. Henry Chen.
  16648. - bpo-36043: :class:`FileCookieJar` supports :term:`path-like object`.
  16649. Contributed by Stéphane Wirtel
  16650. - bpo-35899: Enum has been fixed to correctly handle empty strings and
  16651. strings with non-Latin characters (ie. 'α', 'א') without crashing.
  16652. Original patch contributed by Maxwell. Assisted by Stéphane Wirtel.
  16653. - bpo-21269: Add ``args`` and ``kwargs`` properties to mock call objects.
  16654. Contributed by Kumar Akshay.
  16655. - bpo-30670: ``pprint.pp`` has been added to pretty-print objects with
  16656. dictionary keys being sorted with their insertion order by default.
  16657. Parameter *sort_dicts* has been added to ``pprint.pprint``,
  16658. ``pprint.pformat`` and ``pprint.PrettyPrinter``. Contributed by Rémi
  16659. Lapeyre.
  16660. - bpo-35843: Implement ``__getitem__`` for ``_NamespacePath``. Patch by
  16661. Anthony Sottile.
  16662. - bpo-35802: Clean up code which checked presence of ``os.stat`` /
  16663. ``os.lstat`` / ``os.chmod`` which are always present. Patch by Anthony
  16664. Sottile.
  16665. - bpo-35715: Librates the return value of a ProcessPoolExecutor
  16666. _process_worker after it's no longer needed to free memory
  16667. - bpo-35493: Use :func:`multiprocessing.connection.wait` instead of polling
  16668. each 0.2 seconds for worker updates in :class:`multiprocessing.Pool`.
  16669. Patch by Pablo Galindo.
  16670. - bpo-35661: Store the venv prompt in pyvenv.cfg.
  16671. - bpo-35121: Don't set cookie for a request when the request path is a
  16672. prefix match of the cookie's path attribute but doesn't end with "/".
  16673. Patch by Karthikeyan Singaravelan.
  16674. - bpo-21478: Calls to a child function created with
  16675. :func:`unittest.mock.create_autospec` should propagate to the parent.
  16676. Patch by Karthikeyan Singaravelan.
  16677. - bpo-35198: Fix C++ extension compilation on AIX
  16678. Documentation
  16679. -------------
  16680. - bpo-36329: Declare the path of the Python binary for the usage of
  16681. ``Tools/scripts/serve.py`` when executing ``make -C Doc/ serve``.
  16682. Contributed by Stéphane Wirtel
  16683. - bpo-36138: Improve documentation about converting datetime.timedelta to
  16684. scalars.
  16685. - bpo-21314: A new entry was added to the Core Language Section of the
  16686. Programming FAQ, which explaines the usage of slash(/) in the signature of
  16687. a function. Patch by Lysandros Nikolaou
  16688. Tests
  16689. -----
  16690. - bpo-36234: test_posix.PosixUidGidTests: add tests for invalid uid/gid type
  16691. (str). Initial patch written by David Malcolm.
  16692. - bpo-29571: Fix ``test_re.test_locale_flag()``: use
  16693. ``locale.getpreferredencoding()`` rather than ``locale.getlocale()`` to
  16694. get the locale encoding. With some locales, ``locale.getlocale()`` returns
  16695. the wrong encoding.
  16696. - bpo-36123: Fix race condition in test_socket.
  16697. Build
  16698. -----
  16699. - bpo-36356: Fix leaks that led to build failure when configured with
  16700. address sanitizer.
  16701. - bpo-36146: Add ``TEST_EXTENSIONS`` constant to ``setup.py`` to allow to
  16702. not build test extensions like ``_testcapi``.
  16703. - bpo-36146: Fix setup.py on macOS: only add ``/usr/include/ffi`` to include
  16704. directories of _ctypes, not for all extensions.
  16705. - bpo-31904: Enable build system to cross-build for VxWorks RTOS.
  16706. Windows
  16707. -------
  16708. - bpo-36312: Fixed decoders for the following code pages: 50220, 50221,
  16709. 50222, 50225, 50227, 50229, 57002 through 57011, 65000 and 42.
  16710. - bpo-36264: Don't honor POSIX ``HOME`` in ``os.path.expanduser`` on
  16711. windows. Patch by Anthony Sottile.
  16712. - bpo-24643: Fix name collisions due to ``#define timezone _timezone`` in
  16713. PC/pyconfig.h.
  16714. IDLE
  16715. ----
  16716. - bpo-36405: Use dict unpacking in idlelib.
  16717. - bpo-36396: Remove fgBg param of idlelib.config.GetHighlight(). This param
  16718. was only used twice and changed the return type.
  16719. - bpo-36176: Fix IDLE autocomplete & calltip popup colors. Prevent conflicts
  16720. with Linux dark themes (and slightly darken calltip background).
  16721. - bpo-23205: For the grep module, add tests for findfiles, refactor
  16722. findfiles to be a module-level function, and refactor findfiles to use
  16723. os.walk.
  16724. - bpo-23216: Add docstrings to IDLE search modules.
  16725. - bpo-36152: Remove colorizer.ColorDelegator.close_when_done and the
  16726. corresponding argument of .close(). In IDLE, both have always been None
  16727. or False since 2007.
  16728. - bpo-32129: Avoid blurry IDLE application icon on macOS with Tk 8.6. Patch
  16729. by Kevin Walzer.
  16730. - bpo-36096: Refactor class variables to instance variables in colorizer.
  16731. - bpo-30348: Increase test coverage of idlelib.autocomplete by 30%. Patch by
  16732. Louie Lu
  16733. Tools/Demos
  16734. -----------
  16735. - bpo-35132: Fix py-list and py-bt commands of python-gdb.py on gdb7.
  16736. - bpo-32217: Fix freeze script on Windows.
  16737. C API
  16738. -----
  16739. - bpo-36381: Raise ``DeprecationWarning`` when '#' formats are used for
  16740. building or parsing values without ``PY_SSIZE_T_CLEAN``.
  16741. - bpo-36142: The whole coreconfig.h header is now excluded from
  16742. Py_LIMITED_API. Move functions definitions into a new internal
  16743. pycore_coreconfig.h header.
  16744. What's New in Python 3.8.0 alpha 2?
  16745. ===================================
  16746. *Release date: 2019-02-25*
  16747. Core and Builtins
  16748. -----------------
  16749. - bpo-36052: Raise a :exc:`SyntaxError` when assigning a value to
  16750. ``__debug__`` with the Assignment Operator. Contributed by Stéphane Wirtel
  16751. and Pablo Galindo.
  16752. - bpo-36012: Doubled the speed of class variable writes. When a non-dunder
  16753. attribute was updated, there was an unnecessary call to update slots.
  16754. - bpo-35942: The error message emitted when returning invalid types from
  16755. ``__fspath__`` in interfaces that allow passing :class:`~os.PathLike`
  16756. objects has been improved and now it does explain the origin of the error.
  16757. - bpo-36016: ``gc.get_objects`` can now receive an optional parameter
  16758. indicating a generation to get objects from. Patch by Pablo Galindo.
  16759. - bpo-1054041: When the main interpreter exits due to an uncaught
  16760. KeyboardInterrupt, the process now exits in the appropriate manner for its
  16761. parent process to detect that a SIGINT or ^C terminated the process. This
  16762. allows shells and batch scripts to understand that the user has asked them
  16763. to stop.
  16764. - bpo-35992: Fix ``__class_getitem__()`` not being called on a class with a
  16765. custom non-subscriptable metaclass.
  16766. - bpo-35993: Fix a crash on fork when using subinterpreters. Contributed by
  16767. Stéphane Wirtel
  16768. - bpo-35991: Fix a potential double free in Modules/_randommodule.c.
  16769. - bpo-35961: Fix a crash in slice_richcompare(): use strong references
  16770. rather than stolen references for the two temporary internal tuples.
  16771. - bpo-35911: Enable the creation of cell objects by adding a
  16772. ``cell.__new__`` method, and expose the type ``cell`` in ``Lib/types.py``
  16773. under the name CellType. Patch by Pierre Glaser.
  16774. - bpo-12822: Use monotonic clock for ``pthread_cond_timedwait`` when
  16775. ``pthread_condattr_setclock`` and ``CLOCK_MONOTONIC`` are available.
  16776. - bpo-15248: The compiler emits now syntax warnings in the case when a comma
  16777. is likely missed before tuple or list.
  16778. - bpo-35886: The implementation of PyInterpreterState has been moved into
  16779. the internal header files (guarded by Py_BUILD_CORE).
  16780. - bpo-31506: Clarify the errors reported when ``object.__new__`` and
  16781. ``object.__init__`` receive more than one argument. Contributed by Sanyam
  16782. Khurana.
  16783. - bpo-35724: Signal-handling is now guaranteed to happen relative to the
  16784. main interpreter.
  16785. - bpo-33608: We added a new internal _Py_AddPendingCall() that operates
  16786. relative to the provided interpreter. This allows us to use the existing
  16787. implementation to ask another interpreter to do work that cannot be done
  16788. in the current interpreter, like decref an object the other interpreter
  16789. owns. The existing Py_AddPendingCall() only operates relative to the main
  16790. interpreter.
  16791. - bpo-33989: Fix a possible crash in :meth:`list.sort` when sorting objects
  16792. with ``ob_type->tp_richcompare == NULL``. Patch by Zackery Spytz.
  16793. Library
  16794. -------
  16795. - bpo-35512: :func:`unittest.mock.patch.dict` used as a decorator with
  16796. string target resolves the target during function call instead of during
  16797. decorator construction. Patch by Karthikeyan Singaravelan.
  16798. - bpo-36018: Add statistics.NormalDist, a tool for creating and manipulating
  16799. normal distributions of random variable. Features a composite class that
  16800. treats the mean and standard deviation of measurement data as single
  16801. entity.
  16802. - bpo-35904: Added statistics.fmean() as a faster, floating point variant of
  16803. the existing mean() function.
  16804. - bpo-35918: Removed broken ``has_key`` method from
  16805. multiprocessing.managers.SyncManager.dict. Contributed by Rémi Lapeyre.
  16806. - bpo-18283: Add support for bytes to :func:`shutil.which`.
  16807. - bpo-35960: Fix :func:`dataclasses.field` throwing away empty mapping
  16808. objects passed as metadata.
  16809. - bpo-35500: Write expected and actual call parameters on separate lines in
  16810. :meth:`unittest.mock.Mock.assert_called_with` assertion errors.
  16811. Contributed by Susan Su.
  16812. - bpo-35931: The :mod:`pdb` ``debug`` command now gracefully handles syntax
  16813. errors.
  16814. - bpo-24209: In http.server script, rely on getaddrinfo to bind to preferred
  16815. address based on the bind parameter. Now default bind or binding to a name
  16816. may bind to IPv6 or dual-stack, depending on the environment.
  16817. - bpo-35321: Set ``__spec__.origin`` of ``_frozen_importlib`` to frozen so
  16818. that it matches the behavior of ``_frozen_importlib_external``. Patch by
  16819. Nina Zakharenko.
  16820. - bpo-35378: Fix a reference issue inside :class:`multiprocessing.Pool` that
  16821. caused the pool to remain alive if it was deleted without being closed or
  16822. terminated explicitly. A new strong reference is added to the pool
  16823. iterators to link the lifetime of the pool to the lifetime of its
  16824. iterators so the pool does not get destroyed if a pool iterator is still
  16825. alive.
  16826. - bpo-34294: re module, fix wrong capturing groups in rare cases.
  16827. :func:`re.search`, :func:`re.findall`, :func:`re.sub` and other functions
  16828. that scan through string looking for a match, should reset capturing
  16829. groups between two match attempts. Patch by Ma Lin.
  16830. - bpo-35615: :mod:`weakref`: Fix a RuntimeError when copying a
  16831. WeakKeyDictionary or a WeakValueDictionary, due to some keys or values
  16832. disappearing while iterating.
  16833. - bpo-35606: Implement :func:`math.prod` as analogous function to
  16834. :func:`sum` that returns the product of a 'start' value (default: 1) times
  16835. an iterable of numbers. Patch by Pablo Galindo.
  16836. - bpo-32417: Performing arithmetic between :class:`datetime.datetime`
  16837. subclasses and :class:`datetime.timedelta` now returns an object of the
  16838. same type as the :class:`datetime.datetime` subclass. As a result,
  16839. :meth:`datetime.datetime.astimezone` and alternate constructors like
  16840. :meth:`datetime.datetime.now` and :meth:`datetime.fromtimestamp` called
  16841. with a ``tz`` argument now *also* retain their subclass.
  16842. - bpo-35153: Add *headers* optional keyword-only parameter to
  16843. :class:`xmlrpc.client.ServerProxy`, :class:`xmlrpc.client.Transport` and
  16844. :class:`xmlrpc.client.SafeTransport`. Patch by Cédric Krier.
  16845. - bpo-34572: Fix C implementation of pickle.loads to use importlib's locking
  16846. mechanisms, and thereby avoid using partially loaded modules. Patch by Tim
  16847. Burgess.
  16848. Documentation
  16849. -------------
  16850. - bpo-36083: Fix formatting of --check-hash-based-pycs options in the
  16851. manpage Synopsis.
  16852. - bpo-36007: Bump minimum sphinx version to 1.8. Patch by Anthony Sottile.
  16853. - bpo-22062: Update documentation and docstrings for pathlib. Original patch
  16854. by Mike Short.
  16855. Tests
  16856. -----
  16857. - bpo-27313: Avoid test_ttk_guionly ComboboxTest failure with macOS Cocoa
  16858. Tk.
  16859. - bpo-36019: Add test.support.TEST_HTTP_URL and replace references of
  16860. http://www.example.com by this new constant. Contributed by Stéphane
  16861. Wirtel.
  16862. - bpo-36037: Fix test_ssl for strict OpenSSL configuration like RHEL8 strict
  16863. crypto policy. Use older TLS version for minimum TLS version of the server
  16864. SSL context if needed, to test TLS version older than default minimum TLS
  16865. version.
  16866. - bpo-35798: Added :func:`test.support.check_syntax_warning`.
  16867. - bpo-35505: Make test_imap4_host_default_value independent on whether the
  16868. local IMAP server is running.
  16869. - bpo-35917: multiprocessing: provide unit tests for SyncManager and
  16870. SharedMemoryManager classes + all the shareable types which are supposed
  16871. to be supported by them. (patch by Giampaolo Rodola)
  16872. - bpo-35704: Skip ``test_shutil.test_unpack_archive_xztar`` to prevent a
  16873. MemoryError on 32-bit AIX when MAXDATA setting is less than 0x20000000.
  16874. Patch by Michael Felt (aixtools)
  16875. - bpo-34720: Assert m_state != NULL to mimic GC traversal functions that do
  16876. not correctly handle module creation when the module state has not been
  16877. created.
  16878. Windows
  16879. -------
  16880. - bpo-35976: Added ARM build support to Windows build files in PCBuild.
  16881. - bpo-35692: ``pathlib`` no longer raises when checking file and directory
  16882. existence on drives that are not ready
  16883. - bpo-35872: Uses the base Python executable when invoking venv in a virtual
  16884. environment
  16885. - bpo-35873: Prevents venv paths being inherited by child processes
  16886. - bpo-35299: Fix sysconfig detection of the source directory and distutils
  16887. handling of pyconfig.h during PGO profiling
  16888. IDLE
  16889. ----
  16890. - bpo-24310: IDLE -- Document settings dialog font tab sample.
  16891. - bpo-35833: Revise IDLE doc for control codes sent to Shell. Add a code
  16892. example block.
  16893. - bpo-35689: Add docstrings and unittests for colorizer.py.
  16894. What's New in Python 3.8.0 alpha 1?
  16895. ===================================
  16896. *Release date: 2019-02-03*
  16897. Security
  16898. --------
  16899. - bpo-35746: [CVE-2019-5010] Fix a NULL pointer deref in ssl module. The
  16900. cert parser did not handle CRL distribution points with empty DP or URI
  16901. correctly. A malicious or buggy certificate can result into segfault.
  16902. Vulnerability (TALOS-2018-0758) reported by Colin Read and Nicolas Edet of
  16903. Cisco.
  16904. - bpo-34812: The :option:`-I` command line option (run Python in isolated
  16905. mode) is now also copied by the :mod:`multiprocessing` and ``distutils``
  16906. modules when spawning child processes. Previously, only :option:`-E` and
  16907. :option:`-s` options (enabled by :option:`-I`) were copied.
  16908. - bpo-34791: The xml.sax and xml.dom.domreg no longer use environment
  16909. variables to override parser implementations when
  16910. sys.flags.ignore_environment is set by -E or -I arguments.
  16911. - bpo-17239: The xml.sax and xml.dom.minidom parsers no longer processes
  16912. external entities by default. External DTD and ENTITY declarations no
  16913. longer load files or create network connections.
  16914. - bpo-34623: CVE-2018-14647: The C accelerated _elementtree module now
  16915. initializes hash randomization salt from _Py_HashSecret instead of
  16916. libexpat's default CSPRNG.
  16917. - bpo-34405: Updated to OpenSSL 1.1.0i for Windows builds.
  16918. - bpo-33871: Fixed sending the part of the file in :func:`os.sendfile` on
  16919. macOS. Using the *trailers* argument could cause sending more bytes from
  16920. the input file than was specified.
  16921. - bpo-32533: Fixed thread-safety of error handling in _ssl.
  16922. - bpo-33136: Harden ssl module against LibreSSL CVE-2018-8970.
  16923. X509_VERIFY_PARAM_set1_host() is called with an explicit namelen. A new
  16924. test ensures that NULL bytes are not allowed.
  16925. - bpo-33001: Minimal fix to prevent buffer overrun in os.symlink on Windows
  16926. - bpo-32981: Regexes in difflib and poplib were vulnerable to catastrophic
  16927. backtracking. These regexes formed potential DOS vectors (REDOS). They
  16928. have been refactored. This resolves CVE-2018-1060 and CVE-2018-1061. Patch
  16929. by Jamie Davis.
  16930. - bpo-28414: The ssl module now allows users to perform their own IDN
  16931. en/decoding when using SNI.
  16932. Core and Builtins
  16933. -----------------
  16934. - bpo-35877: Make parenthesis optional for named expressions in while
  16935. statement. Patch by Karthikeyan Singaravelan.
  16936. - bpo-35814: Allow same right hand side expressions in annotated assignments
  16937. as in normal ones. In particular, ``x: Tuple[int, int] = 1, 2`` (without
  16938. parentheses on the right) is now allowed.
  16939. - bpo-35766: Add the option to parse PEP 484 type comments in the ast
  16940. module. (Off by default.) This is merging the key functionality of the
  16941. third party fork thereof,
  16942. [typed_ast](https://github.com/python/typed_ast).
  16943. - bpo-35713: Reorganize Python initialization to get working exceptions and
  16944. sys.stderr earlier.
  16945. - bpo-33416: Add end line and end column position information to the Python
  16946. AST nodes. This is a C-level backwards incompatible change.
  16947. - bpo-35720: Fixed a minor memory leak in pymain_parse_cmdline_impl function
  16948. in Modules/main.c
  16949. - bpo-35634: ``func(**kwargs)`` will now raise an error when ``kwargs`` is a
  16950. mapping containing multiple entries with the same key. An error was
  16951. already raised when other keyword arguments are passed before ``**kwargs``
  16952. since Python 3.6.
  16953. - bpo-35623: Fix a crash when sorting very long lists. Patch by Stephan
  16954. Hohe.
  16955. - bpo-35214: clang Memory Sanitizer build instrumentation was added to work
  16956. around false positives from posix, socket, time, test_io, and
  16957. test_faulthandler.
  16958. - bpo-35560: Fix an assertion error in :func:`format` in debug build for
  16959. floating point formatting with "n" format, zero padding and small width.
  16960. Release build is not impacted. Patch by Karthikeyan Singaravelan.
  16961. - bpo-35552: Format characters ``%s`` and ``%V`` in
  16962. :c:func:`PyUnicode_FromFormat` and ``%s`` in :c:func:`PyBytes_FromFormat`
  16963. no longer read memory past the limit if *precision* is specified.
  16964. - bpo-35504: Fix segfaults and :exc:`SystemError`\ s when deleting certain
  16965. attributes. Patch by Zackery Spytz.
  16966. - bpo-35504: Fixed a SystemError when delete the characters_written
  16967. attribute of an OSError.
  16968. - bpo-35494: Improved syntax error messages for unbalanced parentheses in
  16969. f-string.
  16970. - bpo-35444: Fixed error handling in pickling methods when fail to look up
  16971. builtin "getattr". Sped up pickling iterators.
  16972. - bpo-35436: Fix various issues with memory allocation error handling.
  16973. Patch by Zackery Spytz.
  16974. - bpo-35423: Separate the signal handling trigger in the eval loop from the
  16975. "pending calls" machinery. There is no semantic change and the difference
  16976. in performance is insignificant.
  16977. - bpo-35357: Internal attributes' names of unittest.mock._Call and
  16978. unittest.mock.MagicProxy (name, parent & from_kall) are now prefixed with
  16979. _mock_ in order to prevent clashes with widely used object attributes.
  16980. Fixed minor typo in test function name.
  16981. - bpo-35372: Fixed the code page decoder for input longer than 2 GiB
  16982. containing undecodable bytes.
  16983. - bpo-35336: Fix PYTHONCOERCECLOCALE=1 environment variable: only coerce the
  16984. C locale if the LC_CTYPE locale is "C".
  16985. - bpo-31241: The *lineno* and *col_offset* attributes of AST nodes for list
  16986. comprehensions, generator expressions and tuples are now point to the
  16987. opening parenthesis or square brace. For tuples without parenthesis they
  16988. point to the position of the first item.
  16989. - bpo-33954: For :meth:`str.format`, :meth:`float.__format__` and
  16990. :meth:`complex.__format__` methods for non-ASCII decimal point when using
  16991. the "n" formatter.
  16992. - bpo-35269: Fix a possible segfault involving a newly created coroutine.
  16993. Patch by Zackery Spytz.
  16994. - bpo-35224: Implement :pep:`572` (assignment expressions). Patch by Emily
  16995. Morehouse.
  16996. - bpo-32492: Speed up :func:`namedtuple` attribute access by 1.6x using a C
  16997. fast-path for the name descriptors. Patch by Pablo Galindo.
  16998. - bpo-35214: Fixed an out of bounds memory access when parsing a truncated
  16999. unicode escape sequence at the end of a string such as ``'\N'``. It would
  17000. read one byte beyond the end of the memory allocation.
  17001. - bpo-35214: The interpreter and extension modules have had annotations
  17002. added so that they work properly under clang's Memory Sanitizer. A new
  17003. configure flag --with-memory-sanitizer has been added to make test builds
  17004. of this nature easier to perform.
  17005. - bpo-35193: Fix an off by one error in the bytecode peephole optimizer
  17006. where it could read bytes beyond the end of bounds of an array when
  17007. removing unreachable code. This bug was present in every release of Python
  17008. 3.6 and 3.7 until now.
  17009. - bpo-35169: Improved error messages for forbidden assignments.
  17010. - bpo-34022: Fix handling of hash-based bytecode files in :mod:`zipimport`.
  17011. Patch by Elvis Pranskevichus.
  17012. - bpo-28401: Debug builds will no longer to attempt to import extension
  17013. modules built for the ABI as they were never compatible to begin with.
  17014. Patch by Stefano Rivera.
  17015. - bpo-29341: Clarify in the docstrings of :mod:`os` methods that path-like
  17016. objects are also accepted as input parameters.
  17017. - bpo-35050: :mod:`socket`: Fix off-by-one bug in length check for
  17018. ``AF_ALG`` name and type.
  17019. - bpo-29743: Raise :exc:`ValueError` instead of :exc:`OverflowError` in case
  17020. of a negative ``_length_`` in a :class:`ctypes.Array` subclass. Also
  17021. raise :exc:`TypeError` instead of :exc:`AttributeError` for non-integer
  17022. ``_length_``. Original patch by Oren Milman.
  17023. - bpo-16806: Fix ``lineno`` and ``col_offset`` for multi-line string tokens.
  17024. - bpo-35029: :exc:`SyntaxWarning` raised as an exception at code generation
  17025. time will be now replaced with a :exc:`SyntaxError` for better error
  17026. reporting.
  17027. - bpo-34983: Expose :meth:`symtable.Symbol.is_nonlocal` in the symtable
  17028. module. Patch by Pablo Galindo.
  17029. - bpo-34974: :class:`bytes` and :class:`bytearray` constructors no longer
  17030. convert unexpected exceptions (e.g. :exc:`MemoryError` and
  17031. :exc:`KeyboardInterrupt`) to :exc:`TypeError`.
  17032. - bpo-34939: Allow annotated names in module namespace that are declared
  17033. global before the annotation happens. Patch by Pablo Galindo.
  17034. - bpo-34973: Fixed crash in :func:`bytes` when the :class:`list` argument is
  17035. mutated while it is iterated.
  17036. - bpo-34876: The *lineno* and *col_offset* attributes of the AST for
  17037. decorated function and class refer now to the position of the
  17038. corresponding ``def``, ``async def`` and ``class`` instead of the position
  17039. of the first decorator. This leads to more correct line reporting in
  17040. tracing. This is the only case when the position of child AST nodes can
  17041. precede the position of the parent AST node.
  17042. - bpo-34879: Fix a possible null pointer dereference in bytesobject.c.
  17043. Patch by Zackery Spytz.
  17044. - bpo-34784: Fix the implementation of PyStructSequence_NewType in order to
  17045. create heap allocated StructSequences.
  17046. - bpo-32912: A :exc:`SyntaxWarning` is now emitted instead of a
  17047. :exc:`DeprecationWarning` for invalid escape sequences in string and bytes
  17048. literals.
  17049. - bpo-34854: Fixed a crash in compiling string annotations containing a
  17050. lambda with a keyword-only argument that doesn't have a default value.
  17051. - bpo-34850: The compiler now produces a :exc:`SyntaxWarning` when identity
  17052. checks (``is`` and ``is not``) are used with certain types of literals
  17053. (e.g. strings, ints). These can often work by accident in CPython, but
  17054. are not guaranteed by the language spec. The warning advises users to use
  17055. equality tests (``==`` and ``!=``) instead.
  17056. - bpo-34824: Fix a possible null pointer dereference in Modules/_ssl.c.
  17057. Patch by Zackery Spytz.
  17058. - bpo-30156: The C function ``property_descr_get()`` uses a "cached" tuple
  17059. to optimize function calls. But this tuple can be discovered in debug mode
  17060. with :func:`sys.getobjects()`. Remove the optimization, it's not really
  17061. worth it and it causes 3 different crashes last years.
  17062. - bpo-34762: Fix contextvars C API to use PyObject* pointer types.
  17063. - bpo-34751: The hash function for tuples is now based on xxHash which gives
  17064. better collision results on (formerly) pathological cases. Additionally,
  17065. on 64-bit systems it improves tuple hashes in general. Patch by Jeroen
  17066. Demeyer with substantial contributions by Tim Peters.
  17067. - bpo-34735: Fix a memory leak in Modules/timemodule.c. Patch by Zackery
  17068. Spytz.
  17069. - bpo-34683: Fixed a bug where some SyntaxError error pointed to locations
  17070. that were off-by-one.
  17071. - bpo-34651: Only allow the main interpreter to fork. The avoids the
  17072. possibility of affecting the main interpreter, which is critical to
  17073. operation of the runtime.
  17074. - bpo-34653: Remove unused function PyParser_SimpleParseStringFilename.
  17075. - bpo-32236: Warn that line buffering is not supported if :func:`open` is
  17076. called with binary mode and ``buffering=1``.
  17077. - bpo-34641: Further restrict the syntax of the left-hand side of keyword
  17078. arguments in function calls. In particular, ``f((keyword)=arg)`` is now
  17079. disallowed.
  17080. - bpo-34637: Make the *start* argument to *sum()* visible as a keyword
  17081. argument.
  17082. - bpo-1621: Do not assume signed integer overflow behavior (C undefined
  17083. behavior) when performing set hash table resizing.
  17084. - bpo-34588: Fix an off-by-one in the recursive call pruning feature of
  17085. traceback formatting.
  17086. - bpo-34485: On Windows, the LC_CTYPE is now set to the user preferred
  17087. locale at startup. Previously, the LC_CTYPE locale was "C" at startup, but
  17088. changed when calling setlocale(LC_CTYPE, "") or setlocale(LC_ALL, "").
  17089. - bpo-34485: Standard streams like sys.stdout now use the "surrogateescape"
  17090. error handler, instead of "strict", on the POSIX locale (when the C locale
  17091. is not coerced and the UTF-8 Mode is disabled).
  17092. - bpo-34485: Fix the error handler of standard streams like sys.stdout:
  17093. PYTHONIOENCODING=":" is now ignored instead of setting the error handler
  17094. to "strict".
  17095. - bpo-34485: Python now gets the locale encoding with C code to initialize
  17096. the encoding of standard streams like sys.stdout. Moreover, the encoding
  17097. is now initialized to the Python codec name to get a normalized encoding
  17098. name and to ensure that the codec is loaded. The change avoids importing
  17099. _bootlocale and _locale modules at startup by default.
  17100. - bpo-34527: On FreeBSD, Py_DecodeLocale() and Py_EncodeLocale() now also
  17101. forces the ASCII encoding if the LC_CTYPE locale is "POSIX", not only if
  17102. the LC_CTYPE locale is "C".
  17103. - bpo-34527: The UTF-8 Mode is now also enabled by the "POSIX" locale, not
  17104. only by the "C" locale.
  17105. - bpo-34403: On HP-UX with C or POSIX locale, sys.getfilesystemencoding()
  17106. now returns "ascii" instead of "roman8" (when the UTF-8 Mode is disabled
  17107. and the C locale is not coerced).
  17108. - bpo-34523: The Python filesystem encoding is now read earlier during the
  17109. Python initialization.
  17110. - bpo-12458: Tracebacks show now correct line number for subexpressions in
  17111. multiline expressions. Tracebacks show now the line number of the first
  17112. line for multiline expressions instead of the line number of the last
  17113. subexpression.
  17114. - bpo-34408: Prevent a null pointer dereference and resource leakage in
  17115. ``PyInterpreterState_New()``.
  17116. - bpo-34400: Fix undefined behavior in parsetok.c. Patch by Zackery Spytz.
  17117. - bpo-33073: Added as_integer_ratio to ints to make them more interoperable
  17118. with floats.
  17119. - bpo-34377: Update valgrind suppression list to use
  17120. ``_PyObject_Free``/``_PyObject_Realloc`` instead of
  17121. ``PyObject_Free``/``PyObject_Realloc``.
  17122. - bpo-34353: Added the "socket" option in the ``stat.filemode()`` Python
  17123. implementation to match the C implementation.
  17124. - bpo-34320: Fix ``dict(od)`` didn't copy iteration order of OrderedDict.
  17125. - bpo-34113: Fixed crash on debug builds when opcode stack was adjusted with
  17126. negative numbers. Patch by Constantin Petrisor.
  17127. - bpo-34100: Compiler now merges constants in tuples and frozensets
  17128. recursively. Code attributes like ``co_names`` are merged too.
  17129. - bpo-34151: Performance of list concatenation, repetition and slicing
  17130. operations is slightly improved. Patch by Sergey Fedoseev.
  17131. - bpo-34170: -X dev: it is now possible to override the memory allocator
  17132. using PYTHONMALLOC even if the developer mode is enabled.
  17133. - bpo-33237: Improved :exc:`AttributeError` message for partially
  17134. initialized module.
  17135. - bpo-34149: Fix min and max functions to get default behavior when key is
  17136. None.
  17137. - bpo-34125: Profiling of unbound built-in methods now works when
  17138. ``**kwargs`` is given.
  17139. - bpo-34141: Optimized pickling atomic types (None, bool, int, float, bytes,
  17140. str).
  17141. - bpo-34126: Fix crashes when profiling certain invalid calls of unbound
  17142. methods. Patch by Jeroen Demeyer.
  17143. - bpo-24618: Fixed reading invalid memory when create the code object with
  17144. too small varnames tuple or too large argument counts.
  17145. - bpo-34068: In :meth:`io.IOBase.close`, ensure that the
  17146. :attr:`~io.IOBase.closed` attribute is not set with a live exception.
  17147. Patch by Zackery Spytz and Serhiy Storchaka.
  17148. - bpo-34087: Fix buffer overflow while converting unicode to numeric values.
  17149. - bpo-34080: Fixed a memory leak in the compiler when it raised some
  17150. uncommon errors during tokenizing.
  17151. - bpo-34066: Disabled interruption by Ctrl-C between calling ``open()`` and
  17152. entering a **with** block in ``with open()``.
  17153. - bpo-34042: Fix dict.copy() to maintain correct total refcount (as reported
  17154. by sys.gettotalrefcount()).
  17155. - bpo-33418: Fix potential memory leak in function object when it creates
  17156. reference cycle.
  17157. - bpo-33985: Implement contextvars.ContextVar.name attribute.
  17158. - bpo-33956: Update vendored Expat library copy to version 2.2.5.
  17159. - bpo-24596: Decref the module object in :c:func:`PyRun_SimpleFileExFlags`
  17160. before calling :c:func:`PyErr_Print()`. Patch by Zackery Spytz.
  17161. - bpo-33451: Close directly executed pyc files before calling
  17162. ``PyEval_EvalCode()``.
  17163. - bpo-1617161: The hash of :class:`BuiltinMethodType` instances (methods of
  17164. built-in classes) now depends on the hash of the identity of *__self__*
  17165. instead of its value. The hash and equality of :class:`ModuleType` and
  17166. :class:`MethodWrapperType` instances (methods of user-defined classes and
  17167. some methods of built-in classes like ``str.__add__``) now depend on the
  17168. hash and equality of the identity of *__self__* instead of its value.
  17169. :class:`MethodWrapperType` instances no longer support ordering.
  17170. - bpo-33824: Fix "LC_ALL=C python3.7 -V": reset properly the command line
  17171. parser when the encoding changes after reading the Python configuration.
  17172. - bpo-33803: Fix a crash in hamt.c caused by enabling GC tracking for an
  17173. object that hadn't all of its fields set to NULL.
  17174. - bpo-33738: Seven macro incompatibilities with the Limited API were fixed,
  17175. and the macros :c:func:`PyIter_Check`, :c:func:`PyIndex_Check` and
  17176. :c:func:`PyExceptionClass_Name` were added as functions. A script for
  17177. automatic macro checks was added.
  17178. - bpo-33786: Fix asynchronous generators to handle GeneratorExit in athrow()
  17179. correctly
  17180. - bpo-30167: ``PyRun_SimpleFileExFlags`` removes ``__cached__`` from module
  17181. in addition to ``__file__``.
  17182. - bpo-33706: Fix a crash in Python initialization when parsing the command
  17183. line options. Thanks Christoph Gohlke for the bug report and the fix!
  17184. - bpo-33597: Reduce ``PyGC_Head`` size from 3 words to 2 words.
  17185. - bpo-30654: Fixed reset of the SIGINT handler to SIG_DFL on interpreter
  17186. shutdown even when there was a custom handler set previously. Patch by
  17187. Philipp Kerling.
  17188. - bpo-33622: Fixed a leak when the garbage collector fails to add an object
  17189. with the ``__del__`` method or referenced by it into the
  17190. :data:`gc.garbage` list. :c:func:`PyGC_Collect` can now be called when an
  17191. exception is set and preserves it.
  17192. - bpo-33462: Make dict and dict views reversible. Patch by Rémi Lapeyre.
  17193. - bpo-23722: A :exc:`RuntimeError` is now raised when the custom metaclass
  17194. doesn't provide the ``__classcell__`` entry in the namespace passed to
  17195. ``type.__new__``. A :exc:`DeprecationWarning` was emitted in Python
  17196. 3.6--3.7.
  17197. - bpo-33499: Add :envvar:`PYTHONPYCACHEPREFIX` environment variable and
  17198. :option:`-X` ``pycache_prefix`` command-line option to set an alternate
  17199. root directory for writing module bytecode cache files.
  17200. - bpo-25711: The :mod:`zipimport` module has been rewritten in pure Python.
  17201. - bpo-33509: Fix module_globals parameter of warnings.warn_explicit(): don't
  17202. crash if module_globals is not a dict.
  17203. - bpo-31849: Fix signed/unsigned comparison warning in pyhash.c.
  17204. - bpo-33475: Fixed miscellaneous bugs in converting annotations to strings
  17205. and optimized parentheses in the string representation.
  17206. - bpo-20104: Added support for the ``setpgroup``, ``resetids``,
  17207. ``setsigmask``, ``setsigdef`` and ``scheduler`` parameters of
  17208. ``posix_spawn``. Patch by Pablo Galindo.
  17209. - bpo-33391: Fix a leak in set_symmetric_difference().
  17210. - bpo-33363: Raise a SyntaxError for ``async with`` and ``async for``
  17211. statements outside of async functions.
  17212. - bpo-28055: Fix unaligned accesses in siphash24(). Patch by Rolf Eike Beer.
  17213. - bpo-33128: Fix a bug that causes PathFinder to appear twice on
  17214. sys.meta_path. Patch by Pablo Galindo Salgado.
  17215. - bpo-33331: Modules imported last are now cleared first at interpreter
  17216. shutdown.
  17217. - bpo-33312: Fixed clang ubsan (undefined behavior sanitizer) warnings in
  17218. dictobject.c by adjusting how the internal struct _dictkeysobject shared
  17219. keys structure is declared.
  17220. - bpo-33305: Improved syntax error messages for invalid numerical literals.
  17221. - bpo-33306: Improved syntax error messages for unbalanced parentheses.
  17222. - bpo-33234: The list constructor will pre-size and not over-allocate when
  17223. the input length is known.
  17224. - bpo-33270: Intern the names for all anonymous code objects. Patch by
  17225. Zackery Spytz.
  17226. - bpo-30455: The C and Python code and the documentation related to tokens
  17227. are now generated from a single source file :file:`Grammar/Tokens`.
  17228. - bpo-33176: Add a ``toreadonly()`` method to memoryviews.
  17229. - bpo-33231: Fix potential memory leak in ``normalizestring()``.
  17230. - bpo-33205: Change dict growth function from
  17231. ``round_up_to_power_2(used*2+hashtable_size/2)`` to
  17232. ``round_up_to_power_2(used*3)``. Previously, dict is shrinked only when
  17233. ``used == 0``. Now dict has more chance to be shrinked.
  17234. - bpo-29922: Improved error messages in 'async with' when ``__aenter__()``
  17235. or ``__aexit__()`` return non-awaitable object.
  17236. - bpo-33199: Fix ``ma_version_tag`` in dict implementation is uninitialized
  17237. when copying from key-sharing dict.
  17238. - bpo-33053: When using the -m switch, sys.path[0] is now explicitly
  17239. expanded as the *starting* working directory, rather than being left as
  17240. the empty path (which allows imports from the current working directory at
  17241. the time of the import)
  17242. - bpo-33138: Changed standard error message for non-pickleable and
  17243. non-copyable types. It now says "cannot pickle" instead of "can't pickle"
  17244. or "cannot serialize".
  17245. - bpo-33018: Improve consistency of errors raised by ``issubclass()`` when
  17246. called with a non-class and an abstract base class as the first and second
  17247. arguments, respectively. Patch by Josh Bronson.
  17248. - bpo-33083: ``math.factorial`` no longer accepts arguments that are not
  17249. int-like. Patch by Pablo Galindo.
  17250. - bpo-33041: Added new opcode :opcode:`END_ASYNC_FOR` and fixes the
  17251. following issues:
  17252. * Setting global :exc:`StopAsyncIteration` no longer breaks ``async for``
  17253. loops.
  17254. * Jumping into an ``async for`` loop is now disabled.
  17255. * Jumping out of an ``async for`` loop no longer corrupts the stack.
  17256. - bpo-25750: Fix rare Python crash due to bad refcounting in
  17257. ``type_getattro()`` if a descriptor deletes itself from the class. Patch
  17258. by Jeroen Demeyer.
  17259. - bpo-33041: Fixed bytecode generation for "async for" with a complex
  17260. target. A StopAsyncIteration raised on assigning or unpacking will be now
  17261. propagated instead of stopping the iteration.
  17262. - bpo-33026: Fixed jumping out of "with" block by setting f_lineno.
  17263. - bpo-33005: Fix a crash on fork when using a custom memory allocator (ex:
  17264. using PYTHONMALLOC env var). _PyGILState_Reinit() and
  17265. _PyInterpreterState_Enable() now use the default RAW memory allocator to
  17266. allocate a new interpreters mutex on fork.
  17267. - bpo-32911: Due to unexpected compatibility issues discovered during
  17268. downstream beta testing, reverted :issue:`29463`. ``docstring`` field is
  17269. removed from Module, ClassDef, FunctionDef, and AsyncFunctionDef ast nodes
  17270. which was added in 3.7a1. Docstring expression is restored as a first
  17271. statement in their body. Based on patch by Inada Naoki.
  17272. - bpo-17288: Prevent jumps from 'return' and 'exception' trace events.
  17273. - bpo-32946: Importing names from already imported module with "from ...
  17274. import ..." is now 30% faster if the module is not a package.
  17275. - bpo-32932: Make error message more revealing when there are non-str
  17276. objects in ``__all__``.
  17277. - bpo-32925: Optimized iterating and containing test for literal lists
  17278. consisting of non-constants: ``x in [a, b]`` and ``for x in [a, b]``. The
  17279. case of all constant elements already was optimized.
  17280. - bpo-32889: Update Valgrind suppression list to account for the rename of
  17281. ``Py_ADDRESS_IN_RANG`` to ``address_in_range``.
  17282. - bpo-32836: Don't use temporary variables in cases of list/dict/set
  17283. comprehensions
  17284. - bpo-31356: Remove the new API added in bpo-31356 (gc.ensure_disabled()
  17285. context manager).
  17286. - bpo-32305: For namespace packages, ensure that both ``__file__`` and
  17287. ``__spec__.origin`` are set to None.
  17288. - bpo-32303: Make sure ``__spec__.loader`` matches ``__loader__`` for
  17289. namespace packages.
  17290. - bpo-32711: Fix the warning messages for Python/ast_unparse.c. Patch by
  17291. Stéphane Wirtel
  17292. - bpo-32583: Fix possible crashing in builtin Unicode decoders caused by
  17293. write out-of-bound errors when using customized decode error handlers.
  17294. - bpo-32489: A :keyword:`continue` statement is now allowed in the
  17295. :keyword:`finally` clause.
  17296. - bpo-17611: Simplified the interpreter loop by moving the logic of
  17297. unrolling the stack of blocks into the compiler. The compiler emits now
  17298. explicit instructions for adjusting the stack of values and calling the
  17299. cleaning up code for :keyword:`break`, :keyword:`continue` and
  17300. :keyword:`return`.
  17301. Removed opcodes :opcode:`BREAK_LOOP`, :opcode:`CONTINUE_LOOP`,
  17302. :opcode:`SETUP_LOOP` and :opcode:`SETUP_EXCEPT`. Added new opcodes
  17303. :opcode:`ROT_FOUR`, :opcode:`BEGIN_FINALLY` and :opcode:`CALL_FINALLY` and
  17304. :opcode:`POP_FINALLY`. Changed the behavior of :opcode:`END_FINALLY` and
  17305. :opcode:`WITH_CLEANUP_START`.
  17306. - bpo-32285: New function unicodedata.is_normalized, which can check whether
  17307. a string is in a specific normal form.
  17308. - bpo-10544: Yield expressions are now disallowed in comprehensions and
  17309. generator expressions except the expression for the outermost iterable.
  17310. - bpo-32117: Iterable unpacking is now allowed without parentheses in yield
  17311. and return statements, e.g. ``yield 1, 2, 3, *rest``. Thanks to David
  17312. Cuthbert for the change and Jordan Chapman for added tests.
  17313. - bpo-31902: Fix the ``col_offset`` attribute for ast nodes
  17314. ``ast.AsyncFor``, ``ast.AsyncFunctionDef``, and ``ast.AsyncWith``.
  17315. Previously, ``col_offset`` pointed to the keyword after ``async``.
  17316. - bpo-25862: Fix assertion failures in the ``tell()`` method of
  17317. ``io.TextIOWrapper``. Patch by Zackery Spytz.
  17318. - bpo-21983: Fix a crash in ``ctypes.cast()`` in case the type argument is a
  17319. ctypes structured data type. Patch by Eryk Sun and Oren Milman.
  17320. - bpo-31577: Fix a crash in ``os.utime()`` in case of a bad ns argument.
  17321. Patch by Oren Milman.
  17322. - bpo-29832: Remove references to 'getsockaddrarg' from various socket error
  17323. messages. Patch by Oren Milman.
  17324. Library
  17325. -------
  17326. - bpo-35845: Add 'order' parameter to memoryview.tobytes().
  17327. - bpo-35864: The _asdict() method for collections.namedtuple now returns a
  17328. regular dict instead of an OrderedDict.
  17329. - bpo-35537: An ExitStack is now used internally within subprocess.Popen to
  17330. clean up pipe file handles. No behavior change in normal operation. But if
  17331. closing one handle were ever to cause an exception, the others will now be
  17332. closed instead of leaked. (patch by Giampaolo Rodola)
  17333. - bpo-35847: RISC-V needed the CTYPES_PASS_BY_REF_HACK. Fixes ctypes
  17334. Structure test_pass_by_value.
  17335. - bpo-35813: Shared memory submodule added to multiprocessing to avoid need
  17336. for serialization between processes
  17337. - bpo-35780: Fix lru_cache() errors arising in recursive, reentrant, or
  17338. multi-threaded code. These errors could result in orphan links and in the
  17339. cache being trapped in a state with fewer than the specified maximum
  17340. number of links. Fix handling of negative maxsize which should have been
  17341. treated as zero. Fix errors in toggling the "full" status flag. Fix
  17342. misordering of links when errors are encountered. Sync-up the C code and
  17343. pure Python code for the space saving path in functions with a single
  17344. positional argument. In this common case, the space overhead of an lru
  17345. cache entry is reduced by almost half. Fix counting of cache misses. In
  17346. error cases, the miss count was out of sync with the actual number of
  17347. times the underlying user function was called.
  17348. - bpo-35537: :func:`os.posix_spawn` and :func:`os.posix_spawnp` now have a
  17349. *setsid* parameter.
  17350. - bpo-23846: :class:`asyncio.ProactorEventLoop` now catches and logs send
  17351. errors when the self-pipe is full.
  17352. - bpo-34323: :mod:`asyncio`: Enhance ``IocpProactor.close()`` log: wait 1
  17353. second before the first log, then log every second. Log also the number of
  17354. seconds since ``close()`` was called.
  17355. - bpo-35674: Add a new :func:`os.posix_spawnp` function. Patch by Joannah
  17356. Nanjekye.
  17357. - bpo-35733: ``ast.Constant(boolean)`` no longer an instance of
  17358. :class:`ast.Num`. Patch by Anthony Sottile.
  17359. - bpo-35726: QueueHandler.prepare() now makes a copy of the record before
  17360. modifying and enqueueing it, to avoid affecting other handlers in the
  17361. chain.
  17362. - bpo-35719: Sped up multi-argument :mod:`math` functions atan2(),
  17363. copysign(), remainder() and hypot() by 1.3--2.5 times.
  17364. - bpo-35717: Fix KeyError exception raised when using enums and compile.
  17365. Patch contributed by Rémi Lapeyre.
  17366. - bpo-35699: Fixed detection of Visual Studio Build Tools 2017 in distutils
  17367. - bpo-32710: Fix memory leaks in asyncio ProactorEventLoop on overlapped
  17368. operation failure.
  17369. - bpo-35702: The :const:`time.CLOCK_UPTIME_RAW` constant is now available
  17370. for macOS 10.12.
  17371. - bpo-32710: Fix a memory leak in asyncio in the ProactorEventLoop when
  17372. ``ReadFile()`` or ``WSASend()`` overlapped operation fail immediately:
  17373. release the internal buffer.
  17374. - bpo-35682: Fix ``asyncio.ProactorEventLoop.sendfile()``: don't attempt to
  17375. set the result of an internal future if it's already done.
  17376. - bpo-35283: Add a deprecated warning for the
  17377. :meth:`threading.Thread.isAlive` method. Patch by Donghee Na.
  17378. - bpo-35664: Improve operator.itemgetter() performance by 33% with optimized
  17379. argument handling and with adding a fast path for the common case of a
  17380. single non-negative integer index into a tuple (which is the typical use
  17381. case in the standard library).
  17382. - bpo-35643: Fixed a SyntaxWarning: invalid escape sequence in
  17383. Modules/_sha3/cleanup.py. Patch by Mickaël Schoentgen.
  17384. - bpo-35619: Improved support of custom data descriptors in :func:`help` and
  17385. :mod:`pydoc`.
  17386. - bpo-28503: The ``crypt`` module now internally uses the ``crypt_r()``
  17387. library function instead of ``crypt()`` when available.
  17388. - bpo-35614: Fixed help() on metaclasses. Patch by Sanyam Khurana.
  17389. - bpo-35568: Expose ``raise(signum)`` as ``raise_signal``
  17390. - bpo-35588: The floor division and modulo operations and the :func:`divmod`
  17391. function on :class:`fractions.Fraction` types are 2--4x faster. Patch by
  17392. Stefan Behnel.
  17393. - bpo-35585: Speed-up building enums by value, e.g. http.HTTPStatus(200).
  17394. - bpo-30561: random.gammavariate(1.0, beta) now computes the same result as
  17395. random.expovariate(1.0 / beta). This synchronizes the two algorithms and
  17396. eliminates some idiosyncrasies in the old implementation. It does however
  17397. produce a difference stream of random variables than it used to.
  17398. - bpo-35537: The :mod:`subprocess` module can now use the
  17399. :func:`os.posix_spawn` function in some cases for better performance.
  17400. - bpo-35526: Delaying the 'joke' of barry_as_FLUFL.mandatory to Python
  17401. version 4.0
  17402. - bpo-35523: Remove :mod:`ctypes` callback workaround: no longer create a
  17403. callback at startup. Avoid SELinux alert on ``import ctypes`` and ``import
  17404. uuid``.
  17405. - bpo-31784: :func:`uuid.uuid1` now calls :func:`time.time_ns` rather than
  17406. ``int(time.time() * 1e9)``.
  17407. - bpo-35513: :class:`~unittest.runner.TextTestRunner` of
  17408. :mod:`unittest.runner` now uses :func:`time.perf_counter` rather than
  17409. :func:`time.time` to measure the execution time of a test:
  17410. :func:`time.time` can go backwards, whereas :func:`time.perf_counter` is
  17411. monotonic.
  17412. - bpo-35502: Fixed reference leaks in
  17413. :class:`xml.etree.ElementTree.TreeBuilder` in case of unfinished building
  17414. of the tree (in particular when an error was raised during parsing XML).
  17415. - bpo-35348: Make :func:`platform.architecture` parsing of ``file`` command
  17416. output more reliable: add the ``-b`` option to the ``file`` command to
  17417. omit the filename, force the usage of the C locale, and search also the
  17418. "shared object" pattern.
  17419. - bpo-35491: :mod:`multiprocessing`: Add ``Pool.__repr__()`` and enhance
  17420. ``BaseProcess.__repr__()`` (add pid and parent pid) to ease debugging.
  17421. Pool state constant values are now strings instead of integers, for
  17422. example ``RUN`` value becomes ``'RUN'`` instead of ``0``.
  17423. - bpo-35477: :meth:`multiprocessing.Pool.__enter__` now fails if the pool is
  17424. not running: ``with pool:`` fails if used more than once.
  17425. - bpo-31446: Copy command line that was passed to CreateProcessW since this
  17426. function can change the content of the input buffer.
  17427. - bpo-35471: Python 2.4 dropped MacOS 9 support. The macpath module was
  17428. deprecated in Python 3.7. The module is now removed.
  17429. - bpo-23057: Unblock Proactor event loop when keyboard interrupt is received
  17430. on Windows
  17431. - bpo-35052: Fix xml.dom.minidom cloneNode() on a document with an entity:
  17432. pass the correct arguments to the user data handler of an entity.
  17433. - bpo-20239: Allow repeated assignment deletion of
  17434. :class:`unittest.mock.Mock` attributes. Patch by Pablo Galindo.
  17435. - bpo-17185: Set ``__signature__`` on mock for :mod:`inspect` to get
  17436. signature. Patch by Karthikeyan Singaravelan.
  17437. - bpo-35445: Memory errors during creating posix.environ no longer ignored.
  17438. - bpo-35415: Validate fileno= argument to socket.socket().
  17439. - bpo-35424: :class:`multiprocessing.Pool` destructor now emits
  17440. :exc:`ResourceWarning` if the pool is still running.
  17441. - bpo-35330: When a :class:`Mock` instance was used to wrap an object, if
  17442. ``side_effect`` is used in one of the mocks of it methods, don't call the
  17443. original implementation and return the result of using the side effect the
  17444. same way that it is done with return_value.
  17445. - bpo-35346: Drop Mac OS 9 and Rhapsody support from the :mod:`platform`
  17446. module. Rhapsody last release was in 2000. Mac OS 9 last release was in
  17447. 2001.
  17448. - bpo-10496: :func:`~distutils.utils.check_environ` of ``distutils.utils``
  17449. now catches :exc:`KeyError` on calling :func:`pwd.getpwuid`: don't create
  17450. the ``HOME`` environment variable in this case.
  17451. - bpo-10496: :func:`posixpath.expanduser` now returns the input *path*
  17452. unchanged if the ``HOME`` environment variable is not set and the current
  17453. user has no home directory (if the current user identifier doesn't exist
  17454. in the password database). This change fix the :mod:`site` module if the
  17455. current user doesn't exist in the password database (if the user has no
  17456. home directory).
  17457. - bpo-35389: :func:`platform.libc_ver` now uses
  17458. ``os.confstr('CS_GNU_LIBC_VERSION')`` if available and the *executable*
  17459. parameter is not set.
  17460. - bpo-35394: Add empty slots to asyncio abstract protocols.
  17461. - bpo-35310: Fix a bug in :func:`select.select` where, in some cases, the
  17462. file descriptor sequences were returned unmodified after a signal
  17463. interruption, even though the file descriptors might not be ready yet.
  17464. :func:`select.select` will now always return empty lists if a timeout has
  17465. occurred. Patch by Oran Avraham.
  17466. - bpo-35380: Enable TCP_NODELAY on Windows for proactor asyncio event loop.
  17467. - bpo-35341: Add generic version of ``collections.OrderedDict`` to the
  17468. ``typing`` module. Patch by Ismo Toijala.
  17469. - bpo-35371: Fixed possible crash in ``os.utime()`` on Windows when pass
  17470. incorrect arguments.
  17471. - bpo-35346: :func:`platform.uname` now redirects ``stderr`` to
  17472. :data:`os.devnull` when running external programs like ``cmd /c ver``.
  17473. - bpo-35066: Previously, calling the strftime() method on a datetime object
  17474. with a trailing '%' in the format string would result in an exception.
  17475. However, this only occurred when the datetime C module was being used; the
  17476. python implementation did not match this behavior. Datetime is now PEP-399
  17477. compliant, and will not throw an exception on a trailing '%'.
  17478. - bpo-35345: The function ``platform.popen`` has been removed, it was
  17479. deprecated since Python 3.3: use :func:`os.popen` instead.
  17480. - bpo-35344: On macOS, :func:`platform.platform` now uses
  17481. :func:`platform.mac_ver`, if it returns a non-empty release string, to get
  17482. the macOS version rather than the darwin version.
  17483. - bpo-35312: Make ``lib2to3.pgen2.parse.ParseError`` round-trip pickle-able.
  17484. Patch by Anthony Sottile.
  17485. - bpo-35308: Fix regression in ``webbrowser`` where default browsers may be
  17486. preferred over browsers in the ``BROWSER`` environment variable.
  17487. - bpo-24746: Avoid stripping trailing whitespace in doctest fancy diff.
  17488. Original patch by R. David Murray & Jairo Trad. Enhanced by Sanyam
  17489. Khurana.
  17490. - bpo-28604: :func:`locale.localeconv` now sets temporarily the ``LC_CTYPE``
  17491. locale to the ``LC_MONETARY`` locale if the two locales are different and
  17492. monetary strings are non-ASCII. This temporary change affects other
  17493. threads.
  17494. - bpo-35277: Update ensurepip to install pip 18.1 and setuptools 40.6.2.
  17495. - bpo-24209: Adds IPv6 support when invoking http.server directly.
  17496. - bpo-35226: Recursively check arguments when testing for equality of
  17497. :class:`unittest.mock.call` objects and add note that tracking of
  17498. parameters used to create ancestors of mocks in ``mock_calls`` is not
  17499. possible.
  17500. - bpo-29564: The warnings module now suggests to enable tracemalloc if the
  17501. source is specified, the tracemalloc module is available, but tracemalloc
  17502. is not tracing memory allocations.
  17503. - bpo-35189: Modify the following fnctl function to retry if interrupted by
  17504. a signal (EINTR): flock, lockf, fnctl
  17505. - bpo-30064: Use add_done_callback() in sock_* asyncio API to unsubscribe
  17506. reader/writer early on calcellation.
  17507. - bpo-35186: Removed the "built with" comment added when ``setup.py upload``
  17508. is used with either ``bdist_rpm`` or ``bdist_dumb``.
  17509. - bpo-35152: Allow sending more than 2 GB at once on a multiprocessing
  17510. connection on non-Windows systems.
  17511. - bpo-35062: Fix incorrect parsing of
  17512. :class:`_io.IncrementalNewlineDecoder`'s *translate* argument.
  17513. - bpo-35065: Remove ``StreamReaderProtocol._untrack_reader``. The call to
  17514. ``_untrack_reader`` is currently performed too soon, causing the protocol
  17515. to forget about the reader before ``connection_lost`` can run and feed the
  17516. EOF to the reader.
  17517. - bpo-34160: ElementTree and minidom now preserve the attribute order
  17518. specified by the user.
  17519. - bpo-35079: Improve difflib.SequenceManager.get_matching_blocks doc by
  17520. adding 'non-overlapping' and changing '!=' to '<'.
  17521. - bpo-33710: Deprecated ``l*gettext()`` functions and methods in the
  17522. :mod:`gettext` module. They return encoded bytes instead of Unicode
  17523. strings and are artifacts from Python 2 times. Also deprecated functions
  17524. and methods related to setting the charset for ``l*gettext()`` functions
  17525. and methods.
  17526. - bpo-35017: :meth:`socketserver.BaseServer.serve_forever` now exits
  17527. immediately if it's :meth:`~socketserver.BaseServer.shutdown` method is
  17528. called while it is polling for new events.
  17529. - bpo-35024: ``importlib`` no longer logs ``wrote <bytecode path>``
  17530. redundantly after ``(created|could not create) <bytecode path>`` is
  17531. already logged. Patch by Quentin Agren.
  17532. - bpo-35047: ``unittest.mock`` now includes mock calls in exception messages
  17533. if ``assert_not_called``, ``assert_called_once``, or
  17534. ``assert_called_once_with`` fails. Patch by Petter Strandmark.
  17535. - bpo-31047: Fix ``ntpath.abspath`` regression where it didn't remove a
  17536. trailing separator on Windows. Patch by Tim Graham.
  17537. - bpo-35053: tracemalloc now tries to update the traceback when an object is
  17538. reused from a "free list" (optimization for faster object creation, used
  17539. by the builtin list type for example).
  17540. - bpo-31553: Add the --json-lines option to json.tool. Patch by hongweipeng.
  17541. - bpo-34794: Fixed a leak in Tkinter when pass the Python wrapper around
  17542. Tcl_Obj back to Tcl/Tk.
  17543. - bpo-34909: Enum: fix grandchildren subclassing when parent mixed with
  17544. concrete data types.
  17545. - bpo-35022: :class:`unittest.mock.MagicMock` now supports the
  17546. ``__fspath__`` method (from :class:`os.PathLike`).
  17547. - bpo-35008: Fixed references leaks when call the ``__setstate__()`` method
  17548. of :class:`xml.etree.ElementTree.Element` in the C implementation for
  17549. already initialized element.
  17550. - bpo-23420: Verify the value for the parameter '-s' of the cProfile CLI.
  17551. Patch by Robert Kuska
  17552. - bpo-33947: dataclasses now handle recursive reprs without raising
  17553. RecursionError.
  17554. - bpo-34890: Make :func:`inspect.iscoroutinefunction`,
  17555. :func:`inspect.isgeneratorfunction` and :func:`inspect.isasyncgenfunction`
  17556. work with :func:`functools.partial`. Patch by Pablo Galindo.
  17557. - bpo-34521: Use :func:`socket.CMSG_SPACE` to calculate ancillary data size
  17558. instead of :func:`socket.CMSG_LEN` in
  17559. :func:`multiprocessing.reduction.recvfds` as :rfc:`3542` requires the use
  17560. of the former for portable applications.
  17561. - bpo-31522: The ``mailbox.mbox.get_string`` function *from_* parameter can
  17562. now successfully be set to a non-default value.
  17563. - bpo-34970: Protect tasks weak set manipulation in ``asyncio.all_tasks()``
  17564. - bpo-34969: gzip: Add --fast, --best on the gzip CLI, these parameters will
  17565. be used for the fast compression method (quick) or the best method
  17566. compress (slower, but smaller file). Also, change the default compression
  17567. level to 6 (tradeoff).
  17568. - bpo-16965: The :term:`2to3` :2to3fixer:`execfile` fixer now opens the file
  17569. with mode ``'rb'``. Patch by Zackery Spytz.
  17570. - bpo-34966: :mod:`pydoc` now supports aliases not only to methods defined
  17571. in the end class, but also to inherited methods. The docstring is not
  17572. duplicated for aliases.
  17573. - bpo-34926: :meth:`mimetypes.MimeTypes.guess_type` now accepts
  17574. :term:`path-like object` in addition to url strings. Patch by Mayank
  17575. Asthana.
  17576. - bpo-23831: Add ``moveto()`` method to the ``tkinter.Canvas`` widget. Patch
  17577. by Juliette Monsel.
  17578. - bpo-34941: Methods ``find()``, ``findtext()`` and ``findall()`` of the
  17579. ``Element`` class in the :mod:`xml.etree.ElementTree` module are now able
  17580. to find children which are instances of ``Element`` subclasses.
  17581. - bpo-32680: :class:`smtplib.SMTP` objects now always have a ``sock``
  17582. attribute present
  17583. - bpo-34769: Fix for async generators not finalizing when event loop is in
  17584. debug mode and garbage collector runs in another thread.
  17585. - bpo-34936: Fix ``TclError`` in ``tkinter.Spinbox.selection_element()``.
  17586. Patch by Juliette Monsel.
  17587. - bpo-34829: Add methods ``selection_from``, ``selection_range``,
  17588. ``selection_present`` and ``selection_to`` to the ``tkinter.Spinbox`` for
  17589. consistency with the ``tkinter.Entry`` widget. Patch by Juliette Monsel.
  17590. - bpo-34911: Added *secure_protocols* argument to
  17591. *http.cookiejar.DefaultCookiePolicy* to allow for tweaking of protocols
  17592. and also to add support by default for *wss*, the secure websocket
  17593. protocol.
  17594. - bpo-34922: Fixed integer overflow in the :meth:`~hashlib.shake.digest()`
  17595. and :meth:`~hashlib.shake.hexdigest()` methods for the SHAKE algorithm in
  17596. the :mod:`hashlib` module.
  17597. - bpo-34925: 25% speedup in argument parsing for the functions in the bisect
  17598. module.
  17599. - bpo-34900: Fixed :meth:`unittest.TestCase.debug` when used to call test
  17600. methods with subtests. Patch by Bruno Oliveira.
  17601. - bpo-34844: logging.Formatter enhancement - Ensure styles and fmt matches
  17602. in logging.Formatter - Added validate method in each format style class:
  17603. StrFormatStyle, PercentStyle, StringTemplateStyle. - This method is called
  17604. in the constructor of logging.Formatter class - Also re-raise the KeyError
  17605. in the format method of each style class, so it would a bit clear that
  17606. it's an error with the invalid format fields.
  17607. - bpo-34897: Adjust test.support.missing_compiler_executable check so that a
  17608. nominal command name of "" is ignored. Patch by Michael Felt.
  17609. - bpo-34871: Fix inspect module polluted ``sys.modules`` when parsing
  17610. ``__text_signature__`` of callable.
  17611. - bpo-34898: Add ``mtime`` argument to ``gzip.compress`` for reproducible
  17612. output. Patch by Guo Ci Teo.
  17613. - bpo-28441: On Cygwin and MinGW, ensure that ``sys.executable`` always
  17614. includes the full filename in the path, including the ``.exe`` suffix
  17615. (unless it is a symbolic link).
  17616. - bpo-34866: Adding ``max_num_fields`` to ``cgi.FieldStorage`` to make DOS
  17617. attacks harder by limiting the number of ``MiniFieldStorage`` objects
  17618. created by ``FieldStorage``.
  17619. - bpo-34711: http.server ensures it reports HTTPStatus.NOT_FOUND when the
  17620. local path ends with "/" and is not a directory, even if the underlying OS
  17621. (e.g. AIX) accepts such paths as a valid file reference. Patch by Michael
  17622. Felt.
  17623. - bpo-34872: Fix self-cancellation in C implementation of asyncio.Task
  17624. - bpo-34849: Don't log waiting for ``selector.select`` in asyncio loop
  17625. iteration. The waiting is pretty normal for any asyncio program, logging
  17626. its time just adds a noise to logs without any useful information
  17627. provided.
  17628. - bpo-34022: The :envvar:`SOURCE_DATE_EPOCH` environment variable no longer
  17629. overrides the value of the *invalidation_mode* argument to
  17630. :func:`py_compile.compile`, and determines its default value instead.
  17631. - bpo-34819: Use a monotonic clock to compute timeouts in
  17632. :meth:`Executor.map` and :func:`as_completed`, in order to prevent
  17633. timeouts from deviating when the system clock is adjusted.
  17634. - bpo-34758: Add .wasm -> application/wasm to list of recognized file types
  17635. and content type headers
  17636. - bpo-34789: :func:`xml.sax.make_parser` now accepts any iterable as its
  17637. *parser_list* argument. Patch by Andrés Delfino.
  17638. - bpo-34334: In :class:`QueueHandler`, clear ``exc_text`` from
  17639. :class:`LogRecord` to prevent traceback from being written twice.
  17640. - bpo-34687: On Windows, asyncio now uses ProactorEventLoop, instead of
  17641. SelectorEventLoop, by default.
  17642. - bpo-5950: Support reading zip files with archive comments in
  17643. :mod:`zipimport`.
  17644. - bpo-32892: The parser now represents all constants as
  17645. :class:`ast.Constant` instead of using specific constant AST types
  17646. (``Num``, ``Str``, ``Bytes``, ``NameConstant`` and ``Ellipsis``). These
  17647. classes are considered deprecated and will be removed in future Python
  17648. versions.
  17649. - bpo-34728: Add deprecation warning when ``loop`` is used in methods:
  17650. ``asyncio.sleep``, ``asyncio.wait`` and ``asyncio.wait_for``.
  17651. - bpo-34738: ZIP files created by ``distutils`` will now include entries for
  17652. directories.
  17653. - bpo-34659: Add an optional *initial* argument to itertools.accumulate().
  17654. - bpo-29577: Support multiple mixin classes when creating Enums.
  17655. - bpo-34670: Add SSLContext.post_handshake_auth and
  17656. SSLSocket.verify_client_post_handshake for TLS 1.3's post handshake
  17657. authentication feature.
  17658. - bpo-32718: The Activate.ps1 script from venv works with PowerShell Core
  17659. 6.1 and is now available under all operating systems.
  17660. - bpo-31177: Fix bug that prevented using :meth:`reset_mock
  17661. <unittest.mock.Mock.reset_mock>` on mock instances with deleted attributes
  17662. - bpo-34672: Add a workaround, so the ``'Z'`` :func:`time.strftime`
  17663. specifier on the musl C library can work in some cases.
  17664. - bpo-34666: Implement ``asyncio.StreamWriter.awrite`` and
  17665. ``asyncio.StreamWriter.aclose()`` coroutines. Methods are needed for
  17666. providing a consistent stream API with control flow switched on by
  17667. default.
  17668. - bpo-6721: Acquire the logging module's commonly used internal locks while
  17669. fork()ing to avoid deadlocks in the child process.
  17670. - bpo-34658: Fix a rare interpreter unhandled exception state SystemError
  17671. only seen when using subprocess with a preexec_fn while an after_parent
  17672. handler has been registered with os.register_at_fork and the fork system
  17673. call fails.
  17674. - bpo-34652: Ensure :func:`os.lchmod` is never defined on Linux.
  17675. - bpo-34638: Store a weak reference to stream reader to break strong
  17676. references loop between reader and protocol. It allows to detect and
  17677. close the socket if the stream is deleted (garbage collected) without
  17678. ``close()`` call.
  17679. - bpo-34536: ``Enum._missing_``: raise ``ValueError`` if None returned and
  17680. ``TypeError`` if non-member is returned.
  17681. - bpo-34636: Speed up re scanning of many non-matching characters for \s \w
  17682. and \d within bytes objects. (microoptimization)
  17683. - bpo-24412: Add :func:`~unittest.addModuleCleanup()` and
  17684. :meth:`~unittest.TestCase.addClassCleanup()` to unittest to support
  17685. cleanups for :func:`~unittest.setUpModule()` and
  17686. :meth:`~unittest.TestCase.setUpClass()`. Patch by Lisa Roach.
  17687. - bpo-34630: Don't log SSL certificate errors in asyncio code (connection
  17688. error logging is skipped already).
  17689. - bpo-32490: Prevent filename duplication in :mod:`subprocess` exception
  17690. messages. Patch by Zackery Spytz.
  17691. - bpo-34363: dataclasses.asdict() and .astuple() now handle namedtuples
  17692. correctly.
  17693. - bpo-34625: Update vendorized expat library version to 2.2.6.
  17694. - bpo-32270: The subprocess module no longer mistakenly closes redirected
  17695. fds even when they were in pass_fds when outside of the default {0, 1, 2}
  17696. set.
  17697. - bpo-34622: Create a dedicated ``asyncio.CancelledError``,
  17698. ``asyncio.InvalidStateError`` and ``asyncio.TimeoutError`` exception
  17699. classes. Inherit them from corresponding exceptions from
  17700. ``concurrent.futures`` package. Extract ``asyncio`` exceptions into a
  17701. separate file.
  17702. - bpo-34610: Fixed iterator of :class:`multiprocessing.managers.DictProxy`.
  17703. - bpo-34421: Fix distutils logging for non-ASCII strings. This caused
  17704. installation issues on Windows.
  17705. - bpo-34604: Fix possible mojibake in the error message of ``pwd.getpwnam``
  17706. and ``grp.getgrnam`` using string representation because of invisible
  17707. characters or trailing whitespaces. Patch by William Grzybowski.
  17708. - bpo-30977: Make uuid.UUID use ``__slots__`` to reduce its memory
  17709. footprint. Based on original patch by Wouter Bolsterlee.
  17710. - bpo-34574: OrderedDict iterators are not exhausted during pickling
  17711. anymore. Patch by Sergey Fedoseev.
  17712. - bpo-8110: Refactored :mod:`subprocess` to check for Windows-specific
  17713. modules rather than ``sys.platform == 'win32'``.
  17714. - bpo-34530: ``distutils.spawn.find_executable()`` now falls back on
  17715. :data:`os.defpath` if the ``PATH`` environment variable is not set.
  17716. - bpo-34563: On Windows, fix multiprocessing.Connection for very large read:
  17717. fix _winapi.PeekNamedPipe() and _winapi.ReadFile() for read larger than
  17718. INT_MAX (usually ``2**31-1``).
  17719. - bpo-34558: Correct typo in Lib/ctypes/_aix.py
  17720. - bpo-34282: Move ``Enum._convert`` to ``EnumMeta._convert_`` and fix enum
  17721. members getting shadowed by parent attributes.
  17722. - bpo-22872: When the queue is closed, :exc:`ValueError` is now raised by
  17723. :meth:`multiprocessing.Queue.put` and :meth:`multiprocessing.Queue.get`
  17724. instead of :exc:`AssertionError` and :exc:`OSError`, respectively. Patch
  17725. by Zackery Spytz.
  17726. - bpo-34515: Fix parsing non-ASCII identifiers in
  17727. :mod:`!lib2to3.pgen2.tokenize` (:pep:`3131`).
  17728. - bpo-13312: Avoids a possible integer underflow (undefined behavior) in the
  17729. time module's year handling code when passed a very low negative year
  17730. value.
  17731. - bpo-34472: Improved compatibility for streamed files in :mod:`zipfile`.
  17732. Previously an optional signature was not being written and certain ZIP
  17733. applications were not supported. Patch by Silas Sewell.
  17734. - bpo-34454: Fix the .fromisoformat() methods of datetime types crashing
  17735. when given unicode with non-UTF-8-encodable code points. Specifically,
  17736. datetime.fromisoformat() now accepts surrogate unicode code points used as
  17737. the separator. Report and tests by Alexey Izbyshev, patch by Paul Ganssle.
  17738. - bpo-6700: Fix inspect.getsourcelines for module level frames/tracebacks.
  17739. Patch by Vladimir Matveev.
  17740. - bpo-34171: Running the :mod:`trace` module no longer creates the
  17741. ``trace.cover`` file.
  17742. - bpo-34441: Fix crash when an ``ABC``-derived class with invalid
  17743. ``__subclasses__`` is passed as the second argument to
  17744. :func:`issubclass()`. Patch by Alexey Izbyshev.
  17745. - bpo-34427: Fix infinite loop in ``a.extend(a)`` for ``MutableSequence``
  17746. subclasses.
  17747. - bpo-34412: Make :func:`signal.strsignal` work on HP-UX. Patch by Michael
  17748. Osipov.
  17749. - bpo-20849: shutil.copytree now accepts a new ``dirs_exist_ok`` keyword
  17750. argument. Patch by Josh Bronson.
  17751. - bpo-31715: Associate ``.mjs`` file extension with
  17752. ``application/javascript`` MIME Type.
  17753. - bpo-34384: :func:`os.readlink` now accepts :term:`path-like <path-like
  17754. object>` and :class:`bytes` objects on Windows.
  17755. - bpo-22602: The UTF-7 decoder now raises :exc:`UnicodeDecodeError` for
  17756. ill-formed sequences starting with "+" (as specified in RFC 2152). Patch
  17757. by Zackery Spytz.
  17758. - bpo-2122: The :meth:`mmap.flush() <mmap.mmap.flush>` method now returns
  17759. ``None`` on success, raises an exception on error under all platforms.
  17760. - bpo-34341: Appending to the ZIP archive with the ZIP64 extension no longer
  17761. grows the size of extra fields of existing entries.
  17762. - bpo-34333: Fix %-formatting in :meth:`pathlib.PurePath.with_suffix` when
  17763. formatting an error message.
  17764. - bpo-18540: The :class:`imaplib.IMAP4` and :class:`imaplib.IMAP4_SSL`
  17765. classes now resolve to the local host IP correctly when the default value
  17766. of *host* parameter (``''``) is used.
  17767. - bpo-26502: Implement ``traceback.FrameSummary.__len__()`` method to
  17768. preserve compatibility with the old tuple API.
  17769. - bpo-34318: :func:`~unittest.TestCase.assertRaises`,
  17770. :func:`~unittest.TestCase.assertRaisesRegex`,
  17771. :func:`~unittest.TestCase.assertWarns` and
  17772. :func:`~unittest.TestCase.assertWarnsRegex` no longer success if the
  17773. passed callable is None. They no longer ignore unknown keyword arguments
  17774. in the context manager mode. A DeprecationWarning was raised in these
  17775. cases since Python 3.5.
  17776. - bpo-9372: Deprecate :meth:`~object.__getitem__` methods of
  17777. :class:`xml.dom.pulldom.DOMEventStream`, :class:`wsgiref.util.FileWrapper`
  17778. and :class:`fileinput.FileInput`.
  17779. - bpo-33613: Fix a race condition in ``multiprocessing.semaphore_tracker``
  17780. when the tracker receives SIGINT before it can register signal handlers
  17781. for ignoring it.
  17782. - bpo-34248: Report filename in the exception raised when the database file
  17783. cannot be opened by :func:`dbm.gnu.open` and :func:`dbm.ndbm.open` due to
  17784. OS-related error. Patch by Zsolt Cserna.
  17785. - bpo-33089: Add math.dist() to compute the Euclidean distance between two
  17786. points.
  17787. - bpo-34246: :meth:`smtplib.SMTP.send_message` no longer modifies the
  17788. content of the *mail_options* argument. Patch by Pablo S. Blum de Aguiar.
  17789. - bpo-31047: Fix ``ntpath.abspath`` for invalid paths on windows. Patch by
  17790. Franz Woellert.
  17791. - bpo-32321: Add pure Python fallback for functools.reduce. Patch by Robert
  17792. Wright.
  17793. - bpo-34270: The default asyncio task class now always has a name which can
  17794. be get or set using two new methods (:meth:`~asyncio.Task.get_name()` and
  17795. :meth:`~asyncio.Task.set_name`) and is visible in the :func:`repr` output.
  17796. An initial name can also be set using the new ``name`` keyword argument to
  17797. :func:`asyncio.create_task` or the
  17798. :meth:`~asyncio.AbstractEventLoop.create_task` method of the event loop.
  17799. If no initial name is set, the default Task implementation generates a
  17800. name like ``Task-1`` using a monotonic counter.
  17801. - bpo-34263: asyncio's event loop will not pass timeouts longer than one day
  17802. to epoll/select etc.
  17803. - bpo-34035: Fix several AttributeError in zipfile seek() methods. Patch by
  17804. Mickaël Schoentgen.
  17805. - bpo-32215: Fix performance regression in :mod:`sqlite3` when a DML
  17806. statement appeared in a different line than the rest of the SQL query.
  17807. - bpo-34075: Deprecate passing non-ThreadPoolExecutor instances to
  17808. :meth:`AbstractEventLoop.set_default_executor`.
  17809. - bpo-34251: Restore ``msilib.Win64`` to preserve backwards compatibility
  17810. since it's already used by ``distutils``' ``bdist_msi`` command.
  17811. - bpo-19891: Ignore errors caused by missing / non-writable homedir while
  17812. writing history during exit of an interactive session. Patch by Anthony
  17813. Sottile.
  17814. - bpo-33089: Enhanced math.hypot() to support more than two dimensions.
  17815. - bpo-34228: tracemalloc: PYTHONTRACEMALLOC=0 environment variable and -X
  17816. tracemalloc=0 command line option are now allowed to disable explicitly
  17817. tracemalloc at startup.
  17818. - bpo-13041: Use :func:`shutil.get_terminal_size` to calculate the terminal
  17819. width correctly in the ``argparse.HelpFormatter`` class. Initial patch by
  17820. Zbyszek Jędrzejewski-Szmek.
  17821. - bpo-34213: Allow frozen dataclasses to have a field named "object".
  17822. Previously this conflicted with an internal use of "object".
  17823. - bpo-34052: :meth:`sqlite3.Connection.create_aggregate`,
  17824. :meth:`sqlite3.Connection.create_function`,
  17825. :meth:`sqlite3.Connection.set_authorizer`,
  17826. :meth:`sqlite3.Connection.set_progress_handler` methods raises TypeError
  17827. when unhashable objects are passed as callable. These methods now don't
  17828. pass such objects to SQLite API. Previous behavior could lead to
  17829. segfaults. Patch by Sergey Fedoseev.
  17830. - bpo-34197: Attributes *skipinitialspace*, *doublequote* and *strict* of
  17831. the *dialect* attribute of the :mod:`csv` reader are now :class:`bool`
  17832. instances instead of integers 0 or 1.
  17833. - bpo-32788: Errors other than :exc:`TypeError` raised in methods
  17834. ``__adapt__()`` and ``__conform__()`` in the :mod:`sqlite3` module are now
  17835. propagated to the user.
  17836. - bpo-21446: The :2to3fixer:`reload` fixer now uses :func:`importlib.reload`
  17837. instead of deprecated :func:`!imp.reload`.
  17838. - bpo-940286: pydoc's ``Helper.showtopic()`` method now prints the cross
  17839. references of a topic correctly.
  17840. - bpo-34164: :func:`base64.b32decode` could raise UnboundLocalError or
  17841. OverflowError for incorrect padding. Now it always raises
  17842. :exc:`base64.Error` in these cases.
  17843. - bpo-33729: Fixed issues with arguments parsing in :mod:`hashlib`.
  17844. - bpo-34097: ZipFile can zip files older than 1980-01-01 and newer than
  17845. 2107-12-31 using a new ``strict_timestamps`` parameter at the cost of
  17846. setting the timestamp to the limit.
  17847. - bpo-34108: Remove extraneous CR in 2to3 refactor.
  17848. - bpo-34070: Make sure to only check if the handle is a tty, when opening a
  17849. file with ``buffering=-1``.
  17850. - bpo-27494: Reverted :issue:`27494`. 2to3 rejects now a trailing comma in
  17851. generator expressions.
  17852. - bpo-33967: functools.singledispatch now raises TypeError instead of
  17853. IndexError when no positional arguments are passed.
  17854. - bpo-34041: Add the parameter *deterministic* to the
  17855. :meth:`sqlite3.Connection.create_function` method. Patch by Sergey
  17856. Fedoseev.
  17857. - bpo-34056: Ensure the loader shim created by ``imp.load_module`` always
  17858. returns bytes from its ``get_data()`` function. This fixes using
  17859. ``imp.load_module`` with :pep:`552` hash-based pycs.
  17860. - bpo-34054: The multiprocessing module now uses the monotonic clock
  17861. :func:`time.monotonic` instead of the system clock :func:`time.time` to
  17862. implement timeout.
  17863. - bpo-34043: Optimize tarfile uncompress performance about 15% when gzip is
  17864. used.
  17865. - bpo-34044: ``subprocess.Popen`` now copies the *startupinfo* argument to
  17866. leave it unchanged: it will modify the copy, so that the same
  17867. ``STARTUPINFO`` object can be used multiple times.
  17868. - bpo-34010: Fixed a performance regression for reading streams with
  17869. tarfile. The buffered read should use a list, instead of appending to a
  17870. bytes object.
  17871. - bpo-34019: webbrowser: Correct the arguments passed to Opera Browser when
  17872. opening a new URL using the ``webbrowser`` module. Patch by Bumsik Kim.
  17873. - bpo-34003: csv.DictReader now creates dicts instead of OrderedDicts. Patch
  17874. by Michael Selik.
  17875. - bpo-33978: Closed existing logging handlers before reconfiguration via
  17876. fileConfig and dictConfig. Patch by Karthikeyan Singaravelan.
  17877. - bpo-14117: Make minor tweaks to turtledemo. The 'wikipedia' example is now
  17878. 'rosette', describing what it draws. The 'penrose' print output is
  17879. reduced. The'1024' output of 'tree' is eliminated.
  17880. - bpo-33974: Fixed passing lists and tuples of strings containing special
  17881. characters ``"``, ``\``, ``{``, ``}`` and ``\n`` as options to
  17882. :mod:`~tkinter.ttk` widgets.
  17883. - bpo-27500: Fix getaddrinfo to resolve IPv6 addresses correctly.
  17884. - bpo-24567: Improve random.choices() to handle subnormal input weights that
  17885. could occasionally trigger an IndexError.
  17886. - bpo-33871: Fixed integer overflow in :func:`os.readv`, :func:`os.writev`,
  17887. :func:`os.preadv` and :func:`os.pwritev` and in :func:`os.sendfile` with
  17888. *headers* or *trailers* arguments (on BSD-based OSes and macOS).
  17889. - bpo-25007: Add :func:`copy.copy` and :func:`copy.deepcopy` support to zlib
  17890. compressors and decompressors. Patch by Zackery Spytz.
  17891. - bpo-33929: multiprocessing: Fix a race condition in Popen of
  17892. multiprocessing.popen_spawn_win32. The child process now duplicates the
  17893. read end of pipe instead of "stealing" it. Previously, the read end of
  17894. pipe was "stolen" by the child process, but it leaked a handle if the
  17895. child process had been terminated before it could steal the handle from
  17896. the parent process.
  17897. - bpo-33899: Tokenize module now implicitly emits a NEWLINE when provided
  17898. with input that does not have a trailing new line. This behavior now
  17899. matches what the C tokenizer does internally. Contributed by Ammar Askar.
  17900. - bpo-33897: Added a 'force' keyword argument to logging.basicConfig().
  17901. - bpo-33695: :func:`shutil.copytree` uses :func:`os.scandir` function and
  17902. all copy functions depending from it use cached :func:`os.stat` values.
  17903. The speedup for copying a directory with 8000 files is around +9% on
  17904. Linux, +20% on Windows and + 30% on a Windows SMB share. Also the number
  17905. of :func:`os.stat` syscalls is reduced by 38% making
  17906. :func:`shutil.copytree` especially faster on network filesystems.
  17907. (Contributed by Giampaolo Rodola' in :issue:`33695`.)
  17908. - bpo-33916: bz2 and lzma: When Decompressor.__init__() is called twice,
  17909. free the old lock to not leak memory.
  17910. - bpo-32568: Make select.epoll() and its documentation consistent regarding
  17911. *sizehint* and *flags*.
  17912. - bpo-33833: Fixed bug in asyncio where ProactorSocketTransport logs
  17913. AssertionError if force closed during write.
  17914. - bpo-33663: Convert content length to string before putting to header.
  17915. - bpo-33721: :mod:`os.path` functions that return a boolean result like
  17916. :func:`~os.path.exists`, :func:`~os.path.lexists`, :func:`~os.path.isdir`,
  17917. :func:`~os.path.isfile`, :func:`~os.path.islink`, and
  17918. :func:`~os.path.ismount`, and :mod:`pathlib.Path` methods that return a
  17919. boolean result like :meth:`~pathlib.Path.exists()`,
  17920. :meth:`~pathlib.Path.is_dir()`, :meth:`~pathlib.Path.is_file()`,
  17921. :meth:`~pathlib.Path.is_mount()`, :meth:`~pathlib.Path.is_symlink()`,
  17922. :meth:`~pathlib.Path.is_block_device()`,
  17923. :meth:`~pathlib.Path.is_char_device()`, :meth:`~pathlib.Path.is_fifo()`,
  17924. :meth:`~pathlib.Path.is_socket()` now return ``False`` instead of raising
  17925. :exc:`ValueError` or its subclasses :exc:`UnicodeEncodeError` and
  17926. :exc:`UnicodeDecodeError` for paths that contain characters or bytes
  17927. unrepresentable at the OS level.
  17928. - bpo-26544: Fixed implementation of :func:`platform.libc_ver`. It almost
  17929. always returned version '2.9' for glibc.
  17930. - bpo-33843: Remove deprecated ``cgi.escape``, ``cgi.parse_qs`` and
  17931. ``cgi.parse_qsl``.
  17932. - bpo-33842: Remove ``tarfile.filemode`` which is deprecated since Python
  17933. 3.3.
  17934. - bpo-30167: Prevent site.main() exception if PYTHONSTARTUP is set. Patch by
  17935. Steve Weber.
  17936. - bpo-33805: Improve error message of dataclasses.replace() when an InitVar
  17937. is not specified
  17938. - bpo-33687: Fix the call to ``os.chmod()`` for ``uu.decode()`` if a mode is
  17939. given or decoded. Patch by Timo Furrer.
  17940. - bpo-33812: Datetime instance d with non-None tzinfo, but with
  17941. d.tzinfo.utcoffset(d) returning None is now treated as naive by the
  17942. astimezone() method.
  17943. - bpo-32108: In configparser, don't clear section when it is assigned to
  17944. itself.
  17945. - bpo-27397: Make email module properly handle invalid-length base64
  17946. strings.
  17947. - bpo-33578: Implement multibyte encoder/decoder state methods
  17948. - bpo-30805: Avoid race condition with debug logging
  17949. - bpo-33476: Fix _header_value_parser.py when address group is missing final
  17950. ';'. Contributed by Enrique Perez-Terron
  17951. - bpo-33694: asyncio: Fix a race condition causing data loss on
  17952. pause_reading()/resume_reading() when using the ProactorEventLoop.
  17953. - bpo-32493: Correct test for ``uuid_enc_be`` availability in
  17954. ``configure.ac``. Patch by Michael Felt.
  17955. - bpo-33792: Add asyncio.WindowsSelectorEventLoopPolicy and
  17956. asyncio.WindowsProactorEventLoopPolicy.
  17957. - bpo-33274: W3C DOM Level 1 specifies return value of
  17958. Element.removeAttributeNode() as "The Attr node that was removed."
  17959. xml.dom.minidom now complies with this requirement.
  17960. - bpo-33778: Update ``unicodedata``'s database to Unicode version 11.0.0.
  17961. - bpo-33165: Added a stacklevel parameter to logging calls to allow use of
  17962. wrapper/helper functions for logging APIs.
  17963. - bpo-33770: improve base64 exception message for encoded inputs of invalid
  17964. length
  17965. - bpo-33769: asyncio/start_tls: Fix error message; cancel callbacks in case
  17966. of an unhandled error; mark SSLTransport as closed if it is aborted.
  17967. - bpo-33767: The concatenation (``+``) and repetition (``*``) sequence
  17968. operations now raise :exc:`TypeError` instead of :exc:`SystemError` when
  17969. performed on :class:`mmap.mmap` objects. Patch by Zackery Spytz.
  17970. - bpo-33734: asyncio/ssl: Fix AttributeError, increase default handshake
  17971. timeout
  17972. - bpo-31014: Fixed creating a controller for :mod:`webbrowser` when a user
  17973. specifies a path to an entry in the BROWSER environment variable. Based
  17974. on patch by John Still.
  17975. - bpo-2504: Add gettext.pgettext() and variants.
  17976. - bpo-33197: Add description property for _ParameterKind
  17977. - bpo-32751: When cancelling the task due to a timeout,
  17978. :meth:`asyncio.wait_for` will now wait until the cancellation is complete.
  17979. - bpo-32684: Fix gather to propagate cancellation of itself even with
  17980. return_exceptions.
  17981. - bpo-33654: Support protocol type switching in SSLTransport.set_protocol().
  17982. - bpo-33674: Pause the transport as early as possible to further reduce the
  17983. risk of data_received() being called before connection_made().
  17984. - bpo-33671: :func:`shutil.copyfile`, :func:`shutil.copy`,
  17985. :func:`shutil.copy2`, :func:`shutil.copytree` and :func:`shutil.move` use
  17986. platform-specific fast-copy syscalls on Linux and macOS in order to copy
  17987. the file more efficiently. On Windows :func:`shutil.copyfile` uses a
  17988. bigger default buffer size (1 MiB instead of 16 KiB) and a
  17989. :func:`memoryview`-based variant of :func:`shutil.copyfileobj` is used.
  17990. The speedup for copying a 512MiB file is about +26% on Linux, +50% on
  17991. macOS and +40% on Windows. Also, much less CPU cycles are consumed.
  17992. (Contributed by Giampaolo Rodola' in :issue:`25427`.)
  17993. - bpo-33674: Fix a race condition in SSLProtocol.connection_made() of
  17994. asyncio.sslproto: start immediately the handshake instead of using
  17995. call_soon(). Previously, data_received() could be called before the
  17996. handshake started, causing the handshake to hang or fail.
  17997. - bpo-31647: Fixed bug where calling write_eof() on a
  17998. _SelectorSocketTransport after it's already closed raises AttributeError.
  17999. - bpo-32610: Make asyncio.all_tasks() return only pending tasks.
  18000. - bpo-32410: Avoid blocking on file IO in sendfile fallback code
  18001. - bpo-33469: Fix RuntimeError after closing loop that used run_in_executor
  18002. - bpo-33672: Fix Task.__repr__ crash with Cython's bogus coroutines
  18003. - bpo-33654: Fix transport.set_protocol() to support switching between
  18004. asyncio.Protocol and asyncio.BufferedProtocol. Fix loop.start_tls() to
  18005. work with asyncio.BufferedProtocols.
  18006. - bpo-33652: Pickles of type variables and subscripted generics are now
  18007. future-proof and compatible with older Python versions.
  18008. - bpo-32493: Fixed :func:`uuid.uuid1` on FreeBSD.
  18009. - bpo-33238: Add ``InvalidStateError`` to :mod:`concurrent.futures`.
  18010. ``Future.set_result`` and ``Future.set_exception`` now raise
  18011. ``InvalidStateError`` if the futures are not pending or running. Patch by
  18012. Jason Haydaman.
  18013. - bpo-33618: Finalize and document preliminary and experimental TLS 1.3
  18014. support with OpenSSL 1.1.1
  18015. - bpo-33625: Release GIL on ``grp.getgrnam``, ``grp.getgrgid``,
  18016. ``pwd.getpwnam`` and ``pwd.getpwuid`` if reentrant variants of these
  18017. functions are available. Patch by William Grzybowski.
  18018. - bpo-33623: Fix possible SIGSGV when asyncio.Future is created in __del__
  18019. - bpo-11874: Use a better regex when breaking usage into wrappable parts.
  18020. Avoids bogus assertion errors from custom metavar strings.
  18021. - bpo-30877: Fixed a bug in the Python implementation of the JSON decoder
  18022. that prevented the cache of parsed strings from clearing after finishing
  18023. the decoding. Based on patch by c-fos.
  18024. - bpo-33604: Remove HMAC default to md5 marked for removal in 3.8 (removal
  18025. originally planned in 3.6, bump to 3.8 in PR 7062).
  18026. - bpo-33582: Emit a deprecation warning for inspect.formatargspec
  18027. - bpo-21145: Add ``functools.cached_property`` decorator, for computed
  18028. properties cached for the life of the instance.
  18029. - bpo-33570: Change TLS 1.3 cipher suite settings for compatibility with
  18030. OpenSSL 1.1.1-pre6 and newer. OpenSSL 1.1.1 will have TLS 1.3 ciphers
  18031. enabled by default.
  18032. - bpo-28556: Do not simplify arguments to ``typing.Union``. Now
  18033. ``Union[Manager, Employee]`` is not simplified to ``Employee`` at runtime.
  18034. Such simplification previously caused several bugs and limited
  18035. possibilities for introspection.
  18036. - bpo-12486: :func:`tokenize.generate_tokens` is now documented as a public
  18037. API to tokenize unicode strings. It was previously present but
  18038. undocumented.
  18039. - bpo-33540: Add a new ``block_on_close`` class attribute to
  18040. ``ForkingMixIn`` and ``ThreadingMixIn`` classes of :mod:`socketserver`.
  18041. - bpo-33548: tempfile._candidate_tempdir_list should consider common TEMP
  18042. locations
  18043. - bpo-33109: argparse subparsers are once again not required by default,
  18044. reverting the change in behavior introduced by bpo-26510 in 3.7.0a2.
  18045. - bpo-33541: Remove unused private method ``_strptime.LocaleTime.__pad``
  18046. (a.k.a. ``_LocaleTime__pad``).
  18047. - bpo-33536: dataclasses.make_dataclass now checks for invalid field names
  18048. and duplicate fields. Also, added a check for invalid field
  18049. specifications.
  18050. - bpo-33542: Prevent ``uuid.get_node`` from using a DUID instead of a MAC on
  18051. Windows. Patch by Zvi Effron
  18052. - bpo-26819: Fix race condition with ``ReadTransport.resume_reading`` in
  18053. Windows proactor event loop.
  18054. - Fix failure in ``typing.get_type_hints()`` when ClassVar was provided as a
  18055. string forward reference.
  18056. - bpo-33516: :class:`unittest.mock.MagicMock` now supports the ``__round__``
  18057. magic method.
  18058. - bpo-28612: Added support for Site Maps to urllib's ``RobotFileParser`` as
  18059. :meth:`RobotFileParser.site_maps()
  18060. <urllib.robotparser.RobotFileParser.site_maps>`. Patch by Lady Red, based
  18061. on patch by Peter Wirtz.
  18062. - bpo-28167: Remove platform.linux_distribution, which was deprecated since
  18063. 3.5.
  18064. - bpo-33504: Switch the default dictionary implementation for
  18065. :mod:`configparser` from :class:`collections.OrderedDict` to the standard
  18066. :class:`dict` type.
  18067. - bpo-33505: Optimize asyncio.ensure_future() by reordering if checks: 1.17x
  18068. faster.
  18069. - bpo-33497: Add errors param to cgi.parse_multipart and make an encoding in
  18070. FieldStorage use the given errors (needed for Twisted). Patch by Amber
  18071. Brown.
  18072. - bpo-29235: The :class:`cProfile.Profile` class can now be used as a
  18073. context manager. Patch by Scott Sanderson.
  18074. - bpo-33495: Change dataclasses.Fields repr to use the repr of each of its
  18075. members, instead of str. This makes it more clear what each field
  18076. actually represents. This is especially true for the 'type' member.
  18077. - bpo-26103: Correct ``inspect.isdatadescriptor`` to look for ``__set__`` or
  18078. ``__delete__``. Patch by Aaron Hall.
  18079. - bpo-29209: Removed the ``doctype()`` method and the *html* parameter of
  18080. the constructor of :class:`~xml.etree.ElementTree.XMLParser`. The
  18081. ``doctype()`` method defined in a subclass will no longer be called.
  18082. Deprecated methods ``getchildren()`` and ``getiterator()`` in the
  18083. :mod:`~xml.etree.ElementTree` module emit now a :exc:`DeprecationWarning`
  18084. instead of :exc:`PendingDeprecationWarning`.
  18085. - bpo-33453: Fix dataclasses to work if using literal string type
  18086. annotations or if using PEP 563 "Postponed Evaluation of Annotations".
  18087. Only specific string prefixes are detected for both ClassVar ("ClassVar"
  18088. and "typing.ClassVar") and InitVar ("InitVar" and "dataclasses.InitVar").
  18089. - bpo-28556: Minor fixes in typing module: add annotations to
  18090. ``NamedTuple.__new__``, pass ``*args`` and ``**kwds`` in
  18091. ``Generic.__new__``. Original PRs by Paulius Šarka and Chad Dombrova.
  18092. - bpo-33365: Print the header values besides the header keys instead just
  18093. the header keys if *debuglevel* is set to >0 in :mod:`http.client`. Patch
  18094. by Marco Strigl.
  18095. - bpo-20087: Updated alias mapping with glibc 2.27 supported locales.
  18096. - bpo-33422: Fix trailing quotation marks getting deleted when looking up
  18097. byte/string literals on pydoc. Patch by Andrés Delfino.
  18098. - bpo-28167: The function ``platform.linux_distribution`` and
  18099. ``platform.dist`` now trigger a ``DeprecationWarning`` and have been
  18100. marked for removal in Python 3.8
  18101. - bpo-33281: Fix ctypes.util.find_library regression on macOS.
  18102. - bpo-33311: Text and html output generated by cgitb does not display
  18103. parentheses if the current call is done directly in the module. Patch by
  18104. Stéphane Blondon.
  18105. - bpo-27300: The file classes in *tempfile* now accept an *errors* parameter
  18106. that complements the already existing *encoding*. Patch by Stephan Hohe.
  18107. - bpo-32933: :func:`unittest.mock.mock_open` now supports iteration over the
  18108. file contents. Patch by Tony Flury.
  18109. - bpo-33217: Raise :exc:`TypeError` when looking up non-Enum objects in Enum
  18110. classes and Enum members.
  18111. - bpo-33197: Update error message when constructing invalid
  18112. inspect.Parameters Patch by Donghee Na.
  18113. - bpo-33383: Fixed crash in the get() method of the :mod:`dbm.ndbm` database
  18114. object when it is called with a single argument.
  18115. - bpo-33375: The warnings module now finds the Python file associated with a
  18116. warning from the code object, rather than the frame's global namespace.
  18117. This is consistent with how tracebacks and pdb find filenames, and should
  18118. work better for dynamically executed code.
  18119. - bpo-33336: ``imaplib`` now allows ``MOVE`` command in ``IMAP4.uid()`` (RFC
  18120. 6851: IMAP MOVE Extension) and potentially as a name of supported method
  18121. of ``IMAP4`` object.
  18122. - bpo-32455: Added *jump* parameter to :func:`dis.stack_effect`.
  18123. - bpo-27485: Rename and deprecate undocumented functions in
  18124. :func:`urllib.parse`.
  18125. - bpo-33332: Add ``signal.valid_signals()`` to expose the POSIX sigfillset()
  18126. functionality.
  18127. - bpo-33251: ``ConfigParser.items()`` was fixed so that key-value pairs
  18128. passed in via :func:`vars` are not included in the resulting output.
  18129. - bpo-33329: Fix multiprocessing regression on newer glibcs
  18130. - bpo-33334: :func:`dis.stack_effect` now supports all defined opcodes
  18131. including NOP and EXTENDED_ARG.
  18132. - bpo-991266: Fix quoting of the ``Comment`` attribute of
  18133. :class:`http.cookies.SimpleCookie`.
  18134. - bpo-33131: Upgrade bundled version of pip to 10.0.1.
  18135. - bpo-33308: Fixed a crash in the :mod:`parser` module when converting an ST
  18136. object to a tree of tuples or lists with ``line_info=False`` and
  18137. ``col_info=True``.
  18138. - bpo-23403: lib2to3 now uses pickle protocol 4 for pre-computed grammars.
  18139. - bpo-33266: lib2to3 now recognizes ``rf'...'`` strings.
  18140. - bpo-11594: Ensure line-endings are respected when using lib2to3.
  18141. - bpo-33254: Have :func:`importlib.resources.contents` and
  18142. :meth:`importlib.abc.ResourceReader.contents` return an :term:`iterable`
  18143. instead of an :term:`iterator`.
  18144. - bpo-33265: ``contextlib.ExitStack`` and ``contextlib.AsyncExitStack`` now
  18145. use a method instead of a wrapper function for exit callbacks.
  18146. - bpo-33263: Fix FD leak in ``_SelectorSocketTransport`` Patch by Vlad
  18147. Starostin.
  18148. - bpo-33256: Fix display of ``<module>`` call in the html produced by
  18149. ``cgitb.html()``. Patch by Stéphane Blondon.
  18150. - bpo-33144: ``random.Random()`` and its subclassing mechanism got optimized
  18151. to check only once at class/subclass instantiation time whether its
  18152. ``getrandbits()`` method can be relied on by other methods, including
  18153. ``randrange()``, for the generation of arbitrarily large random integers.
  18154. Patch by Wolfgang Maier.
  18155. - bpo-33185: Fixed regression when running pydoc with the :option:`-m`
  18156. switch. (The regression was introduced in 3.7.0b3 by the resolution of
  18157. :issue:`33053`)
  18158. This fix also changed pydoc to add ``os.getcwd()`` to :data:`sys.path`
  18159. when necessary, rather than adding ``"."``.
  18160. - bpo-29613: Added support for the ``SameSite`` cookie flag to the
  18161. ``http.cookies`` module.
  18162. - bpo-33169: Delete entries of ``None`` in :data:`sys.path_importer_cache`
  18163. when :meth:`importlib.machinery.invalidate_caches` is called.
  18164. - bpo-33203: ``random.Random.choice()`` now raises ``IndexError`` for empty
  18165. sequences consistently even when called from subclasses without a
  18166. ``getrandbits()`` implementation.
  18167. - bpo-33224: Update difflib.mdiff() for :pep:`479`. Convert an uncaught
  18168. StopIteration in a generator into a return-statement.
  18169. - bpo-33209: End framing at the end of C implementation of
  18170. :func:`pickle.Pickler.dump`.
  18171. - bpo-32861: The urllib.robotparser's ``__str__`` representation now
  18172. includes wildcard entries and the "Crawl-delay" and "Request-rate" fields.
  18173. Also removes extra newlines that were being appended to the end of the
  18174. string. Patch by Michael Lazar.
  18175. - bpo-23403: ``DEFAULT_PROTOCOL`` in :mod:`pickle` was bumped to 4. Protocol
  18176. 4 is described in :pep:`3154` and available since Python 3.4. It offers
  18177. better performance and smaller size compared to protocol 3 introduced in
  18178. Python 3.0.
  18179. - bpo-20104: Improved error handling and fixed a reference leak in
  18180. :func:`os.posix_spawn()`.
  18181. - bpo-33106: Deleting a key from a read-only dbm database raises module
  18182. specific error instead of KeyError.
  18183. - bpo-33175: In dataclasses, Field.__set_name__ now looks up the
  18184. __set_name__ special method on the class, not the instance, of the default
  18185. value.
  18186. - bpo-32380: Create functools.singledispatchmethod to support generic single
  18187. dispatch on descriptors and methods.
  18188. - bpo-33141: Have Field objects pass through __set_name__ to their default
  18189. values, if they have their own __set_name__.
  18190. - bpo-33096: Allow ttk.Treeview.insert to insert iid that has a false
  18191. boolean value. Note iid=0 and iid=False would be same. Patch by Garvit
  18192. Khatri.
  18193. - bpo-32873: Treat type variables and special typing forms as immutable by
  18194. copy and pickle. This fixes several minor issues and inconsistencies, and
  18195. improves backwards compatibility with Python 3.6.
  18196. - bpo-33134: When computing dataclass's __hash__, use the lookup table to
  18197. contain the function which returns the __hash__ value. This is an
  18198. improvement over looking up a string, and then testing that string to see
  18199. what to do.
  18200. - bpo-33127: The ssl module now compiles with LibreSSL 2.7.1.
  18201. - bpo-32505: Raise TypeError if a member variable of a dataclass is of type
  18202. Field, but doesn't have a type annotation.
  18203. - bpo-33078: Fix the failure on OSX caused by the tests relying on
  18204. sem_getvalue
  18205. - bpo-33116: Add 'Field' to dataclasses.__all__.
  18206. - bpo-32896: Fix an error where subclassing a dataclass with a field that
  18207. uses a default_factory would generate an incorrect class.
  18208. - bpo-33100: Dataclasses: If a field has a default value that's a
  18209. MemberDescriptorType, then it's from that field being in __slots__, not an
  18210. actual default value.
  18211. - bpo-32953: If a non-dataclass inherits from a frozen dataclass, allow
  18212. attributes to be added to the derived class. Only attributes from the
  18213. frozen dataclass cannot be assigned to. Require all dataclasses in a
  18214. hierarchy to be either all frozen or all non-frozen.
  18215. - bpo-33097: Raise RuntimeError when ``executor.submit`` is called during
  18216. interpreter shutdown.
  18217. - bpo-32968: Modulo and floor division involving Fraction and float should
  18218. return float.
  18219. - bpo-33061: Add missing ``NoReturn`` to ``__all__`` in typing.py
  18220. - bpo-33078: Fix the size handling in multiprocessing.Queue when a pickling
  18221. error occurs.
  18222. - bpo-33064: lib2to3 now properly supports trailing commas after ``*args``
  18223. and ``**kwargs`` in function signatures.
  18224. - bpo-33056: FIX properly close leaking fds in
  18225. concurrent.futures.ProcessPoolExecutor.
  18226. - bpo-33021: Release the GIL during fstat() calls, avoiding hang of all
  18227. threads when calling mmap.mmap(), os.urandom(), and random.seed(). Patch
  18228. by Nir Soffer.
  18229. - bpo-31804: Avoid failing in multiprocessing.Process if the standard
  18230. streams are closed or None at exit.
  18231. - bpo-33034: Providing an explicit error message when casting the port
  18232. property to anything that is not an integer value using ``urlparse()`` and
  18233. ``urlsplit()``. Patch by Matt Eaton.
  18234. - bpo-30249: Improve struct.unpack_from() exception messages for problems
  18235. with the buffer size and offset.
  18236. - bpo-33037: Skip sending/receiving data after SSL transport closing.
  18237. - bpo-27683: Fix a regression in :mod:`ipaddress` that result of
  18238. :meth:`hosts` is empty when the network is constructed by a tuple
  18239. containing an integer mask and only 1 bit left for addresses.
  18240. - bpo-22674: Add the strsignal() function in the signal module that returns
  18241. the system description of the given signal, as returned by strsignal(3).
  18242. - bpo-32999: Fix C implementation of ``ABC.__subclasscheck__(cls,
  18243. subclass)`` crashed when ``subclass`` is not a type object.
  18244. - bpo-33009: Fix inspect.signature() for single-parameter partialmethods.
  18245. - bpo-32969: Expose several missing constants in zlib and fix corresponding
  18246. documentation.
  18247. - bpo-32056: Improved exceptions raised for invalid number of channels and
  18248. sample width when read an audio file in modules :mod:`aifc`, :mod:`wave`
  18249. and :mod:`sunau`.
  18250. - bpo-32970: Improved disassembly of the MAKE_FUNCTION instruction.
  18251. - bpo-32844: Fix wrong redirection of a low descriptor (0 or 1) to stderr in
  18252. subprocess if another low descriptor is closed.
  18253. - bpo-32960: For dataclasses, disallow inheriting frozen from non-frozen
  18254. classes, and also disallow inheriting non-frozen from frozen classes. This
  18255. restriction will be relaxed at a future date.
  18256. - bpo-32713: Fixed tarfile.itn handling of out-of-bounds float values. Patch
  18257. by Joffrey Fuhrer.
  18258. - bpo-32257: The ssl module now contains OP_NO_RENEGOTIATION constant,
  18259. available with OpenSSL 1.1.0h or 1.1.1.
  18260. - bpo-32951: Direct instantiation of SSLSocket and SSLObject objects is now
  18261. prohibited. The constructors were never documented, tested, or designed as
  18262. public constructors. Users were suppose to use ssl.wrap_socket() or
  18263. SSLContext.
  18264. - bpo-32929: Remove the tri-state parameter "hash", and add the boolean
  18265. "unsafe_hash". If unsafe_hash is True, add a __hash__ function, but if a
  18266. __hash__ exists, raise TypeError. If unsafe_hash is False, add a __hash__
  18267. based on the values of eq= and frozen=. The unsafe_hash=False behavior is
  18268. the same as the old hash=None behavior. unsafe_hash=False is the default,
  18269. just as hash=None used to be.
  18270. - bpo-32947: Add OP_ENABLE_MIDDLEBOX_COMPAT and test workaround for TLSv1.3
  18271. for future compatibility with OpenSSL 1.1.1.
  18272. - bpo-32146: Document the interaction between frozen executables and the
  18273. spawn and forkserver start methods in multiprocessing.
  18274. - bpo-30622: The ssl module now detects missing NPN support in LibreSSL.
  18275. - bpo-32922: dbm.open() now encodes filename with the filesystem encoding
  18276. rather than default encoding.
  18277. - bpo-32759: Free unused arenas in multiprocessing.heap.
  18278. - bpo-32859: In ``os.dup2``, don't check every call whether the ``dup3``
  18279. syscall exists or not.
  18280. - bpo-32556: nt._getfinalpathname, nt._getvolumepathname and
  18281. nt._getdiskusage now correctly convert from bytes.
  18282. - bpo-21060: Rewrite confusing message from setup.py upload from "No dist
  18283. file created in earlier command" to the more helpful "Must create and
  18284. upload files in one command".
  18285. - bpo-32857: In :mod:`tkinter`, ``after_cancel(None)`` now raises a
  18286. :exc:`ValueError` instead of canceling the first scheduled function.
  18287. Patch by Cheryl Sabella.
  18288. - bpo-32852: Make sure sys.argv remains as a list when running trace.
  18289. - bpo-31333: ``_abc`` module is added. It is a speedup module with C
  18290. implementations for various functions and methods in ``abc``. Creating an
  18291. ABC subclass and calling ``isinstance`` or ``issubclass`` with an ABC
  18292. subclass are up to 1.5x faster. In addition, this makes Python start-up up
  18293. to 10% faster.
  18294. Note that the new implementation hides internal registry and caches,
  18295. previously accessible via private attributes ``_abc_registry``,
  18296. ``_abc_cache``, and ``_abc_negative_cache``. There are three debugging
  18297. helper methods that can be used instead ``_dump_registry``,
  18298. ``_abc_registry_clear``, and ``_abc_caches_clear``.
  18299. - bpo-32841: Fixed ``asyncio.Condition`` issue which silently ignored
  18300. cancellation after notifying and cancelling a conditional lock. Patch by
  18301. Bar Harel.
  18302. - bpo-32819: ssl.match_hostname() has been simplified and no longer depends
  18303. on re and ipaddress module for wildcard and IP addresses. Error reporting
  18304. for invalid wildcards has been improved.
  18305. - bpo-19675: ``multiprocessing.Pool`` no longer leaks processes if its
  18306. initialization fails.
  18307. - bpo-32394: socket: Remove
  18308. TCP_FASTOPEN,TCP_KEEPCNT,TCP_KEEPIDLE,TCP_KEEPINTVL flags on older version
  18309. Windows during run-time.
  18310. - bpo-31787: Fixed refleaks of ``__init__()`` methods in various modules.
  18311. (Contributed by Oren Milman)
  18312. - bpo-30157: Fixed guessing quote and delimiter in csv.Sniffer.sniff() when
  18313. only the last field is quoted. Patch by Jake Davis.
  18314. - bpo-30688: Added support of ``\N{name}`` escapes in regular expressions.
  18315. Based on patch by Jonathan Eunice.
  18316. - bpo-32792: collections.ChainMap() preserves the order of the underlying
  18317. mappings.
  18318. - bpo-32775: :func:`fnmatch.translate()` no longer produces patterns which
  18319. contain set operations. Sets starting with '[' or containing '--', '&&',
  18320. '~~' or '||' will be interpreted differently in regular expressions in
  18321. future versions. Currently they emit warnings. fnmatch.translate() now
  18322. avoids producing patterns containing such sets by accident.
  18323. - bpo-32622: Implement native fast sendfile for Windows proactor event loop.
  18324. - bpo-32777: Fix a rare but potential pre-exec child process deadlock in
  18325. subprocess on POSIX systems when marking file descriptors inheritable on
  18326. exec in the child process. This bug appears to have been introduced in
  18327. 3.4.
  18328. - bpo-32647: The ctypes module used to depend on indirect linking for
  18329. dlopen. The shared extension is now explicitly linked against libdl on
  18330. platforms with dl.
  18331. - bpo-32749: A :mod:`dbm.dumb` database opened with flags 'r' is now
  18332. read-only. :func:`dbm.dumb.open` with flags 'r' and 'w' no longer creates
  18333. a database if it does not exist.
  18334. - bpo-32741: Implement ``asyncio.TimerHandle.when()`` method.
  18335. - bpo-32691: Use mod_spec.parent when running modules with pdb
  18336. - bpo-32734: Fixed ``asyncio.Lock()`` safety issue which allowed acquiring
  18337. and locking the same lock multiple times, without it being free. Patch by
  18338. Bar Harel.
  18339. - bpo-32727: Do not include name field in SMTP envelope from address. Patch
  18340. by Stéphane Wirtel
  18341. - bpo-31453: Add TLSVersion constants and SSLContext.maximum_version /
  18342. minimum_version attributes. The new API wraps OpenSSL 1.1
  18343. https://web.archive.org/web/20180309043602/https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTX_set_min_proto_version.html
  18344. feature.
  18345. - bpo-24334: Internal implementation details of ssl module were cleaned up.
  18346. The SSLSocket has one less layer of indirection. Owner and session
  18347. information are now handled by the SSLSocket and SSLObject constructor.
  18348. Channel binding implementation has been simplified.
  18349. - bpo-31848: Fix the error handling in Aifc_read.initfp() when the SSND
  18350. chunk is not found. Patch by Zackery Spytz.
  18351. - bpo-32585: Add Ttk spinbox widget to :mod:`tkinter.ttk`. Patch by Alan D
  18352. Moore.
  18353. - bpo-32512: :mod:`profile` CLI accepts ``-m module_name`` as an alternative
  18354. to script path.
  18355. - bpo-8525: help() on a type now displays builtin subclasses. This is
  18356. intended primarily to help with notification of more specific exception
  18357. subclasses.
  18358. Patch by Sanyam Khurana.
  18359. - bpo-31639: http.server now exposes a ThreadingHTTPServer class and uses it
  18360. when the module is run with ``-m`` to cope with web browsers pre-opening
  18361. sockets.
  18362. - bpo-29877: compileall: import ProcessPoolExecutor only when needed,
  18363. preventing hangs on low resource platforms
  18364. - bpo-32221: Various functions returning tuple containing IPv6 addresses now
  18365. omit ``%scope`` part since the same information is already encoded in
  18366. *scopeid* tuple item. Especially this speeds up :func:`socket.recvfrom`
  18367. when it receives multicast packet since useless resolving of network
  18368. interface name is omitted.
  18369. - bpo-32147: :func:`binascii.unhexlify` is now up to 2 times faster. Patch
  18370. by Sergey Fedoseev.
  18371. - bpo-30693: The TarFile class now recurses directories in a reproducible
  18372. way.
  18373. - bpo-30693: The ZipFile class now recurses directories in a reproducible
  18374. way.
  18375. - bpo-31680: Added :data:`curses.ncurses_version`.
  18376. - bpo-31908: Fix output of cover files for ``trace`` module command-line
  18377. tool. Previously emitted cover files only when ``--missing`` option was
  18378. used. Patch by Michael Selik.
  18379. - bpo-31608: Raise a ``TypeError`` instead of crashing if a
  18380. ``collections.deque`` subclass returns a non-deque from ``__new__``. Patch
  18381. by Oren Milman.
  18382. - bpo-31425: Add support for sockets of the AF_QIPCRTR address family,
  18383. supported by the Linux kernel. This is used to communicate with services,
  18384. such as GPS or radio, running on Qualcomm devices. Patch by Bjorn
  18385. Andersson.
  18386. - bpo-22005: Implemented unpickling instances of
  18387. :class:`~datetime.datetime`, :class:`~datetime.date` and
  18388. :class:`~datetime.time` pickled by Python 2. ``encoding='latin1'`` should
  18389. be used for successful decoding.
  18390. - bpo-27645: :class:`sqlite3.Connection` now exposes a
  18391. :class:`~sqlite3.Connection.backup` method, if the underlying SQLite
  18392. library is at version 3.6.11 or higher. Patch by Lele Gaifax.
  18393. - bpo-16865: Support arrays >=2GiB in :mod:`ctypes`. Patch by Segev Finer.
  18394. - bpo-31508: Removed support of arguments in
  18395. ``tkinter.ttk.Treeview.selection``. It was deprecated in 3.6. Use
  18396. specialized methods like ``selection_set`` for changing the selection.
  18397. - bpo-29456: Fix bugs in hangul normalization: u1176, u11a7 and u11c3
  18398. Documentation
  18399. -------------
  18400. - bpo-21257: Document :func:`http.client.parse_headers`.
  18401. - bpo-34764: Improve example of iter() with 2nd sentinel argument.
  18402. - bpo-35564: Explicitly set master_doc variable in conf.py for compliance
  18403. with Sphinx 2.0
  18404. - bpo-35511: Specified that profile.Profile class doesn't not support enable
  18405. or disable methods. Also, elaborated that Profile object as a context
  18406. manager is only supported in cProfile module.
  18407. - bpo-10536: Enhance the gettext docs. Patch by Éric Araujo
  18408. - bpo-35089: Remove mention of ``typing.io`` and ``typing.re``. Their types
  18409. should be imported from ``typing`` directly.
  18410. - bpo-35038: Fix the documentation about an unexisting ``f_restricted``
  18411. attribute in the frame object. Patch by Stéphane Wirtel
  18412. - bpo-35042: Replace PEP XYZ by the pep role and allow to use the direct
  18413. links to the PEPs.
  18414. - bpo-35044: Fix the documentation with the role ``exc`` for the
  18415. appropriated exception. Patch by Stéphane Wirtel
  18416. - bpo-35035: Rename documentation for :mod:`email.utils` to
  18417. ``email.utils.rst``.
  18418. - bpo-34967: Use app.add_object_type() instead of the deprecated Sphinx
  18419. function app.description_unit()
  18420. - bpo-34913: Add documentation about the new command line interface of the
  18421. gzip module.
  18422. - bpo-32174: chm document displays non-ASCII charaters properly on some MBCS
  18423. Windows systems.
  18424. - bpo-11233: Create availability directive for documentation. Original
  18425. patch by Georg Brandl.
  18426. - bpo-34790: Document how passing coroutines to asyncio.wait() can be
  18427. confusing.
  18428. - bpo-34552: Make clear that ``==`` operator sometimes is equivalent to
  18429. ``is``. The ``<``, ``<=``, ``>`` and ``>=`` operators are only defined
  18430. where they make sense.
  18431. - bpo-28617: Fixed info in the stdtypes docs concerning the types that
  18432. support membership tests.
  18433. - bpo-20177: Migrate datetime.date.fromtimestamp to Argument Clinic. Patch
  18434. by Tim Hoffmann.
  18435. - bpo-34065: Fix wrongly written basicConfig documentation markup syntax
  18436. - bpo-33460: replaced ellipsis with correct error codes in tutorial chapter
  18437. 3.
  18438. - bpo-33847: Add '@' operator entry to index.
  18439. - bpo-33409: Clarified the relationship between :pep:`538`'s
  18440. PYTHONCOERCECLOCALE and PEP 540's PYTHONUTF8 mode.
  18441. - bpo-33197: Add versionadded tag to the documentation of
  18442. ParameterKind.description
  18443. - bpo-17045: Improve the C-API doc for PyTypeObject. This includes adding
  18444. several quick-reference tables and a lot of missing slot/typedef entries.
  18445. The existing entries were also cleaned up with a slightly more consistent
  18446. format.
  18447. - bpo-33736: Improve the documentation of :func:`asyncio.open_connection`,
  18448. :func:`asyncio.start_server` and their UNIX socket counterparts.
  18449. - bpo-23859: Document that ``asyncio.wait()`` does not cancel its futures on
  18450. timeout.
  18451. - bpo-32436: Document :pep:`567` changes to asyncio.
  18452. - bpo-33604: Update HMAC md5 default to a DeprecationWarning, bump removal
  18453. to 3.8.
  18454. - bpo-33594: Document ``getargspec``, ``from_function`` and ``from_builtin``
  18455. as deprecated in their respective docstring, and include version since
  18456. deprecation in DeprecationWarning message.
  18457. - bpo-33503: Fix broken pypi link
  18458. - bpo-33421: Add missing documentation for ``typing.AsyncContextManager``.
  18459. - bpo-33487: BZ2file now emit a DeprecationWarning when buffering=None is
  18460. passed, the deprecation message and documentation also now explicitly
  18461. state it is deprecated since 3.0.
  18462. - bpo-33378: Add Korean language switcher for https://docs.python.org/3/
  18463. - bpo-33276: Clarify that the ``__path__`` attribute on modules cannot be
  18464. just any value.
  18465. - bpo-33201: Modernize documentation for writing C extension types.
  18466. - bpo-33195: Deprecate ``Py_UNICODE`` usage in ``c-api/arg`` document.
  18467. ``Py_UNICODE`` related APIs are deprecated since Python 3.3, but it is
  18468. missed in the document.
  18469. - bpo-33126: Document PyBuffer_ToContiguous().
  18470. - bpo-27212: Modify documentation for the :func:`islice` recipe to consume
  18471. initial values up to the start index.
  18472. - bpo-28247: Update :mod:`zipapp` documentation to describe how to make
  18473. standalone applications.
  18474. - bpo-18802: Documentation changes for ipaddress. Patch by Jon Foster and
  18475. Berker Peksag.
  18476. - bpo-27428: Update documentation to clarify that ``WindowsRegistryFinder``
  18477. implements ``MetaPathFinder``. (Patch by Himanshu Lakhara)
  18478. - bpo-28124: The ssl module function ssl.wrap_socket() has been
  18479. de-emphasized and deprecated in favor of the more secure and efficient
  18480. SSLContext.wrap_socket() method.
  18481. - bpo-17232: Clarify docs for -O and -OO. Patch by Terry Reedy.
  18482. - bpo-32436: Add documentation for the contextvars module (PEP 567).
  18483. - bpo-32800: Update link to w3c doc for xml default namespaces.
  18484. - bpo-11015: Update :mod:`test.support` documentation.
  18485. - bpo-32613: Update the faq/windows.html to use the py command from PEP 397
  18486. instead of python.
  18487. - bpo-8722: Document :meth:`__getattr__` behavior when property :meth:`get`
  18488. method raises :exc:`AttributeError`.
  18489. - bpo-32614: Modify RE examples in documentation to use raw strings to
  18490. prevent :exc:`DeprecationWarning` and add text to REGEX HOWTO to highlight
  18491. the deprecation.
  18492. - bpo-20709: Remove the paragraph where we explain that os.utime() does not
  18493. support a directory as path under Windows. Patch by Jan-Philip Gehrcke
  18494. - bpo-32722: Remove the bad example in the tutorial of the Generator
  18495. Expression. Patch by Stéphane Wirtel
  18496. - bpo-31972: Improve docstrings for ``pathlib.PurePath`` subclasses.
  18497. - bpo-30607: Use the externalized ``python-docs-theme`` package when
  18498. building the documentation.
  18499. - bpo-8243: Add a note about curses.addch and curses.addstr exception
  18500. behavior when writing outside a window, or pad.
  18501. - bpo-32337: Update documentation related with ``dict`` order.
  18502. - bpo-25041: Document ``AF_PACKET`` in the :mod:`socket` module.
  18503. - bpo-31432: Clarify meaning of CERT_NONE, CERT_OPTIONAL, and CERT_REQUIRED
  18504. flags for ssl.SSLContext.verify_mode.
  18505. Tests
  18506. -----
  18507. - bpo-35772: Fix sparse file tests of test_tarfile on ppc64 with the tmpfs
  18508. filesystem. Fix the function testing if the filesystem supports sparse
  18509. files: create a file which contains data and "holes", instead of creating
  18510. a file which contains no data. tmpfs effective block size is a page size
  18511. (tmpfs lives in the page cache). RHEL uses 64 KiB pages on aarch64, ppc64,
  18512. ppc64le, only s390x and x86_64 use 4 KiB pages, whereas the test punch
  18513. holes of 4 KiB.
  18514. - bpo-35045: Make ssl tests less strict and also accept TLSv1 as system
  18515. default. The changes unbreaks test_min_max_version on Fedora 29.
  18516. - bpo-32710: ``test_asyncio/test_sendfile.py`` now resets the event loop
  18517. policy using :func:`tearDownModule` as done in other tests, to prevent a
  18518. warning when running tests on Windows.
  18519. - bpo-33717: test.pythoninfo now logs information of all clocks, not only
  18520. time.time() and time.perf_counter().
  18521. - bpo-35488: Add a test to pathlib's Path.match() to verify it does not
  18522. support glob-style ** recursive pattern matching.
  18523. - bpo-31731: Fix a race condition in ``check_interrupted_write()`` of
  18524. test_io: create directly the thread with SIGALRM signal blocked, rather
  18525. than blocking the signal later from the thread. Previously, it was
  18526. possible that the thread gets the signal before the signal is blocked.
  18527. - bpo-35424: Fix test_multiprocessing_main_handling: use
  18528. :class:`multiprocessing.Pool` with a context manager and then explicitly
  18529. join the pool.
  18530. - bpo-35519: Rename :mod:`test.bisect` module to :mod:`test.bisect_cmd` to
  18531. avoid conflict with :mod:`bisect` module when running directly a test like
  18532. ``./python Lib/test/test_xmlrpc.py``.
  18533. - bpo-35513: Replace :func:`time.time` with :func:`time.monotonic` in tests
  18534. to measure time delta.
  18535. - bpo-34279: :func:`test.support.run_unittest` no longer raise
  18536. :exc:`TestDidNotRun` if the test result contains skipped tests. The
  18537. exception is now only raised if no test have been run and no test have
  18538. been skipped.
  18539. - bpo-35412: Add testcase to ``test_future4``: check unicode literal.
  18540. - bpo-26704: Added test demonstrating double-patching of an instance method.
  18541. Patch by Anthony Sottile.
  18542. - bpo-33725: test_multiprocessing_fork may crash on recent versions of
  18543. macOS. Until the issue is resolved, skip the test on macOS.
  18544. - bpo-35352: Modify test_asyncio to use the certificate set from the test
  18545. directory.
  18546. - bpo-35317: Fix ``mktime()`` overflow error in ``test_email``: run
  18547. ``test_localtime_daylight_true_dst_true()`` and
  18548. ``test_localtime_daylight_false_dst_true()`` with a specific timezone.
  18549. - bpo-21263: After several reports that test_gdb does not work properly on
  18550. macOS and since gdb is not shipped by default anymore, test_gdb is now
  18551. skipped on macOS when LLVM Clang has been used to compile Python. Patch by
  18552. Lysandros Nikolaou
  18553. - bpo-34279: regrtest issue a warning when no tests have been executed in a
  18554. particular test file. Also, a new final result state is issued if no test
  18555. have been executed across all test files. Patch by Pablo Galindo.
  18556. - bpo-34962: make docstest in Doc now passes., and is enforced in CI
  18557. - bpo-23596: Use argparse for the command line of the gzip module. Patch by
  18558. Antony Lee
  18559. - bpo-34537: Fix ``test_gdb.test_strings()`` when ``LC_ALL=C`` and GDB was
  18560. compiled with Python 3.6 or earlier.
  18561. - bpo-34587: test_socket: Remove RDSTest.testCongestion(). The test tries to
  18562. fill the receiver's socket buffer and expects an error. But the RDS
  18563. protocol doesn't require that. Moreover, the Linux implementation of RDS
  18564. expects that the producer of the messages reduces its rate, it's not the
  18565. role of the receiver to trigger an error. The test fails on Fedora 28 by
  18566. design, so just remove it.
  18567. - bpo-34661: Fix test_shutil if unzip doesn't support -t.
  18568. - bpo-34200: Fixed non-deterministic flakiness of test_pkg by not using the
  18569. scary test.support.module_cleanup() logic to save and restore sys.modules
  18570. contents between test cases.
  18571. - bpo-34569: The experimental PEP 554 data channels now correctly pass
  18572. negative PyLong objects between subinterpreters on 32-bit systems. Patch
  18573. by Michael Felt.
  18574. - bpo-34594: Fix usage of hardcoded ``errno`` values in the tests.
  18575. - bpo-34579: Fix test_embed for AIX Patch by Michael Felt
  18576. - bpo-34542: Use 3072 RSA keys and SHA-256 signature for test certs and
  18577. keys.
  18578. - bpo-11193: Remove special condition for AIX in
  18579. ``test_subprocess.test_undecodable_env``
  18580. - bpo-34347: Fix ``test_utf8_mode.test_cmd_line`` for AIX
  18581. - bpo-34490: On AIX with AF_UNIX family sockets getsockname() does not
  18582. provide 'sockname', so skip calls to transport.get_extra_info('sockname')
  18583. - bpo-34391: Fix ftplib test for TLS 1.3 by reading from data socket.
  18584. - bpo-11192: Fix ``test_socket`` on AIX 6.1 and later IPv6 zone id supports
  18585. only supported by ``inet_pton6_zone()``. Switch to runtime-based
  18586. ``platform.system()`` to establish current platform rather than build-time
  18587. based ``sys.platform()``
  18588. - bpo-34399: Update all RSA keys and DH params to use at least 2048 bits.
  18589. - bpo-34373: Fix ``test_mktime`` and ``test_pthread_getcpuclickid`` tests
  18590. for AIX Add range checking for ``_PyTime_localtime`` for AIX Patch by
  18591. Michael Felt
  18592. - bpo-11191: Skip the distutils test 'test_search_cpp' when using XLC as
  18593. compiler patch by aixtools (Michael Felt)
  18594. - Improved an error message when mock assert_has_calls fails.
  18595. - bpo-33746: Fix test_unittest when run in verbose mode.
  18596. - bpo-33901: Fix test_dbm_gnu on macOS with gdbm 1.15: add a larger value to
  18597. make sure that the file size changes.
  18598. - bpo-33873: Fix a bug in ``regrtest`` that caused an extra test to run if
  18599. --huntrleaks/-R was used. Exit with error in case that invalid parameters
  18600. are specified to --huntrleaks/-R (at least one warmup run and one
  18601. repetition must be used).
  18602. - bpo-33562: Check that a global asyncio event loop policy is not left
  18603. behind by any tests.
  18604. - bpo-33655: Ignore test_posix_fallocate failures on BSD platforms that
  18605. might be due to running on ZFS.
  18606. - bpo-32962: Fixed test_gdb when Python is compiled with flags -mcet
  18607. -fcf-protection -O0.
  18608. - bpo-33358: Fix ``test_embed.test_pre_initialization_sys_options()`` when
  18609. the interpreter is built with ``--enable-shared``.
  18610. - bpo-32872: Avoid regrtest compatibility issue with namespace packages.
  18611. - bpo-32517: Fix failing ``test_asyncio`` on macOS 10.12.2+ due to transport
  18612. of ``KqueueSelector`` loop was not being closed.
  18613. - bpo-32663: Making sure the ``SMTPUTF8SimTests`` class of tests gets run in
  18614. ``test_smtplib.py``.
  18615. - bpo-27643: Test_C test case needs "signed short" bitfields, but the IBM
  18616. XLC compiler (on AIX) does not support this Skip the code and test when
  18617. AIX and XLC are used
  18618. Applicable to Python2-2.7 and later
  18619. - bpo-19417: Add test_bdb.py.
  18620. - bpo-31809: Add tests to verify connection with secp ECDH curves.
  18621. Build
  18622. -----
  18623. - bpo-34691: The _contextvars module is now built into the core Python
  18624. library on Windows.
  18625. - bpo-35683: Improved Azure Pipelines build steps and now verifying layouts
  18626. correctly
  18627. - bpo-35642: Remove asynciomodule.c from pythoncore.vcxproj
  18628. - bpo-35550: Fix incorrect Solaris #ifdef checks to look for __sun && __SVR4
  18629. instead of sun when compiling.
  18630. - bpo-35499: ``make profile-opt`` no longer replaces ``CFLAGS_NODIST`` with
  18631. ``CFLAGS``. It now adds profile-guided optimization (PGO) flags to
  18632. ``CFLAGS_NODIST``: existing ``CFLAGS_NODIST`` flags are kept.
  18633. - bpo-35257: Avoid leaking the linker flags from Link Time Optimizations
  18634. (LTO) into distutils when compiling C extensions.
  18635. - bpo-35351: When building Python with clang and LTO, LTO flags are no
  18636. longer passed into CFLAGS to build third-party C extensions through
  18637. distutils.
  18638. - bpo-35139: Fix a compiler error when statically linking ``pyexpat`` in
  18639. ``Modules/Setup``.
  18640. - bpo-35059: PCbuild: Set InlineFunctionExpansion to OnlyExplicitInline
  18641. ("/Ob1" option) in pyproject.props in Debug mode to expand functions
  18642. marked as inline. This change should make Python compiled in Debug mode a
  18643. little bit faster on Windows.
  18644. - bpo-35011: Restores the use of pyexpatns.h to isolate our embedded copy of
  18645. the expat C library so that its symbols do not conflict at link or dynamic
  18646. loading time with an embedding application or other extension modules with
  18647. their own version of libexpat.
  18648. - bpo-28015: Have --with-lto works correctly with clang.
  18649. - bpo-34765: Update the outdated install-sh file to the latest revision from
  18650. automake v1.16.1
  18651. - bpo-34585: Check for floating-point byte order in configure.ac using
  18652. compilation tests instead of executing code, so that these checks work in
  18653. cross-compiled builds.
  18654. - bpo-34710: Fixed SSL module build with OpenSSL & pedantic CFLAGS.
  18655. - bpo-34582: Add JUnit XML output for regression tests and update Azure
  18656. DevOps builds.
  18657. - bpo-34081: Make Sphinx warnings as errors in the Docs Makefile.
  18658. - bpo-34555: Fix for case where it was not possible to have both
  18659. ``HAVE_LINUX_VM_SOCKETS_H`` and ``HAVE_SOCKADDR_ALG`` be undefined.
  18660. - bpo-33015: Fix an undefined behaviour in the pthread implementation of
  18661. :c:func:`PyThread_start_new_thread`: add a function wrapper to always
  18662. return ``NULL``.
  18663. - bpo-34245: The Python shared library is now installed with write
  18664. permission (mode 0755), which is the standard way of installing such
  18665. libraries.
  18666. - bpo-34121: Fix detection of C11 atomic support on clang.
  18667. - bpo-32430: Rename Modules/Setup.dist to Modules/Setup, and remove the
  18668. necessity to copy the former manually to the latter when updating the
  18669. local source tree.
  18670. - bpo-30345: Add -g to LDFLAGS when compiling with LTO to get debug symbols.
  18671. - bpo-5755: Move ``-Wstrict-prototypes`` option to ``CFLAGS_NODIST`` from
  18672. ``OPT``. This option emitted annoying warnings when building extension
  18673. modules written in C++.
  18674. - bpo-33614: Ensures module definition files for the stable ABI on Windows
  18675. are correctly regenerated.
  18676. - bpo-33648: The --with-c-locale-warning configuration flag has been
  18677. removed. It has had no effect for about a year.
  18678. - bpo-33522: Enable CI builds on Visual Studio Team Services at
  18679. https://python.visualstudio.com/cpython
  18680. - bpo-33512: configure's check for "long double" has been simplified
  18681. - bpo-33483: C compiler is now correctly detected from the standard
  18682. environment variables. --without-gcc and --with-icc options have been
  18683. removed.
  18684. - bpo-33394: Enable the verbose build for extension modules, when GNU make
  18685. is passed macros on the command line.
  18686. - bpo-33393: Update config.guess and config.sub files.
  18687. - bpo-33377: Add new triplets for mips r6 and riscv variants (used in
  18688. extension suffixes).
  18689. - bpo-32232: By default, modules configured in ``Modules/Setup`` are no
  18690. longer built with ``-DPy_BUILD_CORE``. Instead, modules that specifically
  18691. need that preprocessor definition include it in their individual entries.
  18692. - bpo-33182: The embedding tests can once again be built with clang 6.0
  18693. - bpo-33163: Upgrade pip to 9.0.3 and setuptools to v39.0.1.
  18694. - bpo-33012: gcc 8 has added a new warning heuristic to detect invalid
  18695. function casts and a stock python build seems to hit that warning quite
  18696. often. The most common is the cast of a METH_NOARGS function (that uses
  18697. just one argument) to a PyCFunction. Fix this by adding a dummy argument
  18698. to all functions that implement METH_NOARGS.
  18699. - bpo-32898: Fix the python debug build when using COUNT_ALLOCS.
  18700. - bpo-29442: Replace optparse with argparse in setup.py
  18701. Windows
  18702. -------
  18703. - bpo-35890: Fix API calling consistency of GetVersionEx and wcstok.
  18704. - bpo-32560: The ``py`` launcher now forwards its ``STARTUPINFO`` structure
  18705. to child processes.
  18706. - bpo-35854: Fix EnvBuilder and --symlinks in venv on Windows
  18707. - bpo-35811: Avoid propagating venv settings when launching via py.exe
  18708. - bpo-35797: Fix default executable used by the multiprocessing module
  18709. - bpo-35758: Allow building on ARM with MSVC.
  18710. - bpo-29734: Fix handle leaks in os.stat on Windows.
  18711. - bpo-35596: Use unchecked PYCs for the embeddable distro to avoid zipimport
  18712. restrictions.
  18713. - bpo-35596: Fix vcruntime140.dll being added to embeddable distro multiple
  18714. times.
  18715. - bpo-35402: Update Windows build to use Tcl and Tk 8.6.9
  18716. - bpo-35401: Updates Windows build to OpenSSL 1.1.0j
  18717. - bpo-34977: venv on Windows will now use a python.exe redirector rather
  18718. than copying the actual binaries from the base environment.
  18719. - bpo-34977: Adds support for building a Windows App Store package
  18720. - bpo-35067: Remove _distutils_findvs module and use vswhere.exe instead.
  18721. - bpo-32557: Allow shutil.disk_usage to take a file path on Windows
  18722. - bpo-34770: Fix a possible null pointer dereference in pyshellext.cpp.
  18723. - bpo-34603: Fix returning structs from functions produced by MSVC
  18724. - bpo-34581: Guard MSVC-specific code in socketmodule.c with ``#ifdef
  18725. _MSC_VER``.
  18726. - bpo-34532: Fixes exit code of list version arguments for py.exe.
  18727. - bpo-34062: Fixed the '--list' and '--list-paths' arguments for the py.exe
  18728. launcher
  18729. - bpo-34225: Ensure INCLUDE and LIB directories do not end with a backslash.
  18730. - bpo-34011: A suite of code has been changed which copied across DLLs and
  18731. init.tcl from the running Python location into a venv being created. These
  18732. copies are needed only when running from a Python source build, and the
  18733. copying code is now only run when that is the case, rather than whenever a
  18734. venv is created.
  18735. - bpo-34006: Revert line length limit for Windows help docs. The line-length
  18736. limit is not needed because the pages appear in a separate app rather than
  18737. on a browser tab. It can also interact badly with the DPI setting.
  18738. - bpo-31546: Restore running PyOS_InputHook while waiting for user input at
  18739. the prompt. The restores integration of interactive GUI windows (such as
  18740. Matplotlib figures) with the prompt on Windows.
  18741. - bpo-30237: Output error when ReadConsole is canceled by
  18742. CancelSynchronousIo instead of crashing.
  18743. - bpo-33895: GIL is released while calling functions that acquire Windows
  18744. loader lock.
  18745. - bpo-33720: Reduces maximum marshal recursion depth on release builds.
  18746. - bpo-29097: Fix bug where :meth:`datetime.fromtimestamp` erroneously throws
  18747. an :exc:`OSError` on Windows for values between 0 and 86400. Patch by
  18748. Ammar Askar.
  18749. - bpo-33316: PyThread_release_lock always fails
  18750. - bpo-33184: Update Windows installer to use OpenSSL 1.1.0h.
  18751. - bpo-32890: Fix usage of GetLastError() instead of errno in os.execve() and
  18752. os.truncate().
  18753. - bpo-33016: Fix potential use of uninitialized memory in
  18754. nt._getfinalpathname
  18755. - bpo-32903: Fix a memory leak in os.chdir() on Windows if the current
  18756. directory is set to a UNC path.
  18757. - bpo-32901: Update Tcl and Tk versions to 8.6.8
  18758. - bpo-31966: Fixed WindowsConsoleIO.write() for writing empty data.
  18759. - bpo-32409: Ensures activate.bat can handle Unicode contents.
  18760. - bpo-32457: Improves handling of denormalized executable path when
  18761. launching Python.
  18762. - bpo-32370: Use the correct encoding for ipconfig output in the uuid
  18763. module. Patch by Segev Finer.
  18764. - bpo-29248: Fix :func:`os.readlink` on Windows, which was mistakenly
  18765. treating the ``PrintNameOffset`` field of the reparse data buffer as a
  18766. number of characters instead of bytes. Patch by Craig Holmquist and SSE4.
  18767. - bpo-1104: Correctly handle string length in
  18768. ``msilib.SummaryInfo.GetProperty()`` to prevent it from truncating the
  18769. last character.
  18770. macOS
  18771. -----
  18772. - bpo-35401: Update macOS installer to use OpenSSL 1.1.0j.
  18773. - bpo-35025: Properly guard the use of the ``CLOCK_GETTIME`` et al. macros
  18774. in ``timemodule`` on macOS.
  18775. - bpo-24658: On macOS, fix reading from and writing into a file with a size
  18776. larger than 2 GiB.
  18777. - bpo-34405: Update to OpenSSL 1.1.0i for macOS installer builds.
  18778. - bpo-33635: In macOS stat on some file descriptors (/dev/fd/3 f.e) will
  18779. result in bad file descriptor OSError. Guard against this exception was
  18780. added in is_dir, is_file and similar methods. DirEntry.is_dir can also
  18781. throw this exception so _RecursiveWildcardSelector._iterate_directories
  18782. was also extended with the same error ignoring pattern.
  18783. - bpo-13631: The .editrc file in user's home directory is now processed
  18784. correctly during the readline initialization through editline emulation on
  18785. macOS.
  18786. - bpo-33184: Update macOS installer build to use OpenSSL 1.1.0h.
  18787. - bpo-32726: Build and link with private copy of Tcl/Tk 8.6 for the macOS
  18788. 10.6+ installer. The 10.9+ installer variant already does this. This
  18789. means that the Python 3.7 provided by the python.org macOS installers no
  18790. longer need or use any external versions of Tcl/Tk, either system-provided
  18791. or user-installed, such as ActiveTcl.
  18792. - bpo-32901: Update macOS 10.9+ installer to Tcl/Tk 8.6.8.
  18793. - bpo-31903: In :mod:`_scproxy`, drop the GIL when calling into
  18794. ``SystemConfiguration`` to avoid deadlocks.
  18795. IDLE
  18796. ----
  18797. - bpo-35770: IDLE macosx deletes Options => Configure IDLE. It previously
  18798. deleted Window => Zoom Height by mistake. (Zoom Height is now on the
  18799. Options menu). On Mac, the settings dialog is accessed via Preferences on
  18800. the IDLE menu.
  18801. - bpo-35769: Change IDLE's new file name from 'Untitled' to 'untitled'
  18802. - bpo-35660: Fix imports in idlelib.window.
  18803. - bpo-35641: Proper format ``calltip`` when the function has no docstring.
  18804. - bpo-33987: Use ttk Frame for ttk widgets.
  18805. - bpo-34055: Fix erroneous 'smart' indents and newlines in IDLE Shell.
  18806. - bpo-35591: Find Selection now works when selection not found.
  18807. - bpo-35196: Speed up squeezer line counting.
  18808. - bpo-35598: Update config_key: use PEP 8 names and ttk widgets, make some
  18809. objects global, and add tests.
  18810. - bpo-28097: Add Previous/Next History entries to Shell menu.
  18811. - bpo-35208: Squeezer now properly counts wrapped lines before newlines.
  18812. - bpo-35555: Gray out Code Context menu entry when it's not applicable.
  18813. - bpo-35521: Document the IDLE editor code context feature. Add some
  18814. internal references within the IDLE doc.
  18815. - bpo-22703: The Code Context menu label now toggles between Show/Hide Code
  18816. Context. The Zoom Height menu now toggles between Zoom/Restore Height.
  18817. Zoom Height has moved from the Window menu to the Options menu.
  18818. - bpo-35213: Where appropriate, use 'macOS' in idlelib.
  18819. - bpo-34864: On macOS, warn if the system preference "Prefer tabs when
  18820. opening documents" is set to "Always".
  18821. - bpo-34864: Document two IDLE on MacOS issues. The System Preferences Dock
  18822. "prefer tabs always" setting disables some IDLE features. Menus are a bit
  18823. different than as described for Windows and Linux.
  18824. - bpo-35202: Remove unused imports from lib/idlelib
  18825. - bpo-33000: Document that IDLE's shell has no line limit. A program that
  18826. runs indefinitely can overfill memory.
  18827. - bpo-23220: Explain how IDLE's Shell displays output.
  18828. - bpo-35099: Improve the doc about IDLE running user code. The section is
  18829. renamed from "IDLE -- console differences" is renamed "Running user code".
  18830. It mostly covers the implications of using custom :samp:`sys.std{xxx}`
  18831. objects.
  18832. - bpo-35097: Add IDLE doc subsection explaining editor windows. Topics
  18833. include opening, title and status bar, .py* extension, and running.
  18834. - bpo-35093: Document the IDLE document viewer in the IDLE doc. Add a
  18835. paragraph in "Help and preferences", "Help sources" subsection.
  18836. - bpo-35088: Update idlelib.help.copy_string docstring. We now use git and
  18837. backporting instead of hg and forward merging.
  18838. - bpo-35087: Update idlelib help files for the current doc build. The main
  18839. change is the elimination of chapter-section numbers.
  18840. - bpo-34548: Use configured color theme for read-only text views.
  18841. - bpo-1529353: Enable "squeezing" of long outputs in the shell, to avoid
  18842. performance degradation and to clean up the history without losing it.
  18843. Squeezed outputs may be copied, viewed in a separate window, and
  18844. "unsqueezed".
  18845. - bpo-34047: Fixed mousewheel scrolling direction on macOS.
  18846. - bpo-34275: Make IDLE calltips always visible on Mac. Some MacOS-tk
  18847. combinations need .update_idletasks(). Patch by Kevin Walzer.
  18848. - bpo-34120: Fix unresponsiveness after closing certain windows and dialogs.
  18849. - bpo-33975: Avoid small type when running htests. Since part of the purpose
  18850. of human-viewed tests is to determine that widgets look right, it is
  18851. important that they look the same for testing as when running IDLE.
  18852. - bpo-33905: Add test for idlelib.stackview.StackBrowser.
  18853. - bpo-33924: Change mainmenu.menudefs key 'windows' to 'window'. Every other
  18854. menudef key is lowercase version of main menu entry.
  18855. - bpo-33906: Rename idlelib.windows as window Match Window on the main menu
  18856. and remove last plural module name.
  18857. - bpo-33917: Fix and document idlelib/idle_test/template.py. The revised
  18858. file compiles, runs, and tests OK. idle_test/README.txt explains how to
  18859. use it to create new IDLE test files.
  18860. - bpo-33904: IDLE: In rstrip, rename class RstripExtension as Rstrip
  18861. - bpo-33907: For consistency and clarity, rename an IDLE module and classes.
  18862. Module calltips and its class CallTips are now calltip and Calltip. In
  18863. module calltip_w, class CallTip is now CalltipWindow.
  18864. - bpo-33856: Add "help" in the welcome message of IDLE
  18865. - bpo-33839: IDLE: refactor ToolTip and CallTip and add documentation and
  18866. tests
  18867. - bpo-33855: Minimally test all IDLE modules. Add missing files, import
  18868. module, instantiate classes, and check coverage. Check existing files.
  18869. - bpo-33656: On Windows, add API call saying that tk scales for DPI. On
  18870. Windows 8.1+ or 10, with DPI compatibility properties of the Python binary
  18871. unchanged, and a monitor resolution greater than 96 DPI, this should make
  18872. text and lines sharper. It should otherwise have no effect.
  18873. - bpo-33768: Clicking on a context line moves that line to the top of the
  18874. editor window.
  18875. - bpo-33763: IDLE: Use read-only text widget for code context instead of
  18876. label widget.
  18877. - bpo-33664: Scroll IDLE editor text by lines. Previously, the mouse wheel
  18878. and scrollbar slider moved text by a fixed number of pixels, resulting in
  18879. partial lines at the top of the editor box. The change also applies to
  18880. the shell and grep output windows, but not to read-only text views.
  18881. - bpo-33679: Enable theme-specific color configuration for Code Context. Use
  18882. the Highlights tab to see the setting for built-in themes or add settings
  18883. to custom themes.
  18884. - bpo-33642: Display up to maxlines non-blank lines for Code Context. If
  18885. there is no current context, show a single blank line.
  18886. - bpo-33628: IDLE: Cleanup codecontext.py and its test.
  18887. - bpo-33564: IDLE's code context now recognizes async as a block opener.
  18888. - bpo-21474: Update word/identifier definition from ascii to unicode. In
  18889. text and entry boxes, this affects selection by double-click, movement
  18890. left/right by control-left/right, and deletion left/right by
  18891. control-BACKSPACE/DEL.
  18892. - bpo-33204: IDLE: consistently color invalid string prefixes. A 'u' string
  18893. prefix cannot be paired with either 'r' or 'f'. Consistently color as much
  18894. of the prefix, starting at the right, as is valid. Revise and extend
  18895. colorizer test.
  18896. - bpo-32984: Set ``__file__`` while running a startup file. Like Python,
  18897. IDLE optionally runs one startup file in the Shell window before
  18898. presenting the first interactive input prompt. For IDLE, ``-s`` runs a
  18899. file named in environmental variable :envvar:`IDLESTARTUP` or
  18900. :envvar:`PYTHONSTARTUP`; ``-r file`` runs ``file``. Python sets
  18901. ``__file__`` to the startup file name before running the file and unsets
  18902. it before the first prompt. IDLE now does the same when run normally,
  18903. without the ``-n`` option.
  18904. - bpo-32940: Simplify and rename StringTranslatePseudoMapping in pyparse.
  18905. - bpo-32916: Change ``str`` to ``code`` in pyparse.
  18906. - bpo-32905: Remove unused code in pyparse module.
  18907. - bpo-32874: Add tests for pyparse.
  18908. - bpo-32837: Using the system and place-dependent default encoding for
  18909. open() is a bad idea for IDLE's system and location-independent files.
  18910. - bpo-32826: Add "encoding=utf-8" to open() in IDLE's test_help_about. GUI
  18911. test test_file_buttons() only looks at initial ascii-only lines, but
  18912. failed on systems where open() defaults to 'ascii' because readline()
  18913. internally reads and decodes far enough ahead to encounter a non-ascii
  18914. character in CREDITS.txt.
  18915. - bpo-32831: Add docstrings and tests for codecontext.
  18916. - bpo-32765: Update configdialog General tab docstring to add new widgets to
  18917. the widget list.
  18918. Tools/Demos
  18919. -----------
  18920. - bpo-35884: Add a benchmark script for timing various ways to access
  18921. variables: ``Tools/scripts/var_access_benchmark.py``.
  18922. - bpo-34989: python-gdb.py now handles errors on computing the line number
  18923. of a Python frame.
  18924. - bpo-20260: Argument Clinic now has non-bitwise unsigned int converters.
  18925. - bpo-32962: python-gdb now catches ``UnicodeDecodeError`` exceptions when
  18926. calling ``string()``.
  18927. - bpo-32962: python-gdb now catches ValueError on read_var(): when Python
  18928. has no debug symbols for example.
  18929. - bpo-33189: :program:`pygettext.py` now recognizes only literal strings as
  18930. docstrings and translatable strings, and rejects bytes literals and
  18931. f-string expressions.
  18932. - bpo-31920: Fixed handling directories as arguments in the ``pygettext``
  18933. script. Based on patch by Oleg Krasnikov.
  18934. - bpo-29673: Fix pystackv and pystack gdbinit macros.
  18935. - bpo-25427: Remove the pyvenv script in favor of ``python3 -m venv`` in
  18936. order to lower confusion as to what Python interpreter a virtual
  18937. environment will be created for.
  18938. - bpo-32885: Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disable
  18939. automatic backup creation (files with ``~`` suffix).
  18940. - bpo-32222: Fix pygettext not extracting docstrings for functions with type
  18941. annotated arguments. Patch by Toby Harradine.
  18942. - bpo-31583: Fix 2to3 for using with --add-suffix option but without
  18943. --output-dir option for relative path to files in current directory.
  18944. C API
  18945. -----
  18946. - bpo-35713: The :c:func:`!PyByteArray_Init` and :c:func:`!PyByteArray_Fini`
  18947. functions have been removed. They did nothing since Python 2.7.4 and
  18948. Python 3.2.0, were excluded from the limited API (stable ABI), and were
  18949. not documented.
  18950. - bpo-33817: Fixed :c:func:`_PyBytes_Resize` for empty bytes objects.
  18951. - bpo-35322: Fix memory leak in :c:func:`PyUnicode_EncodeLocale` and
  18952. :c:func:`PyUnicode_EncodeFSDefault` on error handling.
  18953. - bpo-35059: The following C macros have been converted to static inline
  18954. functions: :c:func:`Py_INCREF`, :c:func:`Py_DECREF`, :c:func:`Py_XINCREF`,
  18955. :c:func:`Py_XDECREF`, :c:func:`PyObject_INIT`,
  18956. :c:func:`PyObject_INIT_VAR`.
  18957. - bpo-35296: ``make install`` now also installs the internal API:
  18958. ``Include/internal/*.h`` header files.
  18959. - bpo-35081: Internal APIs surrounded by ``#ifdef Py_BUILD_CORE`` have been
  18960. moved from ``Include/*.h`` headers to new header files
  18961. ``Include/internal/pycore_*.h``.
  18962. - bpo-35259: Conditionally declare :c:func:`Py_FinalizeEx()` (new in 3.6)
  18963. based on Py_LIMITED_API. Patch by Arthur Neufeld.
  18964. - bpo-35081: The :c:func:`!_PyObject_GC_TRACK` and
  18965. :c:func:`!_PyObject_GC_UNTRACK` macros have been removed from the public C
  18966. API.
  18967. - bpo-35134: Creation of a new ``Include/cpython/`` subdirectory.
  18968. - bpo-34725: Adds _Py_SetProgramFullPath so embedders may override
  18969. sys.executable
  18970. - bpo-34910: Ensure that :c:func:`PyObject_Print` always returns ``-1`` on
  18971. error. Patch by Zackery Spytz.
  18972. - bpo-34523: Py_DecodeLocale() and Py_EncodeLocale() now use the UTF-8
  18973. encoding on Windows if Py_LegacyWindowsFSEncodingFlag is zero.
  18974. - bpo-34193: Fix pluralization in TypeError messages in getargs.c and
  18975. typeobject.c: '1 argument' instead of '1 arguments' and '1 element'
  18976. instead of '1 elements'.
  18977. - bpo-34127: Return grammatically correct error message based on argument
  18978. count. Patch by Karthikeyan Singaravelan.
  18979. - bpo-23927: Fixed :exc:`SystemError` in
  18980. :c:func:`PyArg_ParseTupleAndKeywords` when the ``w*`` format unit is used
  18981. for optional parameter.
  18982. - bpo-32455: Added :c:func:`PyCompile_OpcodeStackEffectWithJump`.
  18983. - bpo-34008: Py_Main() can again be called after Py_Initialize(), as in
  18984. Python 3.6.
  18985. - bpo-32500: Fixed error messages for :c:func:`PySequence_Size`,
  18986. :c:func:`PySequence_GetItem`, :c:func:`PySequence_SetItem` and
  18987. :c:func:`PySequence_DelItem` called with a mapping and
  18988. :c:func:`PyMapping_Size` called with a sequence.
  18989. - bpo-33818: :c:func:`PyExceptionClass_Name` will now return ``const char
  18990. *`` instead of ``char *``.
  18991. - bpo-33042: Embedding applications may once again call
  18992. PySys_ResetWarnOptions, PySys_AddWarnOption, and PySys_AddXOption prior to
  18993. calling Py_Initialize.
  18994. - bpo-32374: Document that m_traverse for multi-phase initialized modules
  18995. can be called with m_state=NULL, and add a sanity check
  18996. - bpo-30863: :c:func:`PyUnicode_AsWideChar` and
  18997. :c:func:`PyUnicode_AsWideCharString` no longer cache the ``wchar_t*``
  18998. representation of string objects.
  18999. What's New in Python 3.7.0 final?
  19000. =================================
  19001. *Release date: 2018-06-27*
  19002. Library
  19003. -------
  19004. - bpo-33851: Fix :func:`ast.get_docstring` for a node that lacks a
  19005. docstring.
  19006. C API
  19007. -----
  19008. - bpo-33932: Calling Py_Initialize() twice does nothing, instead of failing
  19009. with a fatal error: restore the Python 3.6 behaviour.
  19010. What's New in Python 3.7.0 release candidate 1?
  19011. ===============================================
  19012. *Release date: 2018-06-12*
  19013. Core and Builtins
  19014. -----------------
  19015. - bpo-33803: Fix a crash in hamt.c caused by enabling GC tracking for an
  19016. object that hadn't all of its fields set to NULL.
  19017. - bpo-33706: Fix a crash in Python initialization when parsing the command
  19018. line options. Thanks Christoph Gohlke for the bug report and the fix!
  19019. - bpo-30654: Fixed reset of the SIGINT handler to SIG_DFL on interpreter
  19020. shutdown even when there was a custom handler set previously. Patch by
  19021. Philipp Kerling.
  19022. - bpo-31849: Fix signed/unsigned comparison warning in pyhash.c.
  19023. Library
  19024. -------
  19025. - bpo-30167: Prevent site.main() exception if PYTHONSTARTUP is set. Patch by
  19026. Steve Weber.
  19027. - bpo-33812: Datetime instance d with non-None tzinfo, but with
  19028. d.tzinfo.utcoffset(d) returning None is now treated as naive by the
  19029. astimezone() method.
  19030. - bpo-30805: Avoid race condition with debug logging
  19031. - bpo-33694: asyncio: Fix a race condition causing data loss on
  19032. pause_reading()/resume_reading() when using the ProactorEventLoop.
  19033. - bpo-32493: Correct test for ``uuid_enc_be`` availability in
  19034. ``configure.ac``. Patch by Michael Felt.
  19035. - bpo-33792: Add asyncio.WindowsSelectorEventLoopPolicy and
  19036. asyncio.WindowsProactorEventLoopPolicy.
  19037. - bpo-33778: Update ``unicodedata``'s database to Unicode version 11.0.0.
  19038. - bpo-33770: improve base64 exception message for encoded inputs of invalid
  19039. length
  19040. - bpo-33769: asyncio/start_tls: Fix error message; cancel callbacks in case
  19041. of an unhandled error; mark SSLTransport as closed if it is aborted.
  19042. - bpo-33767: The concatenation (``+``) and repetition (``*``) sequence
  19043. operations now raise :exc:`TypeError` instead of :exc:`SystemError` when
  19044. performed on :class:`mmap.mmap` objects. Patch by Zackery Spytz.
  19045. - bpo-33734: asyncio/ssl: Fix AttributeError, increase default handshake
  19046. timeout
  19047. - bpo-11874: Use a better regex when breaking usage into wrappable parts.
  19048. Avoids bogus assertion errors from custom metavar strings.
  19049. - bpo-33582: Emit a deprecation warning for inspect.formatargspec
  19050. Documentation
  19051. -------------
  19052. - bpo-33409: Clarified the relationship between :pep:`538`'s
  19053. PYTHONCOERCECLOCALE and PEP 540's PYTHONUTF8 mode.
  19054. - bpo-33736: Improve the documentation of :func:`asyncio.open_connection`,
  19055. :func:`asyncio.start_server` and their UNIX socket counterparts.
  19056. - bpo-31432: Clarify meaning of CERT_NONE, CERT_OPTIONAL, and CERT_REQUIRED
  19057. flags for ssl.SSLContext.verify_mode.
  19058. Build
  19059. -----
  19060. - bpo-5755: Move ``-Wstrict-prototypes`` option to ``CFLAGS_NODIST`` from
  19061. ``OPT``. This option emitted annoying warnings when building extension
  19062. modules written in C++.
  19063. Windows
  19064. -------
  19065. - bpo-33720: Reduces maximum marshal recursion depth on release builds.
  19066. IDLE
  19067. ----
  19068. - bpo-33656: On Windows, add API call saying that tk scales for DPI. On
  19069. Windows 8.1+ or 10, with DPI compatibility properties of the Python binary
  19070. unchanged, and a monitor resolution greater than 96 DPI, this should make
  19071. text and lines sharper. It should otherwise have no effect.
  19072. - bpo-33768: Clicking on a context line moves that line to the top of the
  19073. editor window.
  19074. - bpo-33763: IDLE: Use read-only text widget for code context instead of
  19075. label widget.
  19076. - bpo-33664: Scroll IDLE editor text by lines. Previously, the mouse wheel
  19077. and scrollbar slider moved text by a fixed number of pixels, resulting in
  19078. partial lines at the top of the editor box. The change also applies to
  19079. the shell and grep output windows, but not to read-only text views.
  19080. - bpo-33679: Enable theme-specific color configuration for Code Context. Use
  19081. the Highlights tab to see the setting for built-in themes or add settings
  19082. to custom themes.
  19083. - bpo-33642: Display up to maxlines non-blank lines for Code Context. If
  19084. there is no current context, show a single blank line.
  19085. What's New in Python 3.7.0 beta 5?
  19086. ==================================
  19087. *Release date: 2018-05-30*
  19088. Core and Builtins
  19089. -----------------
  19090. - bpo-33622: Fixed a leak when the garbage collector fails to add an object
  19091. with the ``__del__`` method or referenced by it into the
  19092. :data:`gc.garbage` list. :c:func:`PyGC_Collect` can now be called when an
  19093. exception is set and preserves it.
  19094. - bpo-33509: Fix module_globals parameter of warnings.warn_explicit(): don't
  19095. crash if module_globals is not a dict.
  19096. - bpo-20104: The new ``os.posix_spawn`` added in 3.7.0b1 was removed as we
  19097. are still working on what the API should look like. Expect this in 3.8
  19098. instead.
  19099. - bpo-33475: Fixed miscellaneous bugs in converting annotations to strings
  19100. and optimized parentheses in the string representation.
  19101. - bpo-33391: Fix a leak in set_symmetric_difference().
  19102. - bpo-28055: Fix unaligned accesses in siphash24(). Patch by Rolf Eike Beer.
  19103. - bpo-32911: Due to unexpected compatibility issues discovered during
  19104. downstream beta testing, reverted :issue:`29463`. ``docstring`` field is
  19105. removed from Module, ClassDef, FunctionDef, and AsyncFunctionDef ast nodes
  19106. which was added in 3.7a1. Docstring expression is restored as a first
  19107. statement in their body. Based on patch by Inada Naoki.
  19108. - bpo-21983: Fix a crash in ``ctypes.cast()`` in case the type argument is a
  19109. ctypes structured data type. Patch by Eryk Sun and Oren Milman.
  19110. Library
  19111. -------
  19112. - bpo-32751: When cancelling the task due to a timeout,
  19113. :meth:`asyncio.wait_for` will now wait until the cancellation is complete.
  19114. - bpo-32684: Fix gather to propagate cancellation of itself even with
  19115. return_exceptions.
  19116. - bpo-33654: Support protocol type switching in SSLTransport.set_protocol().
  19117. - bpo-33674: Pause the transport as early as possible to further reduce the
  19118. risk of data_received() being called before connection_made().
  19119. - bpo-33674: Fix a race condition in SSLProtocol.connection_made() of
  19120. asyncio.sslproto: start immediately the handshake instead of using
  19121. call_soon(). Previously, data_received() could be called before the
  19122. handshake started, causing the handshake to hang or fail.
  19123. - bpo-31647: Fixed bug where calling write_eof() on a
  19124. _SelectorSocketTransport after it's already closed raises AttributeError.
  19125. - bpo-32610: Make asyncio.all_tasks() return only pending tasks.
  19126. - bpo-32410: Avoid blocking on file IO in sendfile fallback code
  19127. - bpo-33469: Fix RuntimeError after closing loop that used run_in_executor
  19128. - bpo-33672: Fix Task.__repr__ crash with Cython's bogus coroutines
  19129. - bpo-33654: Fix transport.set_protocol() to support switching between
  19130. asyncio.Protocol and asyncio.BufferedProtocol. Fix loop.start_tls() to
  19131. work with asyncio.BufferedProtocols.
  19132. - bpo-33652: Pickles of type variables and subscripted generics are now
  19133. future-proof and compatible with older Python versions.
  19134. - bpo-32493: Fixed :func:`uuid.uuid1` on FreeBSD.
  19135. - bpo-33618: Finalize and document preliminary and experimental TLS 1.3
  19136. support with OpenSSL 1.1.1
  19137. - bpo-33623: Fix possible SIGSGV when asyncio.Future is created in __del__
  19138. - bpo-30877: Fixed a bug in the Python implementation of the JSON decoder
  19139. that prevented the cache of parsed strings from clearing after finishing
  19140. the decoding. Based on patch by c-fos.
  19141. - bpo-33570: Change TLS 1.3 cipher suite settings for compatibility with
  19142. OpenSSL 1.1.1-pre6 and newer. OpenSSL 1.1.1 will have TLS 1.3 ciphers
  19143. enabled by default.
  19144. - bpo-28556: Do not simplify arguments to ``typing.Union``. Now
  19145. ``Union[Manager, Employee]`` is not simplified to ``Employee`` at runtime.
  19146. Such simplification previously caused several bugs and limited
  19147. possibilities for introspection.
  19148. - bpo-33540: Add a new ``block_on_close`` class attribute to
  19149. ``ForkingMixIn`` and ``ThreadingMixIn`` classes of :mod:`socketserver`.
  19150. - bpo-33548: tempfile._candidate_tempdir_list should consider common TEMP
  19151. locations
  19152. - bpo-33109: argparse subparsers are once again not required by default,
  19153. reverting the change in behavior introduced by bpo-26510 in 3.7.0a2.
  19154. - bpo-33536: dataclasses.make_dataclass now checks for invalid field names
  19155. and duplicate fields. Also, added a check for invalid field
  19156. specifications.
  19157. - bpo-33542: Prevent ``uuid.get_node`` from using a DUID instead of a MAC on
  19158. Windows. Patch by Zvi Effron
  19159. - bpo-26819: Fix race condition with ``ReadTransport.resume_reading`` in
  19160. Windows proactor event loop.
  19161. - Fix failure in ``typing.get_type_hints()`` when ClassVar was provided as a
  19162. string forward reference.
  19163. - bpo-33505: Optimize asyncio.ensure_future() by reordering if checks: 1.17x
  19164. faster.
  19165. - bpo-33497: Add errors param to cgi.parse_multipart and make an encoding in
  19166. FieldStorage use the given errors (needed for Twisted). Patch by Amber
  19167. Brown.
  19168. - bpo-33495: Change dataclasses.Fields repr to use the repr of each of its
  19169. members, instead of str. This makes it more clear what each field
  19170. actually represents. This is especially true for the 'type' member.
  19171. - bpo-33453: Fix dataclasses to work if using literal string type
  19172. annotations or if using PEP 563 "Postponed Evaluation of Annotations".
  19173. Only specific string prefixes are detected for both ClassVar ("ClassVar"
  19174. and "typing.ClassVar") and InitVar ("InitVar" and "dataclasses.InitVar").
  19175. - bpo-28556: Minor fixes in typing module: add annotations to
  19176. ``NamedTuple.__new__``, pass ``*args`` and ``**kwds`` in
  19177. ``Generic.__new__``. Original PRs by Paulius Šarka and Chad Dombrova.
  19178. - bpo-20087: Updated alias mapping with glibc 2.27 supported locales.
  19179. - bpo-33422: Fix trailing quotation marks getting deleted when looking up
  19180. byte/string literals on pydoc. Patch by Andrés Delfino.
  19181. - bpo-28167: The function ``platform.linux_distribution`` and
  19182. ``platform.dist`` now trigger a ``DeprecationWarning`` and have been
  19183. marked for removal in Python 3.8
  19184. - bpo-33197: Update error message when constructing invalid
  19185. inspect.Parameters Patch by Donghee Na.
  19186. - bpo-33263: Fix FD leak in ``_SelectorSocketTransport`` Patch by Vlad
  19187. Starostin.
  19188. - bpo-32861: The urllib.robotparser's ``__str__`` representation now
  19189. includes wildcard entries and the "Crawl-delay" and "Request-rate" fields.
  19190. Patch by Michael Lazar.
  19191. - bpo-32257: The ssl module now contains OP_NO_RENEGOTIATION constant,
  19192. available with OpenSSL 1.1.0h or 1.1.1.
  19193. - bpo-16865: Support arrays >=2GiB in :mod:`ctypes`. Patch by Segev Finer.
  19194. Documentation
  19195. -------------
  19196. - bpo-23859: Document that ``asyncio.wait()`` does not cancel its futures on
  19197. timeout.
  19198. - bpo-32436: Document :pep:`567` changes to asyncio.
  19199. - bpo-33604: Update HMAC md5 default to a DeprecationWarning, bump removal
  19200. to 3.8.
  19201. - bpo-33503: Fix broken pypi link
  19202. - bpo-33421: Add missing documentation for ``typing.AsyncContextManager``.
  19203. Tests
  19204. -----
  19205. - bpo-33655: Ignore test_posix_fallocate failures on BSD platforms that
  19206. might be due to running on ZFS.
  19207. - bpo-32604: Remove the _xxsubinterpreters module (meant for testing) and
  19208. associated helpers. This module was originally added recently in 3.7b1.
  19209. Build
  19210. -----
  19211. - bpo-33614: Ensures module definition files for the stable ABI on Windows
  19212. are correctly regenerated.
  19213. - bpo-33522: Enable CI builds on Visual Studio Team Services at
  19214. https://python.visualstudio.com/cpython
  19215. - bpo-33012: Add ``-Wno-cast-function-type`` for gcc 8 for silencing
  19216. warnings about function casts like casting to PyCFunction in method
  19217. definition lists.
  19218. macOS
  19219. -----
  19220. - bpo-13631: The .editrc file in user's home directory is now processed
  19221. correctly during the readline initialization through editline emulation on
  19222. macOS.
  19223. IDLE
  19224. ----
  19225. - bpo-33628: IDLE: Cleanup codecontext.py and its test.
  19226. - bpo-33564: IDLE's code context now recognizes async as a block opener.
  19227. - bpo-32831: Add docstrings and tests for codecontext.
  19228. What's New in Python 3.7.0 beta 4?
  19229. ==================================
  19230. *Release date: 2018-05-02*
  19231. Core and Builtins
  19232. -----------------
  19233. - bpo-33363: Raise a SyntaxError for ``async with`` and ``async for``
  19234. statements outside of async functions.
  19235. - bpo-33128: Fix a bug that causes PathFinder to appear twice on
  19236. sys.meta_path. Patch by Pablo Galindo Salgado.
  19237. - bpo-33312: Fixed clang ubsan (undefined behavior sanitizer) warnings in
  19238. dictobject.c by adjusting how the internal struct _dictkeysobject shared
  19239. keys structure is declared.
  19240. - bpo-33231: Fix potential memory leak in ``normalizestring()``.
  19241. - bpo-33205: Change dict growth function from
  19242. ``round_up_to_power_2(used*2+hashtable_size/2)`` to
  19243. ``round_up_to_power_2(used*3)``. Previously, dict is shrinked only when
  19244. ``used == 0``. Now dict has more chance to be shrinked.
  19245. - bpo-29922: Improved error messages in 'async with' when ``__aenter__()``
  19246. or ``__aexit__()`` return non-awaitable object.
  19247. - bpo-33199: Fix ``ma_version_tag`` in dict implementation is uninitialized
  19248. when copying from key-sharing dict.
  19249. Library
  19250. -------
  19251. - bpo-33281: Fix ctypes.util.find_library regression on macOS.
  19252. - bpo-33383: Fixed crash in the get() method of the :mod:`dbm.ndbm` database
  19253. object when it is called with a single argument.
  19254. - bpo-33329: Fix multiprocessing regression on newer glibcs
  19255. - bpo-991266: Fix quoting of the ``Comment`` attribute of
  19256. :class:`http.cookies.SimpleCookie`.
  19257. - bpo-33131: Upgrade bundled version of pip to 10.0.1.
  19258. - bpo-33308: Fixed a crash in the :mod:`parser` module when converting an ST
  19259. object to a tree of tuples or lists with ``line_info=False`` and
  19260. ``col_info=True``.
  19261. - bpo-33266: lib2to3 now recognizes ``rf'...'`` strings.
  19262. - bpo-11594: Ensure line-endings are respected when using lib2to3.
  19263. - bpo-33254: Have :func:`importlib.resources.contents` and
  19264. :meth:`importlib.abc.ResourceReader.contents` return an :term:`iterable`
  19265. instead of an :term:`iterator`.
  19266. - bpo-33256: Fix display of ``<module>`` call in the html produced by
  19267. ``cgitb.html()``. Patch by Stéphane Blondon.
  19268. - bpo-33185: Fixed regression when running pydoc with the :option:`-m`
  19269. switch. (The regression was introduced in 3.7.0b3 by the resolution of
  19270. :issue:`33053`) This fix also changed pydoc to add ``os.getcwd()`` to
  19271. :data:`sys.path` when necessary, rather than adding ``"."``.
  19272. - bpo-33169: Delete entries of ``None`` in :data:`sys.path_importer_cache`
  19273. when :meth:`importlib.machinery.invalidate_caches` is called.
  19274. - bpo-33217: Deprecate looking up non-Enum objects in Enum classes and Enum
  19275. members (will raise :exc:`TypeError` in 3.8+).
  19276. - bpo-33203: ``random.Random.choice()`` now raises ``IndexError`` for empty
  19277. sequences consistently even when called from subclasses without a
  19278. ``getrandbits()`` implementation.
  19279. - bpo-33224: Update difflib.mdiff() for :pep:`479`. Convert an uncaught
  19280. StopIteration in a generator into a return-statement.
  19281. - bpo-33209: End framing at the end of C implementation of
  19282. :func:`pickle.Pickler.dump`.
  19283. - bpo-20104: Improved error handling and fixed a reference leak in
  19284. :func:`os.posix_spawn()`.
  19285. - bpo-33175: In dataclasses, Field.__set_name__ now looks up the
  19286. __set_name__ special method on the class, not the instance, of the default
  19287. value.
  19288. - bpo-33097: Raise RuntimeError when ``executor.submit`` is called during
  19289. interpreter shutdown.
  19290. - bpo-31908: Fix output of cover files for ``trace`` module command-line
  19291. tool. Previously emitted cover files only when ``--missing`` option was
  19292. used. Patch by Michael Selik.
  19293. Documentation
  19294. -------------
  19295. - bpo-33378: Add Korean language switcher for https://docs.python.org/3/
  19296. - bpo-33276: Clarify that the ``__path__`` attribute on modules cannot be
  19297. just any value.
  19298. - bpo-33201: Modernize documentation for writing C extension types.
  19299. - bpo-33195: Deprecate ``Py_UNICODE`` usage in ``c-api/arg`` document.
  19300. ``Py_UNICODE`` related APIs are deprecated since Python 3.3, but it is
  19301. missed in the document.
  19302. - bpo-8243: Add a note about curses.addch and curses.addstr exception
  19303. behavior when writing outside a window, or pad.
  19304. - bpo-32337: Update documentation related with ``dict`` order.
  19305. Tests
  19306. -----
  19307. - bpo-33358: Fix ``test_embed.test_pre_initialization_sys_options()`` when
  19308. the interpreter is built with ``--enable-shared``.
  19309. Build
  19310. -----
  19311. - bpo-33394: Enable the verbose build for extension modules, when GNU make
  19312. is passed macros on the command line.
  19313. - bpo-33393: Update config.guess and config.sub files.
  19314. - bpo-33377: Add new triplets for mips r6 and riscv variants (used in
  19315. extension suffixes).
  19316. - bpo-32232: By default, modules configured in ``Modules/Setup`` are no
  19317. longer built with ``-DPy_BUILD_CORE``. Instead, modules that specifically
  19318. need that preprocessor definition include it in their individual entries.
  19319. - bpo-33182: The embedding tests can once again be built with clang 6.0
  19320. Windows
  19321. -------
  19322. - bpo-33184: Update Windows installer to use OpenSSL 1.1.0h.
  19323. macOS
  19324. -----
  19325. - bpo-33184: Update macOS installer build to use OpenSSL 1.1.0h.
  19326. IDLE
  19327. ----
  19328. - bpo-21474: Update word/identifier definition from ascii to unicode. In
  19329. text and entry boxes, this affects selection by double-click, movement
  19330. left/right by control-left/right, and deletion left/right by
  19331. control-BACKSPACE/DEL.
  19332. - bpo-33204: IDLE: consistently color invalid string prefixes. A 'u' string
  19333. prefix cannot be paired with either 'r' or 'f'. Consistently color as much
  19334. of the prefix, starting at the right, as is valid. Revise and extend
  19335. colorizer test.
  19336. Tools/Demos
  19337. -----------
  19338. - bpo-33189: :program:`pygettext.py` now recognizes only literal strings as
  19339. docstrings and translatable strings, and rejects bytes literals and
  19340. f-string expressions.
  19341. - bpo-31920: Fixed handling directories as arguments in the ``pygettext``
  19342. script. Based on patch by Oleg Krasnikov.
  19343. - bpo-29673: Fix pystackv and pystack gdbinit macros.
  19344. - bpo-31583: Fix 2to3 for using with --add-suffix option but without
  19345. --output-dir option for relative path to files in current directory.
  19346. What's New in Python 3.7.0 beta 3?
  19347. ==================================
  19348. *Release date: 2018-03-29*
  19349. Security
  19350. --------
  19351. - bpo-33136: Harden ssl module against LibreSSL CVE-2018-8970.
  19352. X509_VERIFY_PARAM_set1_host() is called with an explicit namelen. A new
  19353. test ensures that NULL bytes are not allowed.
  19354. - bpo-33001: Minimal fix to prevent buffer overrun in os.symlink on Windows
  19355. - bpo-32981: Regexes in difflib and poplib were vulnerable to catastrophic
  19356. backtracking. These regexes formed potential DOS vectors (REDOS). They
  19357. have been refactored. This resolves CVE-2018-1060 and CVE-2018-1061. Patch
  19358. by Jamie Davis.
  19359. Core and Builtins
  19360. -----------------
  19361. - bpo-33053: When using the -m switch, sys.path[0] is now explicitly
  19362. expanded as the *starting* working directory, rather than being left as
  19363. the empty path (which allows imports from the current working directory at
  19364. the time of the import)
  19365. - bpo-33018: Improve consistency of errors raised by ``issubclass()`` when
  19366. called with a non-class and an abstract base class as the first and second
  19367. arguments, respectively. Patch by Josh Bronson.
  19368. - bpo-33041: Fixed jumping when the function contains an ``async for`` loop.
  19369. - bpo-33026: Fixed jumping out of "with" block by setting f_lineno.
  19370. - bpo-33005: Fix a crash on fork when using a custom memory allocator (ex:
  19371. using PYTHONMALLOC env var). _PyGILState_Reinit() and
  19372. _PyInterpreterState_Enable() now use the default RAW memory allocator to
  19373. allocate a new interpreters mutex on fork.
  19374. - bpo-17288: Prevent jumps from 'return' and 'exception' trace events.
  19375. - bpo-32836: Don't use temporary variables in cases of list/dict/set
  19376. comprehensions
  19377. Library
  19378. -------
  19379. - bpo-33141: Have Field objects pass through __set_name__ to their default
  19380. values, if they have their own __set_name__.
  19381. - bpo-33096: Allow ttk.Treeview.insert to insert iid that has a false
  19382. boolean value. Note iid=0 and iid=False would be same. Patch by Garvit
  19383. Khatri.
  19384. - bpo-32873: Treat type variables and special typing forms as immutable by
  19385. copy and pickle. This fixes several minor issues and inconsistencies, and
  19386. improves backwards compatibility with Python 3.6.
  19387. - bpo-33134: When computing dataclass's __hash__, use the lookup table to
  19388. contain the function which returns the __hash__ value. This is an
  19389. improvement over looking up a string, and then testing that string to see
  19390. what to do.
  19391. - bpo-33127: The ssl module now compiles with LibreSSL 2.7.1.
  19392. - bpo-32505: Raise TypeError if a member variable of a dataclass is of type
  19393. Field, but doesn't have a type annotation.
  19394. - bpo-33078: Fix the failure on OSX caused by the tests relying on
  19395. sem_getvalue
  19396. - bpo-33116: Add 'Field' to dataclasses.__all__.
  19397. - bpo-32896: Fix an error where subclassing a dataclass with a field that
  19398. uses a default_factory would generate an incorrect class.
  19399. - bpo-33100: Dataclasses: If a field has a default value that's a
  19400. MemberDescriptorType, then it's from that field being in __slots__, not an
  19401. actual default value.
  19402. - bpo-32953: If a non-dataclass inherits from a frozen dataclass, allow
  19403. attributes to be added to the derived class. Only attributes from the
  19404. frozen dataclass cannot be assigned to. Require all dataclasses in a
  19405. hierarchy to be either all frozen or all non-frozen.
  19406. - bpo-33061: Add missing ``NoReturn`` to ``__all__`` in typing.py
  19407. - bpo-33078: Fix the size handling in multiprocessing.Queue when a pickling
  19408. error occurs.
  19409. - bpo-33064: lib2to3 now properly supports trailing commas after ``*args``
  19410. and ``**kwargs`` in function signatures.
  19411. - bpo-33056: FIX properly close leaking fds in
  19412. concurrent.futures.ProcessPoolExecutor.
  19413. - bpo-33021: Release the GIL during fstat() calls, avoiding hang of all
  19414. threads when calling mmap.mmap(), os.urandom(), and random.seed(). Patch
  19415. by Nir Soffer.
  19416. - bpo-31804: Avoid failing in multiprocessing.Process if the standard
  19417. streams are closed or None at exit.
  19418. - bpo-33037: Skip sending/receiving data after SSL transport closing.
  19419. - bpo-27683: Fix a regression in :mod:`ipaddress` that result of
  19420. :meth:`hosts` is empty when the network is constructed by a tuple
  19421. containing an integer mask and only 1 bit left for addresses.
  19422. - bpo-32999: Fix C implementation of ``ABC.__subclasscheck__(cls,
  19423. subclass)`` crashed when ``subclass`` is not a type object.
  19424. - bpo-33009: Fix inspect.signature() for single-parameter partialmethods.
  19425. - bpo-32969: Expose several missing constants in zlib and fix corresponding
  19426. documentation.
  19427. - bpo-32056: Improved exceptions raised for invalid number of channels and
  19428. sample width when read an audio file in modules :mod:`aifc`, :mod:`wave`
  19429. and :mod:`sunau`.
  19430. - bpo-32844: Fix wrong redirection of a low descriptor (0 or 1) to stderr in
  19431. subprocess if another low descriptor is closed.
  19432. - bpo-32857: In :mod:`tkinter`, ``after_cancel(None)`` now raises a
  19433. :exc:`ValueError` instead of canceling the first scheduled function.
  19434. Patch by Cheryl Sabella.
  19435. - bpo-31639: http.server now exposes a ThreadedHTTPServer class and uses it
  19436. when the module is run with ``-m`` to cope with web browsers pre-opening
  19437. sockets.
  19438. - bpo-27645: :class:`sqlite3.Connection` now exposes a
  19439. :class:`~sqlite3.Connection.backup` method, if the underlying SQLite
  19440. library is at version 3.6.11 or higher. Patch by Lele Gaifax.
  19441. Documentation
  19442. -------------
  19443. - bpo-33126: Document PyBuffer_ToContiguous().
  19444. - bpo-27212: Modify documentation for the :func:`islice` recipe to consume
  19445. initial values up to the start index.
  19446. - bpo-28247: Update :mod:`zipapp` documentation to describe how to make
  19447. standalone applications.
  19448. - bpo-18802: Documentation changes for ipaddress. Patch by Jon Foster and
  19449. Berker Peksag.
  19450. - bpo-27428: Update documentation to clarify that ``WindowsRegistryFinder``
  19451. implements ``MetaPathFinder``. (Patch by Himanshu Lakhara)
  19452. Tests
  19453. -----
  19454. - bpo-32872: Avoid regrtest compatibility issue with namespace packages.
  19455. - bpo-32517: Fix failing ``test_asyncio`` on macOS 10.12.2+ due to transport
  19456. of ``KqueueSelector`` loop was not being closed.
  19457. - bpo-19417: Add test_bdb.py.
  19458. Build
  19459. -----
  19460. - bpo-33163: Upgrade pip to 9.0.3 and setuptools to v39.0.1.
  19461. Windows
  19462. -------
  19463. - bpo-33016: Fix potential use of uninitialized memory in
  19464. nt._getfinalpathname
  19465. - bpo-32903: Fix a memory leak in os.chdir() on Windows if the current
  19466. directory is set to a UNC path.
  19467. macOS
  19468. -----
  19469. - bpo-32726: Build and link with private copy of Tcl/Tk 8.6 for the macOS
  19470. 10.6+ installer. The 10.9+ installer variant already does this. This
  19471. means that the Python 3.7 provided by the python.org macOS installers no
  19472. longer need or use any external versions of Tcl/Tk, either system-provided
  19473. or user-installed, such as ActiveTcl.
  19474. IDLE
  19475. ----
  19476. - bpo-32984: Set ``__file__`` while running a startup file. Like Python,
  19477. IDLE optionally runs one startup file in the Shell window before
  19478. presenting the first interactive input prompt. For IDLE, ``-s`` runs a
  19479. file named in environmental variable :envvar:`IDLESTARTUP` or
  19480. :envvar:`PYTHONSTARTUP`; ``-r file`` runs ``file``. Python sets
  19481. ``__file__`` to the startup file name before running the file and unsets
  19482. it before the first prompt. IDLE now does the same when run normally,
  19483. without the ``-n`` option.
  19484. - bpo-32940: Simplify and rename StringTranslatePseudoMapping in pyparse.
  19485. Tools/Demos
  19486. -----------
  19487. - bpo-32885: Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disable
  19488. automatic backup creation (files with ``~`` suffix).
  19489. C API
  19490. -----
  19491. - bpo-33042: Embedding applications may once again call
  19492. PySys_ResetWarnOptions, PySys_AddWarnOption, and PySys_AddXOption prior to
  19493. calling Py_Initialize.
  19494. - bpo-32374: Document that m_traverse for multi-phase initialized modules
  19495. can be called with m_state=NULL, and add a sanity check
  19496. What's New in Python 3.7.0 beta 2?
  19497. ==================================
  19498. *Release date: 2018-02-27*
  19499. Security
  19500. --------
  19501. - bpo-28414: The ssl module now allows users to perform their own IDN
  19502. en/decoding when using SNI.
  19503. Core and Builtins
  19504. -----------------
  19505. - bpo-32889: Update Valgrind suppression list to account for the rename of
  19506. ``Py_ADDRESS_IN_RANG`` to ``address_in_range``.
  19507. - bpo-31356: Remove the new API added in bpo-31356 (gc.ensure_disabled()
  19508. context manager).
  19509. - bpo-32305: For namespace packages, ensure that both ``__file__`` and
  19510. ``__spec__.origin`` are set to None.
  19511. - bpo-32303: Make sure ``__spec__.loader`` matches ``__loader__`` for
  19512. namespace packages.
  19513. - bpo-32711: Fix the warning messages for Python/ast_unparse.c. Patch by
  19514. Stéphane Wirtel
  19515. - bpo-32583: Fix possible crashing in builtin Unicode decoders caused by
  19516. write out-of-bound errors when using customized decode error handlers.
  19517. Library
  19518. -------
  19519. - bpo-32960: For dataclasses, disallow inheriting frozen from non-frozen
  19520. classes, and also disallow inheriting non-frozen from frozen classes. This
  19521. restriction will be relaxed at a future date.
  19522. - bpo-32713: Fixed tarfile.itn handling of out-of-bounds float values. Patch
  19523. by Joffrey Fuhrer.
  19524. - bpo-32951: Direct instantiation of SSLSocket and SSLObject objects is now
  19525. prohibited. The constructors were never documented, tested, or designed as
  19526. public constructors. Users were suppose to use ssl.wrap_socket() or
  19527. SSLContext.
  19528. - bpo-32929: Remove the tri-state parameter "hash", and add the boolean
  19529. "unsafe_hash". If unsafe_hash is True, add a __hash__ function, but if a
  19530. __hash__ exists, raise TypeError. If unsafe_hash is False, add a __hash__
  19531. based on the values of eq= and frozen=. The unsafe_hash=False behavior is
  19532. the same as the old hash=None behavior. unsafe_hash=False is the default,
  19533. just as hash=None used to be.
  19534. - bpo-32947: Add OP_ENABLE_MIDDLEBOX_COMPAT and test workaround for TLSv1.3
  19535. for future compatibility with OpenSSL 1.1.1.
  19536. - bpo-30622: The ssl module now detects missing NPN support in LibreSSL.
  19537. - bpo-32922: dbm.open() now encodes filename with the filesystem encoding
  19538. rather than default encoding.
  19539. - bpo-32859: In ``os.dup2``, don't check every call whether the ``dup3``
  19540. syscall exists or not.
  19541. - bpo-32556: nt._getfinalpathname, nt._getvolumepathname and
  19542. nt._getdiskusage now correctly convert from bytes.
  19543. - bpo-25988: Emit a :exc:`DeprecationWarning` when using or importing an ABC
  19544. directly from :mod:`collections` rather than from :mod:`collections.abc`.
  19545. - bpo-21060: Rewrite confusing message from setup.py upload from "No dist
  19546. file created in earlier command" to the more helpful "Must create and
  19547. upload files in one command".
  19548. - bpo-32852: Make sure sys.argv remains as a list when running trace.
  19549. - bpo-31333: ``_abc`` module is added. It is a speedup module with C
  19550. implementations for various functions and methods in ``abc``. Creating an
  19551. ABC subclass and calling ``isinstance`` or ``issubclass`` with an ABC
  19552. subclass are up to 1.5x faster. In addition, this makes Python start-up up
  19553. to 10% faster. Note that the new implementation hides internal registry
  19554. and caches, previously accessible via private attributes
  19555. ``_abc_registry``, ``_abc_cache``, and ``_abc_negative_cache``. There are
  19556. three debugging helper methods that can be used instead
  19557. ``_dump_registry``, ``_abc_registry_clear``, and ``_abc_caches_clear``.
  19558. - bpo-32841: Fixed ``asyncio.Condition`` issue which silently ignored
  19559. cancellation after notifying and cancelling a conditional lock. Patch by
  19560. Bar Harel.
  19561. - bpo-32819: ssl.match_hostname() has been simplified and no longer depends
  19562. on re and ipaddress module for wildcard and IP addresses. Error reporting
  19563. for invalid wildcards has been improved.
  19564. - bpo-32394: socket: Remove
  19565. TCP_FASTOPEN,TCP_KEEPCNT,TCP_KEEPIDLE,TCP_KEEPINTVL flags on older version
  19566. Windows during run-time.
  19567. - bpo-31787: Fixed refleaks of ``__init__()`` methods in various modules.
  19568. (Contributed by Oren Milman)
  19569. - bpo-30157: Fixed guessing quote and delimiter in csv.Sniffer.sniff() when
  19570. only the last field is quoted. Patch by Jake Davis.
  19571. - bpo-32792: collections.ChainMap() preserves the order of the underlying
  19572. mappings.
  19573. - bpo-32775: :func:`fnmatch.translate()` no longer produces patterns which
  19574. contain set operations. Sets starting with '[' or containing '--', '&&',
  19575. '~~' or '||' will be interpreted differently in regular expressions in
  19576. future versions. Currently they emit warnings. fnmatch.translate() now
  19577. avoids producing patterns containing such sets by accident.
  19578. - bpo-32622: Implement native fast sendfile for Windows proactor event loop.
  19579. - bpo-32777: Fix a rare but potential pre-exec child process deadlock in
  19580. subprocess on POSIX systems when marking file descriptors inheritable on
  19581. exec in the child process. This bug appears to have been introduced in
  19582. 3.4.
  19583. - bpo-32647: The ctypes module used to depend on indirect linking for
  19584. dlopen. The shared extension is now explicitly linked against libdl on
  19585. platforms with dl.
  19586. - bpo-32741: Implement ``asyncio.TimerHandle.when()`` method.
  19587. - bpo-32691: Use mod_spec.parent when running modules with pdb
  19588. - bpo-32734: Fixed ``asyncio.Lock()`` safety issue which allowed acquiring
  19589. and locking the same lock multiple times, without it being free. Patch by
  19590. Bar Harel.
  19591. - bpo-32727: Do not include name field in SMTP envelope from address. Patch
  19592. by Stéphane Wirtel
  19593. - bpo-31453: Add TLSVersion constants and SSLContext.maximum_version /
  19594. minimum_version attributes. The new API wraps OpenSSL 1.1
  19595. https://web.archive.org/web/20180309043602/https://www.openssl.org/docs/man1.1.0/ssl/SSL_CTX_set_min_proto_version.html
  19596. feature.
  19597. - bpo-24334: Internal implementation details of ssl module were cleaned up.
  19598. The SSLSocket has one less layer of indirection. Owner and session
  19599. information are now handled by the SSLSocket and SSLObject constructor.
  19600. Channel binding implementation has been simplified.
  19601. - bpo-31848: Fix the error handling in Aifc_read.initfp() when the SSND
  19602. chunk is not found. Patch by Zackery Spytz.
  19603. - bpo-32585: Add Ttk spinbox widget to :mod:`tkinter.ttk`. Patch by Alan D
  19604. Moore.
  19605. - bpo-32221: Various functions returning tuple containing IPv6 addresses now
  19606. omit ``%scope`` part since the same information is already encoded in
  19607. *scopeid* tuple item. Especially this speeds up :func:`socket.recvfrom`
  19608. when it receives multicast packet since useless resolving of network
  19609. interface name is omitted.
  19610. - bpo-30693: The TarFile class now recurses directories in a reproducible
  19611. way.
  19612. - bpo-30693: The ZipFile class now recurses directories in a reproducible
  19613. way.
  19614. Documentation
  19615. -------------
  19616. - bpo-28124: The ssl module function ssl.wrap_socket() has been
  19617. de-emphasized and deprecated in favor of the more secure and efficient
  19618. SSLContext.wrap_socket() method.
  19619. - bpo-17232: Clarify docs for -O and -OO. Patch by Terry Reedy.
  19620. - bpo-32436: Add documentation for the contextvars module (PEP 567).
  19621. - bpo-32800: Update link to w3c doc for xml default namespaces.
  19622. - bpo-11015: Update :mod:`test.support` documentation.
  19623. - bpo-8722: Document :meth:`__getattr__` behavior when property :meth:`get`
  19624. method raises :exc:`AttributeError`.
  19625. - bpo-32614: Modify RE examples in documentation to use raw strings to
  19626. prevent :exc:`DeprecationWarning` and add text to REGEX HOWTO to highlight
  19627. the deprecation.
  19628. - bpo-31972: Improve docstrings for ``pathlib.PurePath`` subclasses.
  19629. Tests
  19630. -----
  19631. - bpo-31809: Add tests to verify connection with secp ECDH curves.
  19632. Build
  19633. -----
  19634. - bpo-32898: Fix the python debug build when using COUNT_ALLOCS.
  19635. Windows
  19636. -------
  19637. - bpo-32901: Update Tcl and Tk versions to 8.6.8
  19638. - bpo-31966: Fixed WindowsConsoleIO.write() for writing empty data.
  19639. - bpo-32409: Ensures activate.bat can handle Unicode contents.
  19640. - bpo-32457: Improves handling of denormalized executable path when
  19641. launching Python.
  19642. - bpo-32370: Use the correct encoding for ipconfig output in the uuid
  19643. module. Patch by Segev Finer.
  19644. - bpo-29248: Fix :func:`os.readlink` on Windows, which was mistakenly
  19645. treating the ``PrintNameOffset`` field of the reparse data buffer as a
  19646. number of characters instead of bytes. Patch by Craig Holmquist and SSE4.
  19647. macOS
  19648. -----
  19649. - bpo-32901: Update macOS 10.9+ installer to Tcl/Tk 8.6.8.
  19650. IDLE
  19651. ----
  19652. - bpo-32916: Change ``str`` to ``code`` in pyparse.
  19653. - bpo-32905: Remove unused code in pyparse module.
  19654. - bpo-32874: Add tests for pyparse.
  19655. - bpo-32837: Using the system and place-dependent default encoding for
  19656. open() is a bad idea for IDLE's system and location-independent files.
  19657. - bpo-32826: Add "encoding=utf-8" to open() in IDLE's test_help_about. GUI
  19658. test test_file_buttons() only looks at initial ascii-only lines, but
  19659. failed on systems where open() defaults to 'ascii' because readline()
  19660. internally reads and decodes far enough ahead to encounter a non-ascii
  19661. character in CREDITS.txt.
  19662. - bpo-32765: Update configdialog General tab docstring to add new widgets to
  19663. the widget list.
  19664. Tools/Demos
  19665. -----------
  19666. - bpo-32222: Fix pygettext not extracting docstrings for functions with type
  19667. annotated arguments. Patch by Toby Harradine.
  19668. What's New in Python 3.7.0 beta 1?
  19669. ==================================
  19670. *Release date: 2018-01-30*
  19671. Core and Builtins
  19672. -----------------
  19673. - bpo-32703: Fix coroutine's ResourceWarning when there's an active error
  19674. set when it's being finalized.
  19675. - bpo-32650: Pdb and other debuggers dependent on bdb.py will correctly step
  19676. over (next command) native coroutines. Patch by Pablo Galindo.
  19677. - bpo-28685: Optimize list.sort() and sorted() by using type specialized
  19678. comparisons when possible.
  19679. - bpo-32685: Improve suggestion when the Python 2 form of print statement is
  19680. either present on the same line as the header of a compound statement or
  19681. else terminated by a semi-colon instead of a newline. Patch by Nitish
  19682. Chandra.
  19683. - bpo-32697: Python now explicitly preserves the definition order of
  19684. keyword-only parameters. It's always preserved their order, but this
  19685. behavior was never guaranteed before; this behavior is now guaranteed and
  19686. tested.
  19687. - bpo-32690: The locals() dictionary now displays in the lexical order that
  19688. variables were defined. Previously, the order was reversed.
  19689. - bpo-32677: Add ``.isascii()`` method to ``str``, ``bytes`` and
  19690. ``bytearray``. It can be used to test that string contains only ASCII
  19691. characters.
  19692. - bpo-32670: Enforce :pep:`479` for all code. This means that manually
  19693. raising a StopIteration exception from a generator is prohibited for all
  19694. code, regardless of whether 'from __future__ import generator_stop' was
  19695. used or not.
  19696. - bpo-32591: Added built-in support for tracking the origin of coroutine
  19697. objects; see sys.set_coroutine_origin_tracking_depth and
  19698. CoroutineType.cr_origin. This replaces the asyncio debug mode's use of
  19699. coroutine wrapping for native coroutine objects.
  19700. - bpo-31368: Expose preadv and pwritev system calls in the os module. Patch
  19701. by Pablo Galindo
  19702. - bpo-32544: ``hasattr(obj, name)`` and ``getattr(obj, name, default)`` are
  19703. about 4 times faster than before when ``name`` is not found and ``obj``
  19704. doesn't override ``__getattr__`` or ``__getattribute__``.
  19705. - bpo-26163: Improved frozenset() hash to create more distinct hash values
  19706. when faced with datasets containing many similar values.
  19707. - bpo-32550: Remove the STORE_ANNOTATION bytecode.
  19708. - bpo-20104: Expose posix_spawn as a low level API in the os module.
  19709. (removed before 3.7.0rc1)
  19710. - bpo-24340: Fixed estimation of the code stack size.
  19711. - bpo-32436: Implement :pep:`567` Context Variables.
  19712. - bpo-18533: ``repr()`` on a dict containing its own ``values()`` or
  19713. ``items()`` no longer raises ``RecursionError``; OrderedDict similarly.
  19714. Instead, use ``...``, as for other recursive structures. Patch by Ben
  19715. North.
  19716. - bpo-20891: Py_Initialize() now creates the GIL. The GIL is no longer
  19717. created "on demand" to fix a race condition when PyGILState_Ensure() is
  19718. called in a non-Python thread.
  19719. - bpo-32028: Leading whitespace is now correctly ignored when generating
  19720. suggestions for converting Py2 print statements to Py3 builtin print
  19721. function calls. Patch by Sanyam Khurana.
  19722. - bpo-31179: Make dict.copy() up to 5.5 times faster.
  19723. - bpo-31113: Get rid of recursion in the compiler for normal control flow.
  19724. Library
  19725. -------
  19726. - bpo-25988: Deprecate exposing the contents of collections.abc in the
  19727. regular collections module.
  19728. - bpo-31429: The default cipher suite selection of the ssl module now uses a
  19729. blacklist approach rather than a hard-coded whitelist. Python no longer
  19730. re-enables ciphers that have been blocked by OpenSSL security update.
  19731. Default cipher suite selection can be configured on compile time.
  19732. - bpo-30306: contextlib.contextmanager now releases the arguments passed to
  19733. the underlying generator as soon as the context manager is entered.
  19734. Previously it would keep them alive for as long as the context manager was
  19735. alive, even when not being used as a function decorator. Patch by Martin
  19736. Teichmann.
  19737. - bpo-21417: Added support for setting the compression level for
  19738. zipfile.ZipFile.
  19739. - bpo-32251: Implement asyncio.BufferedProtocol (provisional API).
  19740. - bpo-32513: In dataclasses, allow easier overriding of dunder methods
  19741. without specifying decorator parameters.
  19742. - bpo-32660: :mod:`termios` makes available ``FIONREAD``, ``FIONCLEX``,
  19743. ``FIOCLEX``, ``FIOASYNC`` and ``FIONBIO`` also under Solaris/derivatives.
  19744. - bpo-27931: Fix email address header parsing error when the username is an
  19745. empty quoted string. Patch by Xiang Zhang.
  19746. - bpo-32659: Under Solaris and derivatives, :class:`os.stat_result` provides
  19747. a st_fstype attribute.
  19748. - bpo-32662: Implement Server.start_serving(), Server.serve_forever(), and
  19749. Server.is_serving() methods. Add 'start_serving' keyword parameter to
  19750. loop.create_server() and loop.create_unix_server().
  19751. - bpo-32391: Implement :meth:`asyncio.StreamWriter.wait_closed` and
  19752. :meth:`asyncio.StreamWriter.is_closing` methods
  19753. - bpo-32643: Make Task._step, Task._wakeup and Future._schedule_callbacks
  19754. methods private.
  19755. - bpo-32630: Refactor decimal module to use contextvars to store decimal
  19756. context.
  19757. - bpo-32622: Add :meth:`asyncio.AbstractEventLoop.sendfile` method.
  19758. - bpo-32304: distutils' upload command no longer corrupts tar files ending
  19759. with a CR byte, and no longer tries to convert CR to CRLF in any of the
  19760. upload text fields.
  19761. - bpo-32502: uuid.uuid1 no longer raises an exception if a 64-bit hardware
  19762. address is encountered.
  19763. - bpo-32596: ``concurrent.futures`` imports ``ThreadPoolExecutor`` and
  19764. ``ProcessPoolExecutor`` lazily (using :pep:`562`). It makes ``import
  19765. asyncio`` about 15% faster because asyncio uses only
  19766. ``ThreadPoolExecutor`` by default.
  19767. - bpo-31801: Add ``_ignore_`` to ``Enum`` so temporary variables can be used
  19768. during class construction without being turned into members.
  19769. - bpo-32576: Use queue.SimpleQueue() in places where it can be invoked from
  19770. a weakref callback.
  19771. - bpo-32574: Fix memory leak in asyncio.Queue, when the queue has limited
  19772. size and it is full, the cancelation of queue.put() can cause a memory
  19773. leak. Patch by: José Melero.
  19774. - bpo-32521: The nis module is now compatible with new libnsl and headers
  19775. location.
  19776. - bpo-32467: collections.abc.ValuesView now inherits from
  19777. collections.abc.Collection.
  19778. - bpo-32473: Improve ABCMeta._dump_registry() output readability
  19779. - bpo-32102: New argument ``capture_output`` for subprocess.run
  19780. - bpo-32521: glibc has removed Sun RPC. Use replacement libtirpc headers and
  19781. library in nis module.
  19782. - bpo-32493: UUID module fixes build for FreeBSD/OpenBSD
  19783. - bpo-32503: Pickling with protocol 4 no longer creates too small frames.
  19784. - bpo-29237: Create enum for pstats sorting options
  19785. - bpo-32454: Add close(fd) function to the socket module.
  19786. - bpo-25942: The subprocess module is now more graceful when handling a
  19787. Ctrl-C KeyboardInterrupt during subprocess.call, subprocess.run, or a
  19788. Popen context manager. It now waits a short amount of time for the child
  19789. (presumed to have also gotten the SIGINT) to exit, before continuing the
  19790. KeyboardInterrupt exception handling. This still includes a SIGKILL in
  19791. the call() and run() APIs, but at least the child had a chance first.
  19792. - bpo-32433: The hmac module now has hmac.digest(), which provides an
  19793. optimized HMAC digest.
  19794. - bpo-28134: Sockets now auto-detect family, type and protocol from file
  19795. descriptor by default.
  19796. - bpo-32404: Fix bug where :meth:`datetime.datetime.fromtimestamp` did not
  19797. call __new__ in :class:`datetime.datetime` subclasses.
  19798. - bpo-32403: Improved speed of :class:`datetime.date` and
  19799. :class:`datetime.datetime` alternate constructors.
  19800. - bpo-32228: Ensure that ``truncate()`` preserves the file position (as
  19801. reported by ``tell()``) after writes longer than the buffer size.
  19802. - bpo-32410: Implement ``loop.sock_sendfile`` for asyncio event loop.
  19803. - bpo-22908: Added seek and tell to the ZipExtFile class. This only works if
  19804. the file object used to open the zipfile is seekable.
  19805. - bpo-32373: Add socket.getblocking() method.
  19806. - bpo-32248: Add :mod:`importlib.resources` and
  19807. :class:`importlib.abc.ResourceReader` as the unified API for reading
  19808. resources contained within packages. Loaders wishing to support resource
  19809. reading must implement the :meth:`get_resource_reader()` method.
  19810. File-based and zipimport-based loaders both implement these APIs.
  19811. :class:`importlib.abc.ResourceLoader` is deprecated in favor of these new
  19812. APIs.
  19813. - bpo-32320: collections.namedtuple() now supports default values.
  19814. - bpo-29302: Add contextlib.AsyncExitStack. Patch by Alexander Mohr and Ilya
  19815. Kulakov.
  19816. - bpo-31961: *Removed in Python 3.7.0b2.* The *args* argument of
  19817. subprocess.Popen can now be a :term:`path-like object`. If *args* is given
  19818. as a sequence, it's first element can now be a :term:`path-like object` as
  19819. well.
  19820. - bpo-31900: The :func:`locale.localeconv` function now sets temporarily the
  19821. ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale to decode
  19822. ``decimal_point`` and ``thousands_sep`` byte strings if they are non-ASCII
  19823. or longer than 1 byte, and the ``LC_NUMERIC`` locale is different than the
  19824. ``LC_CTYPE`` locale. This temporary change affects other threads. Same
  19825. change for the :meth:`str.format` method when formatting a number
  19826. (:class:`int`, :class:`float`, :class:`float` and subclasses) with the
  19827. ``n`` type (ex: ``'{:n}'.format(1234)``).
  19828. - bpo-31853: Use super().method instead of socket.method in SSLSocket. They
  19829. were there most likely for legacy reasons.
  19830. - bpo-31399: The ssl module now uses OpenSSL's X509_VERIFY_PARAM_set1_host()
  19831. and X509_VERIFY_PARAM_set1_ip() API to verify hostname and IP addresses.
  19832. Subject common name fallback can be disabled with
  19833. SSLContext.hostname_checks_common_name.
  19834. - bpo-14976: Add a queue.SimpleQueue class, an unbounded FIFO queue with a
  19835. reentrant C implementation of put().
  19836. Documentation
  19837. -------------
  19838. - bpo-32724: Add references to some commands in the documentation of Pdb.
  19839. Patch by Stéphane Wirtel
  19840. - bpo-32649: Complete the C API documentation, profiling and tracing part
  19841. with the newly added per-opcode events.
  19842. - bpo-17799: Explain real behaviour of sys.settrace and sys.setprofile and
  19843. their C-API counterparts regarding which type of events are received in
  19844. each function. Patch by Pablo Galindo Salgado.
  19845. Tests
  19846. -----
  19847. - bpo-32721: Fix test_hashlib to not fail if the _md5 module is not built.
  19848. - bpo-28414: Add test cases for IDNA 2003 and 2008 host names. IDNA 2003
  19849. internationalized host names are working since bpo-31399 has landed. IDNA
  19850. 2008 are still broken.
  19851. - bpo-32604: Add a new "_xxsubinterpreters" extension module that exposes
  19852. the existing subinterpreter C-API and a new cross-interpreter data sharing
  19853. mechanism. The module is primarily intended for more thorough testing of
  19854. the existing subinterpreter support. Note that the _xxsubinterpreters
  19855. module has been removed in 3.7.0rc1.
  19856. - bpo-32602: Add test certs and test for ECDSA cert and EC/RSA dual mode.
  19857. - bpo-32549: On Travis CI, Python now Compiles and uses a local copy of
  19858. OpenSSL 1.1.0g for testing.
  19859. Build
  19860. -----
  19861. - bpo-32635: Fix segfault of the crypt module when libxcrypt is provided
  19862. instead of libcrypt at the system.
  19863. - bpo-32598: Use autoconf to detect OpenSSL libs, headers and supported
  19864. features. The ax_check_openssl M4 macro uses pkg-config to locate OpenSSL
  19865. and falls back to manual search.
  19866. - bpo-32593: Drop support of FreeBSD 9 and older.
  19867. - bpo-29708: If the :envvar:`SOURCE_DATE_EPOCH` environment variable is set,
  19868. :mod:`py_compile` will always create hash-based ``.pyc`` files.
  19869. Windows
  19870. -------
  19871. - bpo-32588: Create standalone _distutils_findvs module and add missing
  19872. _queue module to installer.
  19873. - bpo-29911: Ensure separate Modify and Uninstall buttons are displayed.
  19874. - bpo-32507: Use app-local UCRT install rather than the proper update for
  19875. old versions of Windows.
  19876. macOS
  19877. -----
  19878. - bpo-32726: Provide an additional, more modern macOS installer variant that
  19879. supports macOS 10.9+ systems in 64-bit mode only. Upgrade the supplied
  19880. third-party libraries to OpenSSL 1.1.0g and to SQLite 3.22.0. The 10.9+
  19881. installer now links with and supplies its own copy of Tcl/Tk 8.6.
  19882. - bpo-28440: No longer add /Library/Python/3.x/site-packages to sys.path for
  19883. macOS framework builds to avoid future conflicts.
  19884. C API
  19885. -----
  19886. - bpo-32681: Fix uninitialized variable 'res' in the C implementation of
  19887. os.dup2. Patch by Stéphane Wirtel
  19888. - bpo-10381: Add C API access to the ``datetime.timezone`` constructor and
  19889. ``datetime.timzone.UTC`` singleton.
  19890. What's New in Python 3.7.0 alpha 4?
  19891. ===================================
  19892. *Release date: 2018-01-08*
  19893. Core and Builtins
  19894. -----------------
  19895. - bpo-31975: The default warning filter list now starts with a
  19896. "default::DeprecationWarning:__main__" entry, so deprecation warnings are
  19897. once again shown by default in single-file scripts and at the interactive
  19898. prompt.
  19899. - bpo-32226: ``__class_getitem__`` is now an automatic class method.
  19900. - bpo-32399: Add AIX uuid library support for RFC4122 using uuid_create() in
  19901. libc.a
  19902. - bpo-32390: Fix the compilation failure on AIX after the f_fsid field has
  19903. been added to the object returned by os.statvfs() (issue #32143). Original
  19904. patch by Michael Felt.
  19905. - bpo-32379: Make MRO computation faster when a class inherits from a single
  19906. base.
  19907. - bpo-32259: The error message of a TypeError raised when unpack
  19908. non-iterable is now more specific.
  19909. - bpo-27169: The ``__debug__`` constant is now optimized out at compile
  19910. time. This fixes also bpo-22091.
  19911. - bpo-32329: The :option:`-R` option now turns on hash randomization when
  19912. the :envvar:`PYTHONHASHSEED` environment variable is set to ``0``.
  19913. Previously, the option was ignored. Moreover,
  19914. ``sys.flags.hash_randomization`` is now properly set to 0 when hash
  19915. randomization is turned off by ``PYTHONHASHSEED=0``.
  19916. - bpo-30416: The optimizer is now protected from spending much time doing
  19917. complex calculations and consuming much memory for creating large
  19918. constants in constant folding. Increased limits for constants that can be
  19919. produced in constant folding.
  19920. - bpo-32282: Fix an unnecessary ifdef in the include of VersionHelpers.h in
  19921. socketmodule on Windows.
  19922. - bpo-30579: Implement TracebackType.__new__ to allow Python-level creation
  19923. of traceback objects, and make TracebackType.tb_next mutable.
  19924. - bpo-32260: Don't byte swap the input keys to the SipHash algorithm on
  19925. big-endian platforms. This should ensure siphash gives consistent results
  19926. across platforms.
  19927. - bpo-31506: Improve the error message logic for object.__new__ and
  19928. object.__init__. Patch by Sanyam Khurana.
  19929. - bpo-20361: ``-b`` and ``-bb`` now inject ``'default::BytesWarning'`` and
  19930. ``error::BytesWarning`` entries into ``sys.warnoptions``, ensuring that
  19931. they take precedence over any other warning filters configured via the
  19932. ``-W`` option or the ``PYTHONWARNINGS`` environment variable.
  19933. - bpo-32230: ``-X dev`` now injects a ``'default'`` entry into
  19934. sys.warnoptions, ensuring that it behaves identically to actually passing
  19935. ``-Wdefault`` at the command line.
  19936. - bpo-29240: Add a new UTF-8 mode: implementation of the :pep:`540`.
  19937. - bpo-32226: :pep:`560`: Add support for ``__mro_entries__`` and
  19938. ``__class_getitem__``. Implemented by Ivan Levkivskyi.
  19939. - bpo-32225: :pep:`562`: Add support for module ``__getattr__`` and
  19940. ``__dir__``. Implemented by Ivan Levkivskyi.
  19941. - bpo-31901: The ``atexit`` module now has its callback stored per
  19942. interpreter.
  19943. - bpo-31650: Implement :pep:`552` (Deterministic pycs). Python now supports
  19944. invalidating bytecode cache files bashed on a source content hash rather
  19945. than source last-modified time.
  19946. - bpo-29469: Move constant folding from bytecode layer to AST layer.
  19947. Original patch by Eugene Toder.
  19948. Library
  19949. -------
  19950. - bpo-32506: Now that dict is defined as keeping insertion order, drop
  19951. OrderedDict and just use plain dict.
  19952. - bpo-32279: Add params to dataclasses.make_dataclasses(): init, repr, eq,
  19953. order, hash, and frozen. Pass them through to dataclass().
  19954. - bpo-32278: Make type information optional on dataclasses.make_dataclass().
  19955. If omitted, the string 'typing.Any' is used.
  19956. - bpo-32499: Add dataclasses.is_dataclass(obj), which returns True if obj is
  19957. a dataclass or an instance of one.
  19958. - bpo-32468: Improve frame repr() to mention filename, code name and current
  19959. line number.
  19960. - bpo-23749: asyncio: Implement loop.start_tls()
  19961. - bpo-32441: Return the new file descriptor (i.e., the second argument) from
  19962. ``os.dup2``. Previously, ``None`` was always returned.
  19963. - bpo-32422: ``functools.lru_cache`` uses less memory (3 words for each
  19964. cached key) and takes about 1/3 time for cyclic GC.
  19965. - bpo-31721: Prevent Python crash from happening when Future._log_traceback
  19966. is set to True manually. Now it can only be set to False, or a ValueError
  19967. is raised.
  19968. - bpo-32415: asyncio: Add Task.get_loop() and Future.get_loop()
  19969. - bpo-26133: Don't unsubscribe signals in asyncio UNIX event loop on
  19970. interpreter shutdown.
  19971. - bpo-32363: Make asyncio.Task.set_exception() and set_result() raise
  19972. NotImplementedError. Task._step() and Future.__await__() raise proper
  19973. exceptions when they are in an invalid state, instead of raising an
  19974. AssertionError.
  19975. - bpo-32357: Optimize asyncio.iscoroutine() and loop.create_task() for
  19976. non-native coroutines (e.g. async/await compiled with Cython).
  19977. 'loop.create_task(python_coroutine)' used to be 20% faster than
  19978. 'loop.create_task(cython_coroutine)'. Now, the latter is as fast.
  19979. - bpo-32356: asyncio.transport.resume_reading() and pause_reading() are now
  19980. idempotent. New transport.is_reading() method is added.
  19981. - bpo-32355: Optimize asyncio.gather(); now up to 15% faster.
  19982. - bpo-32351: Use fastpath in asyncio.sleep if delay<0 (2x boost)
  19983. - bpo-32348: Optimize asyncio.Future schedule/add/remove callback. The
  19984. optimization shows 3-6% performance improvements of async/await code.
  19985. - bpo-32331: Fix socket.settimeout() and socket.setblocking() to keep
  19986. socket.type as is. Fix socket.socket() constructor to reset any bit flags
  19987. applied to socket's type. This change only affects OSes that have
  19988. SOCK_NONBLOCK and/or SOCK_CLOEXEC.
  19989. - bpo-32248: Add :class:`importlib.abc.ResourceReader` as an ABC for loaders
  19990. to provide a unified API for reading resources contained within packages.
  19991. Also add :mod:`importlib.resources` as the port of
  19992. ``importlib_resources``.
  19993. - bpo-32311: Implement asyncio.create_task(coro) shortcut
  19994. - bpo-32327: Convert asyncio functions that were documented as coroutines to
  19995. coroutines. Affected functions: loop.sock_sendall, loop.sock_recv,
  19996. loop.sock_accept, loop.getaddrinfo, loop.getnameinfo.
  19997. - bpo-32323: :func:`urllib.parse.urlsplit()` does not convert zone-id
  19998. (scope) to lower case for scoped IPv6 addresses in hostnames now.
  19999. - bpo-32302: Fix bdist_wininst of distutils for CRT v142: it binary
  20000. compatible with CRT v140.
  20001. - bpo-29711: Fix ``stop_serving`` in asyncio proactor loop kill all
  20002. listening servers
  20003. - bpo-32308: :func:`re.sub()` now replaces empty matches adjacent to a
  20004. previous non-empty match.
  20005. - bpo-29970: Abort asyncio SSLProtocol connection if handshake not complete
  20006. within 10 seconds.
  20007. - bpo-32314: Implement asyncio.run().
  20008. - bpo-17852: Revert incorrect fix based on misunderstanding of
  20009. _Py_PyAtExit() semantics.
  20010. - bpo-32296: Implement asyncio._get_running_loop() and get_event_loop() in
  20011. C. This makes them 4x faster.
  20012. - bpo-32250: Implement ``asyncio.current_task()`` and
  20013. ``asyncio.all_tasks()``. Add helpers intended to be used by alternative
  20014. task implementations: ``asyncio._register_task``, ``asyncio._enter_task``,
  20015. ``asyncio._leave_task`` and ``asyncio._unregister_task``. Deprecate
  20016. ``asyncio.Task.current_task()`` and ``asyncio.Task.all_tasks()``.
  20017. - bpo-32255: A single empty field is now always quoted when written into a
  20018. CSV file. This allows to distinguish an empty row from a row consisting of
  20019. a single empty field. Patch by Licht Takeuchi.
  20020. - bpo-32277: Raise ``NotImplementedError`` instead of ``SystemError`` on
  20021. platforms where ``chmod(..., follow_symlinks=False)`` is not supported.
  20022. Patch by Anthony Sottile.
  20023. - bpo-30050: New argument warn_on_full_buffer to signal.set_wakeup_fd lets
  20024. you control whether Python prints a warning on stderr when the wakeup fd
  20025. buffer overflows.
  20026. - bpo-29137: The ``fpectl`` library has been removed. It was never enabled
  20027. by default, never worked correctly on x86-64, and it changed the Python
  20028. ABI in ways that caused unexpected breakage of C extensions.
  20029. - bpo-32273: Move asyncio.test_utils to test.test_asyncio.
  20030. - bpo-32272: Remove asyncio.async() function.
  20031. - bpo-32269: Add asyncio.get_running_loop() function.
  20032. - bpo-32265: All class and static methods of builtin types now are correctly
  20033. classified by inspect.classify_class_attrs() and grouped in pydoc ouput.
  20034. Added types.ClassMethodDescriptorType for unbound class methods of builtin
  20035. types.
  20036. - bpo-32253: Deprecate ``yield from lock``, ``await lock``, ``with (yield
  20037. from lock)`` and ``with await lock`` for asyncio synchronization
  20038. primitives.
  20039. - bpo-22589: Changed MIME type of .bmp from 'image/x-ms-bmp' to 'image/bmp'
  20040. - bpo-32193: Convert asyncio to use *async/await* syntax. Old styled ``yield
  20041. from`` is still supported too.
  20042. - bpo-32206: Add support to run modules with pdb
  20043. - bpo-32227: ``functools.singledispatch`` now supports registering
  20044. implementations using type annotations.
  20045. - bpo-15873: Added new alternate constructors
  20046. :meth:`datetime.datetime.fromisoformat`,
  20047. :meth:`datetime.time.fromisoformat` and
  20048. :meth:`datetime.date.fromisoformat` as the inverse operation of each
  20049. classes's respective ``isoformat`` methods.
  20050. - bpo-32199: The getnode() ip getter now uses 'ip link' instead of 'ip link
  20051. list'.
  20052. - bpo-32143: os.statvfs() includes the f_fsid field from statvfs(2)
  20053. - bpo-26439: Fix ctypes.util.find_library() for AIX by implementing
  20054. ctypes._aix.find_library() Patch by: Michael Felt
  20055. - bpo-31993: The pickler now uses less memory when serializing large bytes
  20056. and str objects into a file. Pickles created with protocol 4 will require
  20057. less memory for unpickling large bytes and str objects.
  20058. - bpo-27456: Ensure TCP_NODELAY is set on Linux. Tests by Victor Stinner.
  20059. - bpo-31778: ast.literal_eval() is now more strict. Addition and subtraction
  20060. of arbitrary numbers no longer allowed.
  20061. - bpo-31802: Importing native path module (``posixpath``, ``ntpath``) now
  20062. works even if the ``os`` module still is not imported.
  20063. - bpo-30241: Add contextlib.AbstractAsyncContextManager. Patch by Jelle
  20064. Zijlstra.
  20065. - bpo-31699: Fix deadlocks in
  20066. :class:`concurrent.futures.ProcessPoolExecutor` when task arguments or
  20067. results cause pickling or unpickling errors. This should make sure that
  20068. calls to the :class:`ProcessPoolExecutor` API always eventually return.
  20069. - bpo-15216: ``TextIOWrapper.reconfigure()`` supports changing *encoding*,
  20070. *errors*, and *newline*.
  20071. Documentation
  20072. -------------
  20073. - bpo-32418: Add get_loop() method to Server and AbstractServer classes.
  20074. Tests
  20075. -----
  20076. - bpo-32252: Fix faulthandler_suppress_crash_report() used to prevent core
  20077. dump files when testing crashes. getrlimit() returns zero on success.
  20078. - bpo-32002: Adjust C locale coercion testing for the empty locale and POSIX
  20079. locale cases to more readily adjust to platform dependent behaviour.
  20080. Windows
  20081. -------
  20082. - bpo-19764: Implement support for ``subprocess.Popen(close_fds=True)`` on
  20083. Windows. Patch by Segev Finer.
  20084. Tools/Demos
  20085. -----------
  20086. - bpo-24960: 2to3 and lib2to3 can now read pickled grammar files using
  20087. pkgutil.get_data() rather than probing the filesystem. This lets 2to3 and
  20088. lib2to3 work when run from a zipfile.
  20089. C API
  20090. -----
  20091. - bpo-32030: Py_Initialize() doesn't reset the memory allocators to default
  20092. if the ``PYTHONMALLOC`` environment variable is not set.
  20093. - bpo-29084: Undocumented C API for OrderedDict has been excluded from the
  20094. limited C API. It was added by mistake and actually never worked in the
  20095. limited C API.
  20096. - bpo-32264: Moved the pygetopt.h header into internal/, since it has no
  20097. public APIs.
  20098. - bpo-32241: :c:func:`Py_SetProgramName` and :c:func:`Py_SetPythonHome` now
  20099. take the ``const wchar *`` arguments instead of ``wchar *``.
  20100. What's New in Python 3.7.0 alpha 3?
  20101. ===================================
  20102. *Release date: 2017-12-05*
  20103. Core and Builtins
  20104. -----------------
  20105. - bpo-32176: co_flags.CO_NOFREE is now always set correctly by the code
  20106. object constructor based on freevars and cellvars, rather than needing to
  20107. be set correctly by the caller. This ensures it will be cleared
  20108. automatically when additional cell references are injected into a modified
  20109. code object and function.
  20110. - bpo-10544: Yield expressions are now deprecated in comprehensions and
  20111. generator expressions. They are still permitted in the definition of the
  20112. outermost iterable, as that is evaluated directly in the enclosing scope.
  20113. - bpo-32137: The repr of deeply nested dict now raises a RecursionError
  20114. instead of crashing due to a stack overflow.
  20115. - bpo-32096: Revert memory allocator changes in the C API: move structures
  20116. back from _PyRuntime to Objects/obmalloc.c. The memory allocators are once
  20117. again initialized statically, and so PyMem_RawMalloc() and
  20118. Py_DecodeLocale() can be called before _PyRuntime_Initialize().
  20119. - bpo-32043: Add a new "developer mode": new "-X dev" command line option to
  20120. enable debug checks at runtime.
  20121. - bpo-32023: SyntaxError is now correctly raised when a generator expression
  20122. without parenthesis is used instead of an inheritance list in a class
  20123. definition. The duplication of the parentheses can be omitted only on
  20124. calls.
  20125. - bpo-32012: SyntaxError is now correctly raised when a generator expression
  20126. without parenthesis is passed as an argument, but followed by a trailing
  20127. comma. A generator expression always needs to be directly inside a set of
  20128. parentheses and cannot have a comma on either side.
  20129. - bpo-28180: A new internal ``_Py_SetLocaleFromEnv(category)`` helper
  20130. function has been added in order to improve the consistency of behaviour
  20131. across different ``libc`` implementations (e.g. Android doesn't support
  20132. setting the locale from the environment by default).
  20133. - bpo-31949: Fixed several issues in printing tracebacks
  20134. (PyTraceBack_Print()). Setting sys.tracebacklimit to 0 or less now
  20135. suppresses printing tracebacks. Setting sys.tracebacklimit to None now
  20136. causes using the default limit. Setting sys.tracebacklimit to an integer
  20137. larger than LONG_MAX now means using the limit LONG_MAX rather than the
  20138. default limit. Fixed integer overflows in the case of more than ``2**31``
  20139. traceback items on Windows. Fixed output errors handling.
  20140. - bpo-30696: Fix the interactive interpreter looping endlessly when no
  20141. memory.
  20142. - bpo-20047: Bytearray methods partition() and rpartition() now accept only
  20143. bytes-like objects as separator, as documented. In particular they now
  20144. raise TypeError rather of returning a bogus result when an integer is
  20145. passed as a separator.
  20146. - bpo-21720: BytesWarning no longer emitted when the *fromlist* argument of
  20147. ``__import__()`` or the ``__all__`` attribute of the module contain bytes
  20148. instances.
  20149. - bpo-31845: Environment variables are once more read correctly at
  20150. interpreter startup.
  20151. - bpo-28936: Ensure that lexically first syntax error involving a parameter
  20152. and ``global`` or ``nonlocal`` is detected first at a given scope. Patch
  20153. by Ivan Levkivskyi.
  20154. - bpo-31825: Fixed OverflowError in the 'unicode-escape' codec and in
  20155. codecs.escape_decode() when decode an escaped non-ascii byte.
  20156. - bpo-31618: The per-frame tracing logic added in 3.7a1 has been altered so
  20157. that ``frame->f_lineno`` is updated before either ``"line"`` or
  20158. ``"opcode"`` events are emitted. Previously, opcode events were emitted
  20159. first, and therefore would occasionally see stale line numbers on the
  20160. frame. The behavior of this feature has changed slightly as a result: when
  20161. both ``f_trace_lines`` and ``f_trace_opcodes`` are enabled, line events
  20162. now occur first.
  20163. - bpo-28603: Print the full context/cause chain of exceptions on interpreter
  20164. exit, even if an exception in the chain is unhashable or compares equal to
  20165. later ones. Patch by Zane Bitter.
  20166. - bpo-31786: Fix timeout rounding in the select module to round correctly
  20167. negative timeouts between -1.0 and 0.0. The functions now block waiting
  20168. for events as expected. Previously, the call was incorrectly non-blocking.
  20169. Patch by Pablo Galindo.
  20170. - bpo-31781: Prevent crashes when calling methods of an uninitialized
  20171. ``zipimport.zipimporter`` object. Patch by Oren Milman.
  20172. - bpo-30399: Standard repr() of BaseException with a single argument no
  20173. longer contains redundant trailing comma.
  20174. - bpo-31626: Fixed a bug in debug memory allocator. There was a write to
  20175. freed memory after shrinking a memory block.
  20176. - bpo-30817: ``PyErr_PrintEx()`` clears now the ignored exception that may
  20177. be raised by ``_PySys_SetObjectId()``, for example when no memory.
  20178. Library
  20179. -------
  20180. - bpo-28556: Two minor fixes for ``typing`` module: allow shallow copying
  20181. instances of generic classes, improve interaction of ``__init_subclass__``
  20182. with generics. Original PRs by Ivan Levkivskyi.
  20183. - bpo-32214: PEP 557, Data Classes. Provides a decorator which adds
  20184. boilerplate methods to classes which use type annotations so specify
  20185. fields.
  20186. - bpo-27240: The header folding algorithm for the new email policies has
  20187. been rewritten, which also fixes bpo-30788, bpo-31831, and bpo-32182. In
  20188. particular, RFC2231 folding is now done correctly.
  20189. - bpo-32186: io.FileIO.readall() and io.FileIO.read() now release the GIL
  20190. when getting the file size. Fixed hang of all threads with inaccessible
  20191. NFS server. Patch by Nir Soffer.
  20192. - bpo-32101: Add :attr:`sys.flags.dev_mode` flag
  20193. - bpo-32154: The ``asyncio.windows_utils.socketpair()`` function has been
  20194. removed: use directly :func:`socket.socketpair` which is available on all
  20195. platforms since Python 3.5 (before, it wasn't available on Windows).
  20196. ``asyncio.windows_utils.socketpair()`` was just an alias to
  20197. ``socket.socketpair`` on Python 3.5 and newer.
  20198. - bpo-32089: warnings: In development (-X dev) and debug mode (pydebug
  20199. build), use the "default" action for ResourceWarning, rather than the
  20200. "always" action, in the default warnings filters.
  20201. - bpo-32107: ``uuid.getnode()`` now preferentially returns universally
  20202. administered MAC addresses if available, over locally administered MAC
  20203. addresses. This makes a better guarantee for global uniqueness of UUIDs
  20204. returned from ``uuid.uuid1()``. If only locally administered MAC
  20205. addresses are available, the first such one found is returned.
  20206. - bpo-23033: Wildcard is now supported in hostname when it is one and only
  20207. character in the left most segment of hostname in second argument of
  20208. :meth:`ssl.match_hostname`. Patch by Mandeep Singh.
  20209. - bpo-12239: Make :meth:`msilib.SummaryInformation.GetProperty` return
  20210. ``None`` when the value of property is ``VT_EMPTY``. Initial patch by
  20211. Mark Mc Mahon.
  20212. - bpo-28334: Use :func:`os.path.expanduser` to find the ``~/.netrc`` file in
  20213. :class:`netrc.netrc`. If it does not exist, :exc:`FileNotFoundError` is
  20214. raised. Patch by Dimitri Merejkowsky.
  20215. - bpo-32121: Made ``tracemalloc.Traceback`` behave more like the traceback
  20216. module, sorting the frames from oldest to most recent.
  20217. ``Traceback.format()`` now accepts negative *limit*, truncating the result
  20218. to the ``abs(limit)`` oldest frames. To get the old behaviour, one can use
  20219. the new *most_recent_first* argument to ``Traceback.format()``. (Patch by
  20220. Jesse Bakker.)
  20221. - bpo-31325: Fix wrong usage of :func:`collections.namedtuple` in the
  20222. :meth:`RobotFileParser.parse() <urllib.robotparser.RobotFileParser.parse>`
  20223. method. Initial patch by Robin Wellner.
  20224. - bpo-12382: :func:`msilib.OpenDatabase` now raises a better exception
  20225. message when it couldn't open or create an MSI file. Initial patch by
  20226. William Tisäter.
  20227. - bpo-19610: ``setup()`` now warns about invalid types for some fields. The
  20228. ``distutils.dist.Distribution`` class now warns when ``classifiers``,
  20229. ``keywords`` and ``platforms`` fields are not specified as a list or a
  20230. string.
  20231. - bpo-32071: Added the ``-k`` command-line option to ``python -m unittest``
  20232. to run only tests that match the given pattern(s).
  20233. - bpo-10049: Added *nullcontext* no-op context manager to contextlib. This
  20234. provides a simpler and faster alternative to ExitStack() when handling
  20235. optional context managers.
  20236. - bpo-28684: The new test.support.skip_unless_bind_unix_socket() decorator
  20237. is used here to skip asyncio tests that fail because the platform lacks a
  20238. functional bind() function for unix domain sockets (as it is the case for
  20239. non root users on the recent Android versions that run now SELinux in
  20240. enforcing mode).
  20241. - bpo-32110: ``codecs.StreamReader.read(n)`` now returns not more than *n*
  20242. characters/bytes for non-negative *n*. This makes it compatible with
  20243. ``read()`` methods of other file-like objects.
  20244. - bpo-27535: The warnings module doesn't leak memory anymore in the hidden
  20245. warnings registry for the "ignore" action of warnings filters.
  20246. warn_explicit() function doesn't add the warning key to the registry
  20247. anymore for the "ignore" action.
  20248. - bpo-32088: warnings: When Python is build is debug mode (``Py_DEBUG``),
  20249. :exc:`DeprecationWarning`, :exc:`PendingDeprecationWarning` and
  20250. :exc:`ImportWarning` warnings are now displayed by default.
  20251. - bpo-1647489: Fixed searching regular expression patterns that could match
  20252. an empty string. Non-empty string can now be correctly found after
  20253. matching an empty string.
  20254. - bpo-25054: Added support of splitting on a pattern that could match an
  20255. empty string.
  20256. - bpo-32072: Fixed issues with binary plists: Fixed saving bytearrays.
  20257. Identical objects will be saved only once. Equal references will be load
  20258. as identical objects. Added support for saving and loading recursive data
  20259. structures.
  20260. - bpo-32069: Drop legacy SSL transport from asyncio, ssl.MemoryBIO is always
  20261. used anyway.
  20262. - bpo-32066: asyncio: Support pathlib.Path in create_unix_connection; sock
  20263. arg should be optional
  20264. - bpo-32046: Updates 2to3 to convert from operator.isCallable(obj) to
  20265. callable(obj). Patch by Donghee Na.
  20266. - bpo-32018: inspect.signature should follow :pep:`8`, if the parameter has
  20267. an annotation and a default value. Patch by Donghee Na.
  20268. - bpo-32025: Add time.thread_time() and time.thread_time_ns()
  20269. - bpo-32037: Integers that fit in a signed 32-bit integer will be now
  20270. pickled with protocol 0 using the INT opcode. This will decrease the size
  20271. of a pickle, speed up pickling and unpickling, and make these integers be
  20272. unpickled as int instances in Python 2.
  20273. - bpo-32034: Make asyncio.IncompleteReadError and LimitOverrunError
  20274. pickleable.
  20275. - bpo-32015: Fixed the looping of asyncio in the case of reconnection the
  20276. socket during waiting async read/write from/to the socket.
  20277. - bpo-32011: Restored support of loading marshal files with the TYPE_INT64
  20278. code. These files can be produced in Python 2.7.
  20279. - bpo-28369: Enhance add_reader/writer check that socket is not used by some
  20280. transport. Before, only cases when add_reader/writer were called with an
  20281. int FD were supported. Now the check is implemented correctly for all
  20282. file-like objects.
  20283. - bpo-31976: Fix race condition when flushing a file is slow, which can
  20284. cause a segfault if closing the file from another thread.
  20285. - bpo-31985: Formally deprecated aifc.openfp, sunau.openfp, and wave.openfp.
  20286. Since change 7bc817d5ba917528e8bd07ec461c635291e7b06a in 1993, openfp in
  20287. each of the three modules had been pointing to that module's open function
  20288. as a matter of backwards compatibility, though it had been both untested
  20289. and undocumented.
  20290. - bpo-21862: cProfile command line now accepts ``-m module_name`` as an
  20291. alternative to script path. Patch by Sanyam Khurana.
  20292. - bpo-31970: Reduce performance overhead of asyncio debug mode.
  20293. - bpo-31843: *database* argument of sqlite3.connect() now accepts a
  20294. :term:`path-like object`, instead of just a string.
  20295. - bpo-31945: Add Configurable *blocksize* to ``HTTPConnection`` and
  20296. ``HTTPSConnection`` for improved upload throughput. Patch by Nir Soffer.
  20297. - bpo-31943: Add a ``cancelled()`` method to :class:`asyncio.Handle`. Patch
  20298. by Marat Sharafutdinov.
  20299. - bpo-9678: Fixed determining the MAC address in the uuid module: Using
  20300. ifconfig on NetBSD and OpenBSD. Using arp on Linux, FreeBSD, NetBSD and
  20301. OpenBSD. Based on patch by Takayuki Shimizukawa.
  20302. - bpo-30057: Fix potential missed signal in signal.signal().
  20303. - bpo-31933: Fix Blake2 params leaf_size and node_offset on big endian
  20304. platforms. Patch by Jack O'Connor.
  20305. - bpo-21423: Add an initializer argument to {Process,Thread}PoolExecutor
  20306. - bpo-31927: Fixed compilation of the socket module on NetBSD 8. Fixed
  20307. assertion failure or reading arbitrary data when parse a AF_BLUETOOTH
  20308. address on NetBSD and DragonFly BSD.
  20309. - bpo-27666: Fixed stack corruption in curses.box() and curses.ungetmouse()
  20310. when the size of types chtype or mmask_t is less than the size of C long.
  20311. curses.box() now accepts characters as arguments. Based on patch by Steve
  20312. Fink.
  20313. - bpo-31917: Add 3 new clock identifiers: :const:`time.CLOCK_BOOTTIME`,
  20314. :const:`time.CLOCK_PROF` and :const:`time.CLOCK_UPTIME`.
  20315. - bpo-31897: plistlib now catches more errors when read binary plists and
  20316. raises InvalidFileException instead of unexpected exceptions.
  20317. - bpo-25720: Fix the method for checking pad state of curses WINDOW. Patch
  20318. by Masayuki Yamamoto.
  20319. - bpo-31893: Fixed the layout of the kqueue_event structure on OpenBSD and
  20320. NetBSD. Fixed the comparison of the kqueue_event objects.
  20321. - bpo-31891: Fixed building the curses module on NetBSD.
  20322. - bpo-31884: added required constants to subprocess module for setting
  20323. priority on windows
  20324. - bpo-28281: Remove year (1-9999) limits on the Calendar.weekday() function.
  20325. Patch by Mark Gollahon.
  20326. - bpo-31702: crypt.mksalt() now allows to specify the number of rounds for
  20327. SHA-256 and SHA-512 hashing.
  20328. - bpo-30639: :func:`inspect.getfile` no longer computes the repr of unknown
  20329. objects to display in an error message, to protect against badly behaved
  20330. custom reprs.
  20331. - bpo-30768: Fix the pthread+semaphore implementation of
  20332. PyThread_acquire_lock_timed() when called with timeout > 0 and
  20333. intr_flag=0: recompute the timeout if sem_timedwait() is interrupted by a
  20334. signal (EINTR). See also the :pep:`475`.
  20335. - bpo-31854: Add ``mmap.ACCESS_DEFAULT`` constant.
  20336. - bpo-31834: Use optimized code for BLAKE2 only with SSSE3+. The pure SSE2
  20337. implementation is slower than the pure C reference implementation.
  20338. - bpo-28292: Calendar.itermonthdates() will now consistently raise an
  20339. exception when a date falls outside of the 0001-01-01 through 9999-12-31
  20340. range. To support applications that cannot tolerate such exceptions, the
  20341. new methods itermonthdays3() and itermonthdays4() are added. The new
  20342. methods return tuples and are not restricted by the range supported by
  20343. datetime.date.
  20344. - bpo-28564: The shutil.rmtree() function has been sped up to 20--40%. This
  20345. was done using the os.scandir() function.
  20346. - bpo-28416: Instances of pickle.Pickler subclass with the persistent_id()
  20347. method and pickle.Unpickler subclass with the persistent_load() method no
  20348. longer create reference cycles.
  20349. - bpo-31653: Don't release the GIL if we can acquire a multiprocessing
  20350. semaphore immediately.
  20351. - bpo-28326: Fix multiprocessing.Process when stdout and/or stderr is closed
  20352. or None.
  20353. - bpo-20825: Add ``subnet_of`` and ``superset_of`` containment tests to
  20354. :class:`ipaddress.IPv6Network` and :class:`ipaddress.IPv4Network`. Patch
  20355. by Michel Albert and Cheryl Sabella.
  20356. - bpo-31827: Remove the os.stat_float_times() function. It was introduced in
  20357. Python 2.3 for backward compatibility with Python 2.2, and was deprecated
  20358. since Python 3.1.
  20359. - bpo-31756: Add a ``subprocess.Popen(text=False)`` keyword argument to
  20360. ``subprocess`` functions to be more explicit about when the library should
  20361. attempt to decode outputs into text. Patch by Andrew Clegg.
  20362. - bpo-31819: Add AbstractEventLoop.sock_recv_into().
  20363. - bpo-31457: If nested log adapters are used, the inner ``process()``
  20364. methods are no longer omitted.
  20365. - bpo-31457: The ``manager`` property on LoggerAdapter objects is now
  20366. properly settable.
  20367. - bpo-31806: Fix timeout rounding in time.sleep(), threading.Lock.acquire()
  20368. and socket.socket.settimeout() to round correctly negative timeouts
  20369. between -1.0 and 0.0. The functions now block waiting for events as
  20370. expected. Previously, the call was incorrectly non-blocking. Patch by
  20371. Pablo Galindo.
  20372. - bpo-31803: time.clock() and time.get_clock_info('clock') now emit a
  20373. DeprecationWarning warning.
  20374. - bpo-31800: Extended support for parsing UTC offsets. strptime '%z' can now
  20375. parse the output generated by datetime.isoformat, including seconds and
  20376. microseconds.
  20377. - bpo-28603: traceback: Fix a TypeError that occurred during printing of
  20378. exception tracebacks when either the current exception or an exception in
  20379. its context/cause chain is unhashable. Patch by Zane Bitter.
  20380. - bpo-30541: Add new function to seal a mock and prevent the automatically
  20381. creation of child mocks. Patch by Mario Corchero.
  20382. - bpo-31784: Implement the :pep:`564`, add new 6 new functions with
  20383. nanosecond resolution to the :mod:`time` module:
  20384. :func:`~time.clock_gettime_ns`, :func:`~time.clock_settime_ns`,
  20385. :func:`~time.monotonic_ns`, :func:`~time.perf_counter_ns`,
  20386. :func:`~time.process_time_ns`, :func:`~time.time_ns`.
  20387. - bpo-30143: 2to3 now generates a code that uses abstract collection classes
  20388. from collections.abc rather than collections.
  20389. - bpo-31770: Prevent a crash when calling the ``__init__()`` method of a
  20390. ``sqlite3.Cursor`` object more than once. Patch by Oren Milman.
  20391. - bpo-31764: Prevent a crash in ``sqlite3.Cursor.close()`` in case the
  20392. ``Cursor`` object is uninitialized. Patch by Oren Milman.
  20393. - bpo-31752: Fix possible crash in timedelta constructor called with custom
  20394. integers.
  20395. - bpo-31620: an empty asyncio.Queue now doesn't leak memory when queue.get
  20396. pollers timeout
  20397. - bpo-31690: Allow the flags re.ASCII, re.LOCALE, and re.UNICODE to be used
  20398. as group flags for regular expressions.
  20399. - bpo-30349: FutureWarning is now emitted if a regular expression contains
  20400. character set constructs that will change semantically in the future
  20401. (nested sets and set operations).
  20402. - bpo-31664: Added support for the Blowfish hashing in the crypt module.
  20403. - bpo-31632: Fix method set_protocol() of class _SSLProtocolTransport in
  20404. asyncio module. This method was previously modifying a wrong reference to
  20405. the protocol.
  20406. - bpo-15037: Added a workaround for getkey() in curses for ncurses 5.7 and
  20407. earlier.
  20408. - bpo-31307: Allow use of bytes objects for arguments to
  20409. :meth:`configparser.ConfigParser.read`. Patch by Vincent Michel.
  20410. - bpo-31334: Fix ``poll.poll([timeout])`` in the ``select`` module for
  20411. arbitrary negative timeouts on all OSes where it can only be a
  20412. non-negative integer or -1. Patch by Riccardo Coccioli.
  20413. - bpo-31310: multiprocessing's semaphore tracker should be launched again if
  20414. crashed.
  20415. - bpo-31308: Make multiprocessing's forkserver process immune to Ctrl-C and
  20416. other user interruptions. If it crashes, restart it when necessary.
  20417. - bpo-31245: Added support for AF_UNIX socket in asyncio
  20418. ``create_datagram_endpoint``.
  20419. - bpo-30553: Add HTTP/2 status code 421 (Misdirected Request) to
  20420. :class:`http.HTTPStatus`. Patch by Vitor Pereira.
  20421. Documentation
  20422. -------------
  20423. - bpo-32105: Added asyncio.BaseEventLoop.connect_accepted_socket
  20424. versionadded marker.
  20425. Tests
  20426. -----
  20427. - bpo-31380: Skip test_httpservers test_undecodable_file on macOS: fails on
  20428. APFS.
  20429. - bpo-31705: Skip test_socket.test_sha256() on Linux kernel older than 4.5.
  20430. The test fails with ENOKEY on kernel 3.10 (on ppc64le). A fix was merged
  20431. into the kernel 4.5.
  20432. - bpo-32138: Skip on Android test_faulthandler tests that raise SIGSEGV and
  20433. remove the test.support.requires_android_level decorator.
  20434. - bpo-32136: The runtime embedding tests have been split out from
  20435. ``Lib/test/test_capi.py`` into a new ``Lib/test/test_embed.py`` file.
  20436. - bpo-28668: test.support.requires_multiprocessing_queue is removed. Skip
  20437. tests with test.support.import_module('multiprocessing.synchronize')
  20438. instead when the semaphore implementation is broken or missing.
  20439. - bpo-32126: Skip test_get_event_loop_new_process in
  20440. test.test_asyncio.test_events when sem_open() is not functional.
  20441. - bpo-31174: Fix test_tools.test_unparse: DirectoryTestCase now stores the
  20442. names sample to always test the same files. It prevents false alarms when
  20443. hunting reference leaks.
  20444. Build
  20445. -----
  20446. - bpo-28538: Revert the previous changes, the if_nameindex structure is
  20447. defined by Unified Headers.
  20448. - bpo-28762: Revert the last commit, the F_LOCK macro is defined by Android
  20449. Unified Headers.
  20450. - bpo-29040: Support building Android with Unified Headers. The first NDK
  20451. release to support Unified Headers is android-ndk-r14.
  20452. - bpo-32059: ``detect_modules()`` in ``setup.py`` now also searches the
  20453. sysroot paths when cross-compiling.
  20454. - bpo-31957: Fixes Windows SDK version detection when building for Windows.
  20455. - bpo-31609: Fixes quotes in PCbuild/clean.bat
  20456. - bpo-31934: Abort the build when building out of a not clean source tree.
  20457. - bpo-31926: Fixed Argument Clinic sometimes causing compilation errors when
  20458. there was more than one function and/or method in a .c file with the same
  20459. name.
  20460. - bpo-28791: Update Windows builds to use SQLite 3.21.0.
  20461. - bpo-28791: Update OS X installer to use SQLite 3.21.0.
  20462. - bpo-28643: Record profile-opt build progress with stamp files.
  20463. - bpo-31866: Finish removing support for AtheOS.
  20464. Windows
  20465. -------
  20466. - bpo-1102: Return ``None`` when ``View.Fetch()`` returns
  20467. ``ERROR_NO_MORE_ITEMS`` instead of raising ``MSIError``. Initial patch by
  20468. Anthony Tuininga.
  20469. - bpo-31944: Fixes Modify button in Apps and Features dialog.
  20470. - bpo-20486: Implement the ``Database.Close()`` method to help closing MSI
  20471. database objects.
  20472. - bpo-31857: Make the behavior of USE_STACKCHECK deterministic in a
  20473. multi-threaded environment.
  20474. macOS
  20475. -----
  20476. - bpo-31392: Update macOS installer to use OpenSSL 1.0.2m
  20477. IDLE
  20478. ----
  20479. - bpo-32207: Improve tk event exception tracebacks in IDLE. When tk event
  20480. handling is driven by IDLE's run loop, a confusing and distracting
  20481. queue.EMPTY traceback context is no longer added to tk event exception
  20482. tracebacks. The traceback is now the same as when event handling is
  20483. driven by user code. Patch based on a suggestion by Serhiy Storchaka.
  20484. - bpo-32164: Delete unused file idlelib/tabbedpages.py. Use of TabbedPageSet
  20485. in configdialog was replaced by ttk.Notebook.
  20486. - bpo-32100: IDLE: Fix old and new bugs in pathbrowser; improve tests. Patch
  20487. mostly by Cheryl Sabella.
  20488. - bpo-31858: IDLE -- Restrict shell prompt manipulation to the shell. Editor
  20489. and output windows only see an empty last prompt line. This simplifies
  20490. the code and fixes a minor bug when newline is inserted. Sys.ps1, if
  20491. present, is read on Shell start-up, but is not set or changed.
  20492. - bpo-31860: The font sample in the IDLE configuration dialog is now
  20493. editable. Changes persist while IDLE remains open
  20494. - bpo-31836: Test_code_module now passes if run after test_idle, which sets
  20495. ps1. The code module uses sys.ps1 if present or sets it to '>>> ' if not.
  20496. Test_code_module now properly tests both behaviors. Ditto for ps2.
  20497. - bpo-28603: Fix a TypeError that caused a shell restart when printing a
  20498. traceback that includes an exception that is unhashable. Patch by Zane
  20499. Bitter.
  20500. - bpo-13802: Use non-Latin characters in the IDLE's Font settings sample.
  20501. Even if one selects a font that defines a limited subset of the unicode
  20502. Basic Multilingual Plane, tcl/tk will use other fonts that define a
  20503. character. The expanded example give users of non-Latin characters a
  20504. better idea of what they might see in IDLE's shell and editors. To make
  20505. room for the expanded sample, frames on the Font tab are re-arranged. The
  20506. Font/Tabs help explains a bit about the additions.
  20507. Tools/Demos
  20508. -----------
  20509. - bpo-32159: Remove CVS and Subversion tools: remove svneol.py and
  20510. treesync.py scripts. CPython migrated from CVS to Subversion, to
  20511. Mercurial, and then to Git. CVS and Subversion are no longer used to
  20512. develop CPython.
  20513. - bpo-30722: Make redemo work with Python 3.6 and newer versions. Also,
  20514. remove the ``LOCALE`` option since it doesn't work with string patterns in
  20515. Python 3. Patch by Christoph Sarnowski.
  20516. C API
  20517. -----
  20518. - bpo-20891: Fix PyGILState_Ensure(). When PyGILState_Ensure() is called in
  20519. a non-Python thread before PyEval_InitThreads(), only call
  20520. PyEval_InitThreads() after calling PyThreadState_New() to fix a crash.
  20521. - bpo-32125: The ``Py_UseClassExceptionsFlag`` flag has been removed. It was
  20522. deprecated and wasn't used anymore since Python 2.0.
  20523. - bpo-25612: Move the current exception state from the frame object to the
  20524. co-routine. This simplifies the interpreter and fixes a couple of obscure
  20525. bugs caused by having swap exception state when entering or exiting a
  20526. generator.
  20527. - bpo-23699: Add Py_RETURN_RICHCOMPARE macro to reduce boilerplate code in
  20528. rich comparison functions.
  20529. - bpo-30697: The ``PyExc_RecursionErrorInst`` singleton is removed and
  20530. ``PyErr_NormalizeException()`` does not use it anymore. This singleton is
  20531. persistent and its members being never cleared may cause a segfault during
  20532. finalization of the interpreter. See also issue #22898.
  20533. What's New in Python 3.7.0 alpha 2?
  20534. ===================================
  20535. *Release date: 2017-10-16*
  20536. Core and Builtins
  20537. -----------------
  20538. - bpo-31558: ``gc.freeze()`` is a new API that allows for moving all objects
  20539. currently tracked by the garbage collector to a permanent generation,
  20540. effectively removing them from future collection events. This can be used
  20541. to protect those objects from having their PyGC_Head mutated. In effect,
  20542. this enables great copy-on-write stability at fork().
  20543. - bpo-31642: Restored blocking "from package import module" by setting
  20544. sys.modules["package.module"] to None.
  20545. - bpo-31708: Allow use of asynchronous generator expressions in synchronous
  20546. functions.
  20547. - bpo-31709: Drop support of asynchronous __aiter__.
  20548. - bpo-30404: The -u option now makes the stdout and stderr streams
  20549. unbuffered rather than line-buffered.
  20550. - bpo-31619: Fixed a ValueError when convert a string with large number of
  20551. underscores to integer with binary base.
  20552. - bpo-31602: Fix an assertion failure in ``zipimporter.get_source()`` in
  20553. case of a bad ``zlib.decompress()``. Patch by Oren Milman.
  20554. - bpo-31592: Fixed an assertion failure in Python parser in case of a bad
  20555. ``unicodedata.normalize()``. Patch by Oren Milman.
  20556. - bpo-31588: Raise a ``TypeError`` with a helpful error message when class
  20557. creation fails due to a metaclass with a bad ``__prepare__()`` method.
  20558. Patch by Oren Milman.
  20559. - bpo-31574: Importlib was instrumented with two dtrace probes to profile
  20560. import timing.
  20561. - bpo-31566: Fix an assertion failure in ``_warnings.warn()`` in case of a
  20562. bad ``__name__`` global. Patch by Oren Milman.
  20563. - bpo-31506: Improved the error message logic for ``object.__new__`` and
  20564. ``object.__init__``.
  20565. - bpo-31505: Fix an assertion failure in ``json``, in case
  20566. ``_json.make_encoder()`` received a bad ``encoder()`` argument. Patch by
  20567. Oren Milman.
  20568. - bpo-31492: Fix assertion failures in case of failing to import from a
  20569. module with a bad ``__name__`` attribute, and in case of failing to access
  20570. an attribute of such a module. Patch by Oren Milman.
  20571. - bpo-31478: Fix an assertion failure in ``_random.Random.seed()`` in case
  20572. the argument has a bad ``__abs__()`` method. Patch by Oren Milman.
  20573. - bpo-31336: Speed up class creation by 10-20% by reducing the overhead in
  20574. the necessary special method lookups. Patch by Stefan Behnel.
  20575. - bpo-31415: Add ``-X importtime`` option to show how long each import
  20576. takes. It can be used to optimize application's startup time. Support the
  20577. :envvar:`PYTHONPROFILEIMPORTTIME` as an equivalent way to enable this.
  20578. - bpo-31410: Optimized calling wrapper and classmethod descriptors.
  20579. - bpo-31353: :pep:`553` - Add a new built-in called ``breakpoint()`` which
  20580. calls ``sys.breakpointhook()``. By default this imports ``pdb`` and calls
  20581. ``pdb.set_trace()``, but users may override ``sys.breakpointhook()`` to
  20582. call whatever debugger they want. The original value of the hook is saved
  20583. in ``sys.__breakpointhook__``.
  20584. - bpo-17852: Maintain a list of open buffered files, flush them before
  20585. exiting the interpreter. Based on a patch from Armin Rigo.
  20586. - bpo-31315: Fix an assertion failure in imp.create_dynamic(), when
  20587. spec.name is not a string. Patch by Oren Milman.
  20588. - bpo-31311: Fix a crash in the ``__setstate__()`` method of
  20589. ``ctypes._CData``, in case of a bad ``__dict__``. Patch by Oren Milman.
  20590. - bpo-31293: Fix crashes in true division and multiplication of a timedelta
  20591. object by a float with a bad as_integer_ratio() method. Patch by Oren
  20592. Milman.
  20593. - bpo-31285: Fix an assertion failure in ``warnings.warn_explicit``, when
  20594. the return value of the received loader's ``get_source()`` has a bad
  20595. ``splitlines()`` method. Patch by Oren Milman.
  20596. - bpo-30406: Make ``async`` and ``await`` proper keywords, as specified in
  20597. :pep:`492`.
  20598. Library
  20599. -------
  20600. - bpo-30058: Fixed buffer overflow in select.kqueue.control().
  20601. - bpo-31672: ``idpattern`` in ``string.Template`` matched some non-ASCII
  20602. characters. Now it uses ``-i`` regular expression local flag to avoid
  20603. non-ASCII characters.
  20604. - bpo-31701: On Windows, faulthandler.enable() now ignores MSC and COM
  20605. exceptions.
  20606. - bpo-31728: Prevent crashes in ``_elementtree`` due to unsafe cleanup of
  20607. ``Element.text`` and ``Element.tail``. Patch by Oren Milman.
  20608. - bpo-31671: Now ``re.compile()`` converts passed RegexFlag to normal int
  20609. object before compiling. bm_regex_compile benchmark shows 14% performance
  20610. improvements.
  20611. - bpo-30397: The types of compiled regular objects and match objects are now
  20612. exposed as ``re.Pattern`` and ``re.Match``. This adds information in
  20613. pydoc output for the ``re`` module.
  20614. - bpo-31675: Fixed memory leaks in Tkinter's methods splitlist() and split()
  20615. when pass a string larger than 2 GiB.
  20616. - bpo-31673: Fixed typo in the name of Tkinter's method adderrorinfo().
  20617. - bpo-31648: Improvements to path predicates in ElementTree: Allow
  20618. whitespace around predicate parts, i.e. "[a = 'text']" instead of
  20619. requiring the less readable "[a='text']". Add support for text comparison
  20620. of the current node, like "[.='text']". Patch by Stefan Behnel.
  20621. - bpo-30806: Fix the string representation of a netrc object.
  20622. - bpo-31638: Add optional argument ``compressed`` to
  20623. ``zipapp.create_archive``, and add option ``--compress`` to the command
  20624. line interface of ``zipapp``.
  20625. - bpo-25351: Avoid venv activate failures with undefined variables
  20626. - bpo-20519: Avoid ctypes use (if possible) and improve import time for
  20627. uuid.
  20628. - bpo-28293: The regular expression cache is no longer completely dumped
  20629. when it is full.
  20630. - bpo-31596: Added pthread_getcpuclockid() to the time module
  20631. - bpo-27494: Make 2to3 accept a trailing comma in generator expressions. For
  20632. example, ``set(x for x in [],)`` is now allowed.
  20633. - bpo-30347: Stop crashes when concurrently iterate over itertools.groupby()
  20634. iterators.
  20635. - bpo-30346: An iterator produced by itertools.groupby() iterator now
  20636. becomes exhausted after advancing the groupby iterator.
  20637. - bpo-31556: Cancel asyncio.wait_for future faster if timeout <= 0
  20638. - bpo-31540: Allow passing a context object in
  20639. :class:`concurrent.futures.ProcessPoolExecutor` constructor. Also, free
  20640. job resources in :class:`concurrent.futures.ProcessPoolExecutor` earlier
  20641. to improve memory usage when a worker waits for new jobs.
  20642. - bpo-31516: ``threading.current_thread()`` should not return a dummy thread
  20643. at shutdown.
  20644. - bpo-31525: In the sqlite module, require the sqlite3_prepare_v2 API. Thus,
  20645. the sqlite module now requires sqlite version at least 3.3.9.
  20646. - bpo-26510: argparse subparsers are now required by default. This matches
  20647. behaviour in Python 2. For optional subparsers, use the new parameter
  20648. ``add_subparsers(required=False)``. Patch by Anthony Sottile. (As of
  20649. 3.7.0rc1, the default was changed to not required as had been the case
  20650. since Python 3.3.)
  20651. - bpo-27541: Reprs of subclasses of some collection and iterator classes
  20652. (``bytearray``, ``array.array``, ``collections.deque``,
  20653. ``collections.defaultdict``, ``itertools.count``, ``itertools.repeat``)
  20654. now contain actual type name instead of hardcoded names of the base class.
  20655. - bpo-31351: python -m ensurepip now exits with non-zero exit code if pip
  20656. bootstrapping has failed.
  20657. - bpo-31389: ``pdb.set_trace()`` now takes an optional keyword-only argument
  20658. ``header``. If given, this is printed to the console just before debugging
  20659. begins.
  20660. Documentation
  20661. -------------
  20662. - bpo-31537: Fix incorrect usage of ``get_history_length`` in readline
  20663. documentation example code. Patch by Brad Smith.
  20664. - bpo-30085: The operator functions without double underscores are preferred
  20665. for clarity. The one with underscores are only kept for
  20666. back-compatibility.
  20667. Build
  20668. -----
  20669. - bpo-31696: Improve compiler version information in :data:`sys.version`
  20670. when Python is built with Clang.
  20671. - bpo-31625: Stop using ranlib on static libraries. Instead, we assume ar
  20672. supports the 's' flag.
  20673. - bpo-31624: Remove support for BSD/OS.
  20674. - bpo-22140: Prevent double substitution of prefix in python-config.sh.
  20675. - bpo-31569: Correct PCBuild/ case to PCbuild/ in build scripts and
  20676. documentation.
  20677. - bpo-31536: Avoid wholesale rebuild after ``make regen-all`` if nothing
  20678. changed.
  20679. IDLE
  20680. ----
  20681. - bpo-31460: Simplify the API of IDLE's Module Browser. Passing a widget
  20682. instead of an flist with a root widget opens the option of creating a
  20683. browser frame that is only part of a window. Passing a full file name
  20684. instead of pieces assumed to come from a .py file opens the possibility of
  20685. browsing python files that do not end in .py.
  20686. - bpo-31649: IDLE - Make _htest, _utest parameters keyword only.
  20687. - bpo-31559: Remove test order dependence in idle_test.test_browser.
  20688. - bpo-31459: Rename IDLE's module browser from Class Browser to Module
  20689. Browser. The original module-level class and method browser became a
  20690. module browser, with the addition of module-level functions, years ago.
  20691. Nested classes and functions were added yesterday. For
  20692. back-compatibility, the virtual event <<open-class-browser>>, which
  20693. appears on the Keys tab of the Settings dialog, is not changed. Patch by
  20694. Cheryl Sabella.
  20695. - bpo-31500: Default fonts now are scaled on HiDPI displays.
  20696. - bpo-1612262: IDLE module browser now shows nested classes and functions.
  20697. Original patches for code and tests by Guilherme Polo and Cheryl Sabella,
  20698. respectively.
  20699. C API
  20700. -----
  20701. - bpo-28280: Make ``PyMapping_Keys()``, ``PyMapping_Values()`` and
  20702. ``PyMapping_Items()`` always return a ``list`` (rather than a ``list`` or
  20703. a ``tuple``). Patch by Oren Milman.
  20704. - bpo-31532: Fix memory corruption due to allocator mix in getpath.c between
  20705. Py_GetPath() and Py_SetPath()
  20706. - bpo-25658: Implement :pep:`539` for Thread Specific Storage (TSS) API: it
  20707. is a new Thread Local Storage (TLS) API to CPython which would supersede
  20708. use of the existing TLS API within the CPython interpreter, while
  20709. deprecating the existing API. PEP written by Erik M. Bray, patch by
  20710. Masayuki Yamamoto.
  20711. What's New in Python 3.7.0 alpha 1?
  20712. ===================================
  20713. *Release date: 2017-09-19*
  20714. Security
  20715. --------
  20716. - bpo-29781: SSLObject.version() now correctly returns None when handshake
  20717. over BIO has not been performed yet.
  20718. - bpo-29505: Add fuzz tests for float(str), int(str), unicode(str); for
  20719. oss-fuzz.
  20720. - bpo-30947: Upgrade libexpat embedded copy from version 2.2.1 to 2.2.3 to
  20721. get security fixes.
  20722. - bpo-30730: Prevent environment variables injection in subprocess on
  20723. Windows. Prevent passing other environment variables and command
  20724. arguments.
  20725. - bpo-30694: Upgrade expat copy from 2.2.0 to 2.2.1 to get fixes of multiple
  20726. security vulnerabilities including: CVE-2017-9233 (External entity
  20727. infinite loop DoS), CVE-2016-9063 (Integer overflow, re-fix),
  20728. CVE-2016-0718 (Fix regression bugs from 2.2.0's fix to CVE-2016-0718) and
  20729. CVE-2012-0876 (Counter hash flooding with SipHash). Note: the
  20730. CVE-2016-5300 (Use os-specific entropy sources like getrandom) doesn't
  20731. impact Python, since Python already gets entropy from the OS to set the
  20732. expat secret using ``XML_SetHashSalt()``.
  20733. - bpo-30500: Fix urllib.parse.splithost() to correctly parse fragments. For
  20734. example, ``splithost('//127.0.0.1#@evil.com/')`` now correctly returns the
  20735. ``127.0.0.1`` host, instead of treating ``@evil.com`` as the host in an
  20736. authentication (``login@host``).
  20737. - bpo-29591: Update expat copy from 2.1.1 to 2.2.0 to get fixes of
  20738. CVE-2016-0718 and CVE-2016-4472. See
  20739. https://sourceforge.net/p/expat/bugs/537/ for more information.
  20740. Core and Builtins
  20741. -----------------
  20742. - bpo-31490: Fix an assertion failure in ``ctypes`` class definition, in
  20743. case the class has an attribute whose name is specified in ``_anonymous_``
  20744. but not in ``_fields_``. Patch by Oren Milman.
  20745. - bpo-31471: Fix an assertion failure in ``subprocess.Popen()`` on Windows,
  20746. in case the env argument has a bad ``keys()`` method. Patch by Oren
  20747. Milman.
  20748. - bpo-31418: Fix an assertion failure in ``PyErr_WriteUnraisable()`` in case
  20749. of an exception with a bad ``__module__`` attribute. Patch by Oren Milman.
  20750. - bpo-31416: Fix assertion failures in case of a bad warnings.filters or
  20751. warnings.defaultaction. Patch by Oren Milman.
  20752. - bpo-28411: Change direct usage of PyInterpreterState.modules to
  20753. PyImport_GetModuleDict(). Also introduce more uniformity in other code
  20754. that deals with sys.modules. This helps reduce complications when working
  20755. on sys.modules.
  20756. - bpo-28411: Switch to the abstract API when dealing with
  20757. ``PyInterpreterState.modules``. This allows later support for all dict
  20758. subclasses and other Mapping implementations. Also add a
  20759. ``PyImport_GetModule()`` function to reduce a bunch of duplicated code.
  20760. - bpo-31411: Raise a TypeError instead of SystemError in case
  20761. warnings.onceregistry is not a dictionary. Patch by Oren Milman.
  20762. - bpo-31344: For finer control of tracing behaviour when testing the
  20763. interpreter, two new frame attributes have been added to control the
  20764. emission of particular trace events: ``f_trace_lines`` (``True`` by
  20765. default) to turn off per-line trace events; and ``f_trace_opcodes``
  20766. (``False`` by default) to turn on per-opcode trace events.
  20767. - bpo-31373: Fix several possible instances of undefined behavior due to
  20768. floating-point demotions.
  20769. - bpo-30465: Location information (``lineno`` and ``col_offset``) in
  20770. f-strings is now (mostly) correct. This fixes tools like flake8 from
  20771. showing warnings on the wrong line (typically the first line of the file).
  20772. - bpo-30860: Consolidate CPython's global runtime state under a single
  20773. struct. This improves discoverability of the runtime state.
  20774. - bpo-31347: Fix possible undefined behavior in _PyObject_FastCall_Prepend.
  20775. - bpo-31343: Include sys/sysmacros.h for major(), minor(), and makedev().
  20776. GNU C libray plans to remove the functions from sys/types.h.
  20777. - bpo-31291: Fix an assertion failure in ``zipimport.zipimporter.get_data``
  20778. on Windows, when the return value of ``pathname.replace('/','\\')`` isn't
  20779. a string. Patch by Oren Milman.
  20780. - bpo-31271: Fix an assertion failure in the ``write()`` method of
  20781. ``io.TextIOWrapper``, when the encoder doesn't return a bytes object.
  20782. Patch by Oren Milman.
  20783. - bpo-31243: Fix a crash in some methods of ``io.TextIOWrapper``, when the
  20784. decoder's state is invalid. Patch by Oren Milman.
  20785. - bpo-30721: ``print`` now shows correct usage hint for using Python 2
  20786. redirection syntax. Patch by Sanyam Khurana.
  20787. - bpo-31070: Fix a race condition in importlib _get_module_lock().
  20788. - bpo-30747: Add a non-dummy implementation of _Py_atomic_store and
  20789. _Py_atomic_load on MSVC.
  20790. - bpo-31095: Fix potential crash during GC caused by ``tp_dealloc`` which
  20791. doesn't call ``PyObject_GC_UnTrack()``.
  20792. - bpo-31071: Avoid masking original TypeError in call with * unpacking when
  20793. other arguments are passed.
  20794. - bpo-30978: str.format_map() now passes key lookup exceptions through.
  20795. Previously any exception was replaced with a KeyError exception.
  20796. - bpo-30808: Use _Py_atomic API for concurrency-sensitive signal state.
  20797. - bpo-30876: Relative import from unloaded package now reimports the package
  20798. instead of failing with SystemError. Relative import from non-package now
  20799. fails with ImportError rather than SystemError.
  20800. - bpo-30703: Improve signal delivery. Avoid using Py_AddPendingCall from
  20801. signal handler, to avoid calling signal-unsafe functions. The tests I'm
  20802. adding here fail without the rest of the patch, on Linux and OS X. This
  20803. means our signal delivery logic had defects (some signals could be lost).
  20804. - bpo-30765: Avoid blocking in pthread_mutex_lock() when
  20805. PyThread_acquire_lock() is asked not to block.
  20806. - bpo-31161: Make sure the 'Missing parentheses' syntax error message is
  20807. only applied to SyntaxError, not to subclasses. Patch by Martijn Pieters.
  20808. - bpo-30814: Fixed a race condition when import a submodule from a package.
  20809. - bpo-30736: The internal unicodedata database has been upgraded to Unicode
  20810. 10.0.
  20811. - bpo-30604: Move co_extra_freefuncs from per-thread to per-interpreter to
  20812. avoid crashes.
  20813. - bpo-30597: ``print`` now shows expected input in custom error message when
  20814. used as a Python 2 statement. Patch by Sanyam Khurana.
  20815. - bpo-30682: Removed a too-strict assertion that failed for certain
  20816. f-strings, such as eval("f'\\\n'") and eval("f'\\\r'").
  20817. - bpo-30501: The compiler now produces more optimal code for complex
  20818. condition expressions in the "if", "while" and "assert" statement, the
  20819. "if" expression, and generator expressions and comprehensions.
  20820. - bpo-28180: Implement :pep:`538` (legacy C locale coercion). This means
  20821. that when a suitable coercion target locale is available, both the core
  20822. interpreter and locale-aware C extensions will assume the use of UTF-8 as
  20823. the default text encoding, rather than ASCII.
  20824. - bpo-30486: Allows setting cell values for __closure__. Patch by Lisa
  20825. Roach.
  20826. - bpo-30537: itertools.islice now accepts integer-like objects (having an
  20827. __index__ method) as start, stop, and slice arguments
  20828. - bpo-25324: Tokens needed for parsing in Python moved to C. ``COMMENT``,
  20829. ``NL`` and ``ENCODING``. This way the tokens and tok_names in the token
  20830. module don't get changed when you import the tokenize module.
  20831. - bpo-29104: Fixed parsing backslashes in f-strings.
  20832. - bpo-27945: Fixed various segfaults with dict when input collections are
  20833. mutated during searching, inserting or comparing. Based on patches by
  20834. Duane Griffin and Tim Mitchell.
  20835. - bpo-25794: Fixed type.__setattr__() and type.__delattr__() for
  20836. non-interned attribute names. Based on patch by Eryk Sun.
  20837. - bpo-30039: If a KeyboardInterrupt happens when the interpreter is in the
  20838. middle of resuming a chain of nested 'yield from' or 'await' calls, it's
  20839. now correctly delivered to the innermost frame.
  20840. - bpo-28974: ``object.__format__(x, '')`` is now equivalent to ``str(x)``
  20841. rather than ``format(str(self), '')``.
  20842. - bpo-30024: Circular imports involving absolute imports with binding a
  20843. submodule to a name are now supported.
  20844. - bpo-12414: sys.getsizeof() on a code object now returns the sizes which
  20845. includes the code struct and sizes of objects which it references. Patch
  20846. by Donghee Na.
  20847. - bpo-29839: len() now raises ValueError rather than OverflowError if
  20848. __len__() returned a large negative integer.
  20849. - bpo-11913: README.rst is now included in the list of distutils standard
  20850. READMEs and therefore included in source distributions.
  20851. - bpo-29914: Fixed default implementations of __reduce__ and
  20852. __reduce_ex__(). object.__reduce__() no longer takes arguments,
  20853. object.__reduce_ex__() now requires one argument.
  20854. - bpo-29949: Fix memory usage regression of set and frozenset object.
  20855. - bpo-29935: Fixed error messages in the index() method of tuple, list and
  20856. deque when pass indices of wrong type.
  20857. - bpo-29816: Shift operation now has less opportunity to raise
  20858. OverflowError. ValueError always is raised rather than OverflowError for
  20859. negative counts. Shifting zero with non-negative count always returns
  20860. zero.
  20861. - bpo-24821: Fixed the slowing down to 25 times in the searching of some
  20862. unlucky Unicode characters.
  20863. - bpo-29102: Add a unique ID to PyInterpreterState. This makes it easier to
  20864. identify each subinterpreter.
  20865. - bpo-29894: The deprecation warning is emitted if __complex__ returns an
  20866. instance of a strict subclass of complex. In a future versions of Python
  20867. this can be an error.
  20868. - bpo-29859: Show correct error messages when any of the pthread_* calls in
  20869. thread_pthread.h fails.
  20870. - bpo-29849: Fix a memory leak when an ImportError is raised during from
  20871. import.
  20872. - bpo-28856: Fix an oversight that %b format for bytes should support
  20873. objects follow the buffer protocol.
  20874. - bpo-29723: The ``sys.path[0]`` initialization change for bpo-29139 caused
  20875. a regression by revealing an inconsistency in how sys.path is initialized
  20876. when executing ``__main__`` from a zipfile, directory, or other import
  20877. location. The interpreter now consistently avoids ever adding the import
  20878. location's parent directory to ``sys.path``, and ensures no other
  20879. ``sys.path`` entries are inadvertently modified when inserting the import
  20880. location named on the command line.
  20881. - bpo-29568: Escaped percent "%%" in the format string for classic string
  20882. formatting no longer allows any characters between two percents.
  20883. - bpo-29714: Fix a regression that bytes format may fail when containing
  20884. zero bytes inside.
  20885. - bpo-29695: bool(), float(), list() and tuple() no longer take keyword
  20886. arguments. The first argument of int() can now be passes only as
  20887. positional argument.
  20888. - bpo-28893: Set correct __cause__ for errors about invalid awaitables
  20889. returned from __aiter__ and __anext__.
  20890. - bpo-28876: ``bool(range)`` works even if ``len(range)`` raises
  20891. :exc:`OverflowError`.
  20892. - bpo-29683: Fixes to memory allocation in _PyCode_SetExtra. Patch by Brian
  20893. Coleman.
  20894. - bpo-29684: Fix minor regression of PyEval_CallObjectWithKeywords. It
  20895. should raise TypeError when kwargs is not a dict. But it might cause segv
  20896. when args=NULL and kwargs is not a dict.
  20897. - bpo-28598: Support __rmod__ for subclasses of str being called before
  20898. str.__mod__. Patch by Martijn Pieters.
  20899. - bpo-29607: Fix stack_effect computation for CALL_FUNCTION_EX. Patch by
  20900. Matthieu Dartiailh.
  20901. - bpo-29602: Fix incorrect handling of signed zeros in complex constructor
  20902. for complex subclasses and for inputs having a __complex__ method. Patch
  20903. by Serhiy Storchaka.
  20904. - bpo-29347: Fixed possibly dereferencing undefined pointers when creating
  20905. weakref objects.
  20906. - bpo-29463: Add ``docstring`` field to Module, ClassDef, FunctionDef, and
  20907. AsyncFunctionDef ast nodes. docstring is not first stmt in their body
  20908. anymore. It affects ``co_firstlineno`` and ``co_lnotab`` of code object
  20909. for module and class. (Reverted in :issue:`32911`.)
  20910. - bpo-29438: Fixed use-after-free problem in key sharing dict.
  20911. - bpo-29546: Set the 'path' and 'name' attribute on ImportError for ``from
  20912. ... import ...``.
  20913. - bpo-29546: Improve from-import error message with location
  20914. - bpo-29478: If max_line_length=None is specified while using the Compat32
  20915. policy, it is no longer ignored. Patch by Mircea Cosbuc.
  20916. - bpo-29319: Prevent RunMainFromImporter overwriting sys.path[0].
  20917. - bpo-29337: Fixed possible BytesWarning when compare the code objects.
  20918. Warnings could be emitted at compile time.
  20919. - bpo-29327: Fixed a crash when pass the iterable keyword argument to
  20920. sorted().
  20921. - bpo-29034: Fix memory leak and use-after-free in os module
  20922. (path_converter).
  20923. - bpo-29159: Fix regression in bytes(x) when x.__index__() raises Exception.
  20924. - bpo-29049: Call _PyObject_GC_TRACK() lazily when calling Python function.
  20925. Calling function is up to 5% faster.
  20926. - bpo-28927: bytes.fromhex() and bytearray.fromhex() now ignore all ASCII
  20927. whitespace, not only spaces. Patch by Robert Xiao.
  20928. - bpo-28932: Do not include <sys/random.h> if it does not exist.
  20929. - bpo-25677: Correct the positioning of the syntax error caret for indented
  20930. blocks. Based on patch by Michael Layzell.
  20931. - bpo-29000: Fixed bytes formatting of octals with zero padding in alternate
  20932. form.
  20933. - bpo-18896: Python function can now have more than 255 parameters.
  20934. collections.namedtuple() now supports tuples with more than 255 elements.
  20935. - bpo-28596: The preferred encoding is UTF-8 on Android. Patch written by
  20936. Chi Hsuan Yen.
  20937. - bpo-22257: Clean up interpreter startup (see :pep:`432`).
  20938. - bpo-26919: On Android, operating system data is now always encoded/decoded
  20939. to/from UTF-8, instead of the locale encoding to avoid inconsistencies
  20940. with os.fsencode() and os.fsdecode() which are already using UTF-8.
  20941. - bpo-28991: functools.lru_cache() was susceptible to an obscure reentrancy
  20942. bug triggerable by a monkey-patched len() function.
  20943. - bpo-28147: Fix a memory leak in split-table dictionaries: setattr() must
  20944. not convert combined table into split table. Patch written by INADA Naoki.
  20945. - bpo-28739: f-string expressions are no longer accepted as docstrings and
  20946. by ast.literal_eval() even if they do not include expressions.
  20947. - bpo-28512: Fixed setting the offset attribute of SyntaxError by
  20948. PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject().
  20949. - bpo-28918: Fix the cross compilation of xxlimited when Python has been
  20950. built with Py_DEBUG defined.
  20951. - bpo-23722: Rather than silently producing a class that doesn't support
  20952. zero-argument ``super()`` in methods, failing to pass the new
  20953. ``__classcell__`` namespace entry up to ``type.__new__`` now results in a
  20954. ``DeprecationWarning`` and a class that supports zero-argument
  20955. ``super()``.
  20956. - bpo-28797: Modifying the class __dict__ inside the __set_name__ method of
  20957. a descriptor that is used inside that class no longer prevents calling the
  20958. __set_name__ method of other descriptors.
  20959. - bpo-28799: Remove the ``PyEval_GetCallStats()`` function and deprecate the
  20960. untested and undocumented ``sys.callstats()`` function. Remove the
  20961. ``CALL_PROFILE`` special build: use the :func:`sys.setprofile` function,
  20962. :mod:`cProfile` or :mod:`profile` to profile function calls.
  20963. - bpo-12844: More than 255 arguments can now be passed to a function.
  20964. - bpo-28782: Fix a bug in the implementation ``yield from`` when checking if
  20965. the next instruction is YIELD_FROM. Regression introduced by WORDCODE
  20966. (issue #26647).
  20967. - bpo-28774: Fix error position of the unicode error in ASCII and Latin1
  20968. encoders when a string returned by the error handler contains multiple
  20969. non-encodable characters (non-ASCII for the ASCII codec, characters out of
  20970. the U+0000-U+00FF range for Latin1).
  20971. - bpo-28731: Optimize _PyDict_NewPresized() to create correct size dict.
  20972. Improve speed of dict literal with constant keys up to 30%.
  20973. - bpo-28532: Show sys.version when -V option is supplied twice.
  20974. - bpo-27100: The with-statement now checks for __enter__ before it checks
  20975. for __exit__. This gives less confusing error messages when both methods
  20976. are missing. Patch by Jonathan Ellington.
  20977. - bpo-28746: Fix the set_inheritable() file descriptor method on platforms
  20978. that do not have the ioctl FIOCLEX and FIONCLEX commands.
  20979. - bpo-26920: Fix not getting the locale's charset upon initializing the
  20980. interpreter, on platforms that do not have langinfo.
  20981. - bpo-28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X
  20982. when decode astral characters. Patch by Xiang Zhang.
  20983. - bpo-28665: Improve speed of the STORE_DEREF opcode by 40%.
  20984. - bpo-19398: Extra slash no longer added to sys.path components in case of
  20985. empty compile-time PYTHONPATH components.
  20986. - bpo-28621: Sped up converting int to float by reusing faster bits counting
  20987. implementation. Patch by Adrian Wielgosik.
  20988. - bpo-28580: Optimize iterating split table values. Patch by Xiang Zhang.
  20989. - bpo-28583: PyDict_SetDefault didn't combine split table when needed. Patch
  20990. by Xiang Zhang.
  20991. - bpo-28128: Deprecation warning for invalid str and byte escape sequences
  20992. now prints better information about where the error occurs. Patch by
  20993. Serhiy Storchaka and Eric Smith.
  20994. - bpo-28509: dict.update() no longer allocate unnecessary large memory.
  20995. - bpo-28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug
  20996. build.
  20997. - bpo-28517: Fixed of-by-one error in the peephole optimizer that caused
  20998. keeping unreachable code.
  20999. - bpo-28214: Improved exception reporting for problematic __set_name__
  21000. attributes.
  21001. - bpo-23782: Fixed possible memory leak in _PyTraceback_Add() and exception
  21002. loss in PyTraceBack_Here().
  21003. - bpo-28183: Optimize and cleanup dict iteration.
  21004. - bpo-26081: Added C implementation of asyncio.Future. Original patch by
  21005. Yury Selivanov.
  21006. - bpo-28379: Added sanity checks and tests for PyUnicode_CopyCharacters().
  21007. Patch by Xiang Zhang.
  21008. - bpo-28376: The type of long range iterator is now registered as Iterator.
  21009. Patch by Oren Milman.
  21010. - bpo-28376: Creating instances of range_iterator by calling range_iterator
  21011. type now is disallowed. Calling iter() on range instance is the only way.
  21012. Patch by Oren Milman.
  21013. - bpo-26906: Resolving special methods of uninitialized type now causes
  21014. implicit initialization of the type instead of a fail.
  21015. - bpo-18287: PyType_Ready() now checks that tp_name is not NULL. Original
  21016. patch by Niklas Koep.
  21017. - bpo-24098: Fixed possible crash when AST is changed in process of
  21018. compiling it.
  21019. - bpo-28201: Dict reduces possibility of 2nd conflict in hash table when
  21020. hashes have same lower bits.
  21021. - bpo-28350: String constants with null character no longer interned.
  21022. - bpo-26617: Fix crash when GC runs during weakref callbacks.
  21023. - bpo-27942: String constants now interned recursively in tuples and
  21024. frozensets.
  21025. - bpo-28289: ImportError.__init__ now resets not specified attributes.
  21026. - bpo-21578: Fixed misleading error message when ImportError called with
  21027. invalid keyword args.
  21028. - bpo-28203: Fix incorrect type in complex(1.0, {2:3}) error message. Patch
  21029. by Soumya Sharma.
  21030. - bpo-28086: Single var-positional argument of tuple subtype was passed
  21031. unscathed to the C-defined function. Now it is converted to exact tuple.
  21032. - bpo-28214: Now __set_name__ is looked up on the class instead of the
  21033. instance.
  21034. - bpo-27955: Fallback on reading /dev/urandom device when the getrandom()
  21035. syscall fails with EPERM, for example when blocked by SECCOMP.
  21036. - bpo-28192: Don't import readline in isolated mode.
  21037. - bpo-27441: Remove some redundant assignments to ob_size in longobject.c.
  21038. Thanks Oren Milman.
  21039. - bpo-27222: Clean up redundant code in long_rshift function. Thanks Oren
  21040. Milman.
  21041. - Upgrade internal unicode databases to Unicode version 9.0.0.
  21042. - bpo-28131: Fix a regression in zipimport's compile_source(). zipimport
  21043. should use the same optimization level as the interpreter.
  21044. - bpo-28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly
  21045. optimize memcpy().
  21046. - bpo-28120: Fix dict.pop() for splitted dictionary when trying to remove a
  21047. "pending key" (Not yet inserted in split-table). Patch by Xiang Zhang.
  21048. - bpo-26182: Raise DeprecationWarning when async and await keywords are used
  21049. as variable/attribute/class/function name.
  21050. - bpo-26182: Fix a refleak in code that raises DeprecationWarning.
  21051. - bpo-28721: Fix asynchronous generators aclose() and athrow() to handle
  21052. StopAsyncIteration propagation properly.
  21053. - bpo-26110: Speed-up method calls: add LOAD_METHOD and CALL_METHOD opcodes.
  21054. Library
  21055. -------
  21056. - bpo-31499: xml.etree: Fix a crash when a parser is part of a reference
  21057. cycle.
  21058. - bpo-31482: ``random.seed()`` now works with bytes in version=1
  21059. - bpo-28556: typing.get_type_hints now finds the right globalns for classes
  21060. and modules by default (when no ``globalns`` was specified by the caller).
  21061. - bpo-28556: Speed improvements to the ``typing`` module. Original PRs by
  21062. Ivan Levkivskyi and Mitar.
  21063. - bpo-31544: The C accelerator module of ElementTree ignored exceptions
  21064. raised when looking up TreeBuilder target methods in XMLParser().
  21065. - bpo-31234: socket.create_connection() now fixes manually a reference
  21066. cycle: clear the variable storing the last exception on success.
  21067. - bpo-31457: LoggerAdapter objects can now be nested.
  21068. - bpo-31431: SSLContext.check_hostname now automatically sets
  21069. SSLContext.verify_mode to ssl.CERT_REQUIRED instead of failing with a
  21070. ValueError.
  21071. - bpo-31233: socketserver.ThreadingMixIn now keeps a list of non-daemonic
  21072. threads to wait until all these threads complete in server_close().
  21073. - bpo-28638: Changed the implementation strategy for
  21074. collections.namedtuple() to substantially reduce the use of exec() in
  21075. favor of precomputed methods. As a result, the *verbose* parameter and
  21076. *_source* attribute are no longer supported. The benefits include 1)
  21077. having a smaller memory footprint for applications using multiple named
  21078. tuples, 2) faster creation of the named tuple class (approx 4x to 6x
  21079. depending on how it is measured), and 3) minor speed-ups for instance
  21080. creation using __new__, _make, and _replace. (The primary patch
  21081. contributor is Jelle Zijlstra with further improvements by INADA Naoki,
  21082. Serhiy Storchaka, and Raymond Hettinger.)
  21083. - bpo-31400: Improves SSL error handling to avoid losing error numbers.
  21084. - bpo-27629: Make return types of SSLContext.wrap_bio() and
  21085. SSLContext.wrap_socket() customizable.
  21086. - bpo-28958: ssl.SSLContext() now uses OpenSSL error information when a
  21087. context cannot be instantiated.
  21088. - bpo-28182: The SSL module now raises SSLCertVerificationError when OpenSSL
  21089. fails to verify the peer's certificate. The exception contains more
  21090. information about the error.
  21091. - bpo-27340: SSLSocket.sendall() now uses memoryview to create slices of
  21092. data. This fixes support for all bytes-like object. It is also more
  21093. efficient and avoids costly copies.
  21094. - bpo-14191: A new function
  21095. ``argparse.ArgumentParser.parse_intermixed_args`` provides the ability to
  21096. parse command lines where there user intermixes options and positional
  21097. arguments.
  21098. - bpo-31178: Fix string concatenation bug in rare error path in the
  21099. subprocess module
  21100. - bpo-31350: Micro-optimize :func:`asyncio._get_running_loop` to become up
  21101. to 10% faster.
  21102. - bpo-31170: expat: Update libexpat from 2.2.3 to 2.2.4. Fix copying of
  21103. partial characters for UTF-8 input (libexpat bug 115):
  21104. https://github.com/libexpat/libexpat/issues/115
  21105. - bpo-29136: Add TLS 1.3 cipher suites and OP_NO_TLSv1_3.
  21106. - bpo-1198569: ``string.Template`` subclasses can optionally define
  21107. ``braceidpattern`` if they want to specify different placeholder patterns
  21108. inside and outside the braces. If None (the default) it falls back to
  21109. ``idpattern``.
  21110. - bpo-31326: concurrent.futures.ProcessPoolExecutor.shutdown() now
  21111. explicitly closes the call queue. Moreover, shutdown(wait=True) now also
  21112. join the call queue thread, to prevent leaking a dangling thread.
  21113. - bpo-27144: The ``map()`` and ``as_completed()`` iterators in
  21114. ``concurrent.futures`` now avoid keeping a reference to yielded objects.
  21115. - bpo-31281: Fix ``fileinput.FileInput(files, inplace=True)`` when ``files``
  21116. contain ``pathlib.Path`` objects.
  21117. - bpo-10746: Fix ctypes producing wrong :pep:`3118` type codes for integer
  21118. types.
  21119. - bpo-27584: ``AF_VSOCK`` has been added to the socket interface which
  21120. allows communication between virtual machines and their host.
  21121. - bpo-22536: The subprocess module now sets the filename when
  21122. FileNotFoundError is raised on POSIX systems due to the executable or cwd
  21123. not being found.
  21124. - bpo-29741: Update some methods in the _pyio module to also accept integer
  21125. types. Patch by Oren Milman.
  21126. - bpo-31249: concurrent.futures: WorkItem.run() used by ThreadPoolExecutor
  21127. now breaks a reference cycle between an exception object and the WorkItem
  21128. object.
  21129. - bpo-31247: xmlrpc.server now explicitly breaks reference cycles when using
  21130. sys.exc_info() in code handling exceptions.
  21131. - bpo-23835: configparser: reading defaults in the ``ConfigParser()``
  21132. constructor is now using ``read_dict()``, making its behavior consistent
  21133. with the rest of the parser. Non-string keys and values in the defaults
  21134. dictionary are now being implicitly converted to strings. Patch by James
  21135. Tocknell.
  21136. - bpo-31238: pydoc: the stop() method of the private ServerThread class now
  21137. waits until DocServer.serve_until_quit() completes and then explicitly
  21138. sets its docserver attribute to None to break a reference cycle.
  21139. - bpo-5001: Many asserts in ``multiprocessing`` are now more informative,
  21140. and some error types have been changed to more specific ones.
  21141. - bpo-31109: Convert zipimport to use Argument Clinic.
  21142. - bpo-30102: The ssl and hashlib modules now call
  21143. OPENSSL_add_all_algorithms_noconf() on OpenSSL < 1.1.0. The function
  21144. detects CPU features and enables optimizations on some CPU architectures
  21145. such as POWER8. Patch is based on research from Gustavo Serra Scalet.
  21146. - bpo-18966: Non-daemonic threads created by a multiprocessing.Process are
  21147. now joined on child exit.
  21148. - bpo-31183: ``dis`` now works with asynchronous generator and coroutine
  21149. objects. Patch by George Collins based on diagnosis by Luciano Ramalho.
  21150. - bpo-5001: There are a number of uninformative asserts in the
  21151. ``multiprocessing`` module, as noted in issue 5001. This change fixes two
  21152. of the most potentially problematic ones, since they are in
  21153. error-reporting code, in the ``multiprocessing.managers.convert_to_error``
  21154. function. (It also makes more informative a ValueError message.) The only
  21155. potentially problematic change is that the AssertionError is now a
  21156. TypeError; however, this should also help distinguish it from an
  21157. AssertionError being *reported* by the function/its caller (such as in
  21158. issue 31169). - Patch by Allen W. Smith (drallensmith on github).
  21159. - bpo-31185: Fixed miscellaneous errors in asyncio speedup module.
  21160. - bpo-31151: socketserver.ForkingMixIn.server_close() now waits until all
  21161. child processes completed to prevent leaking zombie processes.
  21162. - bpo-31072: Add an ``include_file`` parameter to
  21163. ``zipapp.create_archive()``
  21164. - bpo-24700: Optimize array.array comparison. It is now from 10x up to 70x
  21165. faster when comparing arrays holding values of the same integer type.
  21166. - bpo-31135: ttk: fix the destroy() method of LabeledScale and OptionMenu
  21167. classes. Call the parent destroy() method even if the used attribute
  21168. doesn't exist. The LabeledScale.destroy() method now also explicitly
  21169. clears label and scale attributes to help the garbage collector to destroy
  21170. all widgets.
  21171. - bpo-31107: Fix ``copyreg._slotnames()`` mangled attribute calculation for
  21172. classes whose name begins with an underscore. Patch by Shane Harvey.
  21173. - bpo-31080: Allow ``logging.config.fileConfig`` to accept kwargs and/or
  21174. args.
  21175. - bpo-30897: ``pathlib.Path`` objects now include an ``is_mount()`` method
  21176. (only implemented on POSIX). This is similar to ``os.path.ismount(p)``.
  21177. Patch by Cooper Ry Lees.
  21178. - bpo-31061: Fixed a crash when using asyncio and threads.
  21179. - bpo-30987: Added support for CAN ISO-TP protocol in the socket module.
  21180. - bpo-30522: Added a ``setStream`` method to ``logging.StreamHandler`` to
  21181. allow the stream to be set after creation.
  21182. - bpo-30502: Fix handling of long oids in ssl. Based on patch by Christian
  21183. Heimes.
  21184. - bpo-5288: Support tzinfo objects with sub-minute offsets.
  21185. - bpo-30919: Fix shared memory performance regression in multiprocessing in
  21186. 3.x. Shared memory used anonymous memory mappings in 2.x, while 3.x mmaps
  21187. actual files. Try to be careful to do as little disk I/O as possible.
  21188. - bpo-26732: Fix too many fds in processes started with the "forkserver"
  21189. method. A child process would inherit as many fds as the number of
  21190. still-running children.
  21191. - bpo-29403: Fix ``unittest.mock``'s autospec to not fail on method-bound
  21192. builtin functions. Patch by Aaron Gallagher.
  21193. - bpo-30961: Fix decrementing a borrowed reference in tracemalloc.
  21194. - bpo-19896: Fix multiprocessing.sharedctypes to recognize typecodes ``'q'``
  21195. and ``'Q'``.
  21196. - bpo-30946: Remove obsolete code in readline module for platforms where GNU
  21197. readline is older than 2.1 or where select() is not available.
  21198. - bpo-25684: Change ``ttk.OptionMenu`` radiobuttons to be unique across
  21199. instances of ``OptionMenu``.
  21200. - bpo-30886: Fix multiprocessing.Queue.join_thread(): it now waits until the
  21201. thread completes, even if the thread was started by the same process which
  21202. created the queue.
  21203. - bpo-29854: Fix segfault in readline when using readline's history-size
  21204. option. Patch by Nir Soffer.
  21205. - bpo-30794: Added multiprocessing.Process.kill method to terminate using
  21206. the SIGKILL signal on Unix.
  21207. - bpo-30319: socket.close() now ignores ECONNRESET error.
  21208. - bpo-30828: Fix out of bounds write in
  21209. ``asyncio.CFuture.remove_done_callback()``.
  21210. - bpo-30302: Use keywords in the ``repr`` of ``datetime.timedelta``.
  21211. - bpo-30807: signal.setitimer() may disable the timer when passed a tiny
  21212. value. Tiny values (such as 1e-6) are valid non-zero values for
  21213. setitimer(), which is specified as taking microsecond-resolution
  21214. intervals. However, on some platform, our conversion routine could convert
  21215. 1e-6 into a zero interval, therefore disabling the timer instead of
  21216. (re-)scheduling it.
  21217. - bpo-30441: Fix bug when modifying os.environ while iterating over it
  21218. - bpo-29585: Avoid importing ``sysconfig`` from ``site`` to improve startup
  21219. speed. Python startup is about 5% faster on Linux and 30% faster on macOS.
  21220. - bpo-29293: Add missing parameter "n" on
  21221. multiprocessing.Condition.notify(). The doc claims
  21222. multiprocessing.Condition behaves like threading.Condition, but its
  21223. notify() method lacked the optional "n" argument (to specify the number of
  21224. sleepers to wake up) that threading.Condition.notify() accepts.
  21225. - bpo-30532: Fix email header value parser dropping folding white space in
  21226. certain cases.
  21227. - bpo-30596: Add a ``close()`` method to ``multiprocessing.Process``.
  21228. - bpo-9146: Fix a segmentation fault in _hashopenssl when standard hash
  21229. functions such as md5 are not available in the linked OpenSSL library. As
  21230. in some special FIPS-140 build environments.
  21231. - bpo-29169: Update zlib to 1.2.11.
  21232. - bpo-30119: ftplib.FTP.putline() now throws ValueError on commands that
  21233. contains CR or LF. Patch by Donghee Na.
  21234. - bpo-30879: os.listdir() and os.scandir() now emit bytes names when called
  21235. with bytes-like argument.
  21236. - bpo-30746: Prohibited the '=' character in environment variable names in
  21237. ``os.putenv()`` and ``os.spawn*()``.
  21238. - bpo-30664: The description of a unittest subtest now preserves the order
  21239. of keyword arguments of TestCase.subTest().
  21240. - bpo-21071: struct.Struct.format type is now :class:`str` instead of
  21241. :class:`bytes`.
  21242. - bpo-29212: Fix concurrent.futures.thread.ThreadPoolExecutor threads to
  21243. have a non repr() based thread name by default when no thread_name_prefix
  21244. is supplied. They will now identify themselves as
  21245. "ThreadPoolExecutor-y_n".
  21246. - bpo-29755: Fixed the lgettext() family of functions in the gettext module.
  21247. They now always return bytes.
  21248. - bpo-30616: Functional API of enum allows to create empty enums. Patched by
  21249. Donghee Na
  21250. - bpo-30038: Fix race condition between signal delivery and wakeup file
  21251. descriptor. Patch by Nathaniel Smith.
  21252. - bpo-23894: lib2to3 now recognizes ``rb'...'`` and ``f'...'`` strings.
  21253. - bpo-24744: pkgutil.walk_packages function now raises ValueError if *path*
  21254. is a string. Patch by Sanyam Khurana.
  21255. - bpo-24484: Avoid race condition in multiprocessing cleanup.
  21256. - bpo-30589: Fix multiprocessing.Process.exitcode to return the opposite of
  21257. the signal number when the process is killed by a signal (instead of 255)
  21258. when using the "forkserver" method.
  21259. - bpo-28994: The traceback no longer displayed for SystemExit raised in a
  21260. callback registered by atexit.
  21261. - bpo-30508: Don't log exceptions if Task/Future "cancel()" method was
  21262. called.
  21263. - bpo-30645: Fix path calculation in ``imp.load_package()``, fixing it for
  21264. cases when a package is only shipped with bytecodes. Patch by Alexandru
  21265. Ardelean.
  21266. - bpo-11822: The dis.dis() function now is able to disassemble nested code
  21267. objects.
  21268. - bpo-30624: selectors does not take KeyboardInterrupt and SystemExit into
  21269. account, leaving a fd in a bad state in case of error. Patch by Giampaolo
  21270. Rodola'.
  21271. - bpo-30595: multiprocessing.Queue.get() with a timeout now polls its reader
  21272. in non-blocking mode if it succeeded to acquire the lock but the acquire
  21273. took longer than the timeout.
  21274. - bpo-28556: Updates to typing module: Add generic AsyncContextManager, add
  21275. support for ContextManager on all versions. Original PRs by Jelle Zijlstra
  21276. and Ivan Levkivskyi
  21277. - bpo-30605: re.compile() no longer raises a BytesWarning when compiling a
  21278. bytes instance with misplaced inline modifier. Patch by Roy Williams.
  21279. - bpo-29870: Fix ssl sockets leaks when connection is aborted in asyncio/ssl
  21280. implementation. Patch by Michaël Sghaïer.
  21281. - bpo-29743: Closing transport during handshake process leaks open socket.
  21282. Patch by Nikolay Kim
  21283. - bpo-27585: Fix waiter cancellation in asyncio.Lock. Patch by Mathieu
  21284. Sornay.
  21285. - bpo-30014: modify() method of poll(), epoll() and devpoll() based classes
  21286. of selectors module is around 10% faster. Patch by Giampaolo Rodola'.
  21287. - bpo-30418: On Windows, subprocess.Popen.communicate() now also ignore
  21288. EINVAL on stdin.write() if the child process is still running but closed
  21289. the pipe.
  21290. - bpo-30463: Addded empty __slots__ to abc.ABC. This allows subclassers to
  21291. deny __dict__ and __weakref__ creation. Patch by Aaron Hall.
  21292. - bpo-30520: Loggers are now pickleable.
  21293. - bpo-30557: faulthandler now correctly filters and displays exception codes
  21294. on Windows
  21295. - bpo-30526: Add TextIOWrapper.reconfigure() and a
  21296. TextIOWrapper.write_through attribute.
  21297. - bpo-30245: Fix possible overflow when organize struct.pack_into error
  21298. message. Patch by Yuan Liu.
  21299. - bpo-30378: Fix the problem that logging.handlers.SysLogHandler cannot
  21300. handle IPv6 addresses.
  21301. - bpo-16500: Allow registering at-fork handlers.
  21302. - bpo-30470: Deprecate invalid ctypes call protection on Windows. Patch by
  21303. Mariatta Wijaya.
  21304. - bpo-30414: multiprocessing.Queue._feed background running thread do not
  21305. break from main loop on exception.
  21306. - bpo-30003: Fix handling escape characters in HZ codec. Based on patch by
  21307. Ma Lin.
  21308. - bpo-30149: inspect.signature() now supports callables with
  21309. variable-argument parameters wrapped with partialmethod. Patch by Donghee
  21310. Na.
  21311. - bpo-30436: importlib.find_spec() raises ModuleNotFoundError instead of
  21312. AttributeError if the specified parent module is not a package (i.e. lacks
  21313. a __path__ attribute).
  21314. - bpo-30301: Fix AttributeError when using SimpleQueue.empty() under *spawn*
  21315. and *forkserver* start methods.
  21316. - bpo-30375: Warnings emitted when compile a regular expression now always
  21317. point to the line in the user code. Previously they could point into
  21318. inners of the re module if emitted from inside of groups or conditionals.
  21319. - bpo-30329: imaplib and poplib now catch the Windows socket WSAEINVAL error
  21320. (code 10022) on shutdown(SHUT_RDWR): An invalid operation was attempted.
  21321. This error occurs sometimes on SSL connections.
  21322. - bpo-29196: Removed previously deprecated in Python 2.4 classes Plist, Dict
  21323. and _InternalDict in the plistlib module. Dict values in the result of
  21324. functions readPlist() and readPlistFromBytes() are now normal dicts. You
  21325. no longer can use attribute access to access items of these dictionaries.
  21326. - bpo-9850: The :mod:`macpath` is now deprecated and will be removed in
  21327. Python 3.8.
  21328. - bpo-30299: Compiling regular expression in debug mode on CPython now
  21329. displays the compiled bytecode in human readable form.
  21330. - bpo-30048: Fixed ``Task.cancel()`` can be ignored when the task is running
  21331. coroutine and the coroutine returned without any more ``await``.
  21332. - bpo-30266: contextlib.AbstractContextManager now supports
  21333. anti-registration by setting __enter__ = None or __exit__ = None,
  21334. following the pattern introduced in bpo-25958. Patch by Jelle Zijlstra.
  21335. - bpo-30340: Enhanced regular expressions optimization. This increased the
  21336. performance of matching some patterns up to 25 times.
  21337. - bpo-30298: Weaken the condition of deprecation warnings for inline
  21338. modifiers. Now allowed several subsequential inline modifiers at the start
  21339. of the pattern (e.g. ``'(?i)(?s)...'``). In verbose mode whitespaces and
  21340. comments now are allowed before and between inline modifiers (e.g. ``'(?x)
  21341. (?i) (?s)...'``).
  21342. - bpo-30285: Optimized case-insensitive matching and searching of regular
  21343. expressions.
  21344. - bpo-29990: Fix range checking in GB18030 decoder. Original patch by Ma
  21345. Lin.
  21346. - bpo-29979: rewrite cgi.parse_multipart, reusing the FieldStorage class and
  21347. making its results consistent with those of FieldStorage for
  21348. multipart/form-data requests. Patch by Pierre Quentel.
  21349. - bpo-30243: Removed the __init__ methods of _json's scanner and encoder.
  21350. Misusing them could cause memory leaks or crashes. Now scanner and
  21351. encoder objects are completely initialized in the __new__ methods.
  21352. - bpo-30215: Compiled regular expression objects with the re.LOCALE flag no
  21353. longer depend on the locale at compile time. Only the locale at matching
  21354. time affects the result of matching.
  21355. - bpo-30185: Avoid KeyboardInterrupt tracebacks in forkserver helper process
  21356. when Ctrl-C is received.
  21357. - bpo-30103: binascii.b2a_uu() and uu.encode() now support using ``'`'`` as
  21358. zero instead of space.
  21359. - bpo-28556: Various updates to typing module: add typing.NoReturn type, use
  21360. WrapperDescriptorType, minor bug-fixes. Original PRs by Jim
  21361. Fasarakis-Hilliard and Ivan Levkivskyi.
  21362. - bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux.
  21363. - bpo-30228: The seek() and tell() methods of io.FileIO now set the internal
  21364. seekable attribute to avoid one syscall on open() (in buffered or text
  21365. mode).
  21366. - bpo-30190: unittest's assertAlmostEqual and assertNotAlmostEqual provide a
  21367. better message in case of failure which includes the difference between
  21368. left and right arguments. (patch by Giampaolo Rodola')
  21369. - bpo-30101: Add support for curses.A_ITALIC.
  21370. - bpo-29822: inspect.isabstract() now works during __init_subclass__. Patch
  21371. by Nate Soares.
  21372. - bpo-29960: Preserve generator state when _random.Random.setstate() raises
  21373. an exception. Patch by Bryan Olson.
  21374. - bpo-30070: Fixed leaks and crashes in errors handling in the parser
  21375. module.
  21376. - bpo-22352: Column widths in the output of dis.dis() are now adjusted for
  21377. large line numbers and instruction offsets.
  21378. - bpo-30061: Fixed crashes in IOBase methods __next__() and readlines() when
  21379. readline() or __next__() respectively return non-sizeable object. Fixed
  21380. possible other errors caused by not checking results of PyObject_Size(),
  21381. PySequence_Size(), or PyMapping_Size().
  21382. - bpo-30218: Fix PathLike support for shutil.unpack_archive. Patch by Jelle
  21383. Zijlstra.
  21384. - bpo-10076: Compiled regular expression and match objects in the re module
  21385. now support copy.copy() and copy.deepcopy() (they are considered atomic).
  21386. - bpo-30068: _io._IOBase.readlines will check if it's closed first when hint
  21387. is present.
  21388. - bpo-29694: Fixed race condition in pathlib mkdir with flags parents=True.
  21389. Patch by Armin Rigo.
  21390. - bpo-29692: Fixed arbitrary unchaining of RuntimeError exceptions in
  21391. contextlib.contextmanager. Patch by Siddharth Velankar.
  21392. - bpo-26187: Test that sqlite3 trace callback is not called multiple times
  21393. when schema is changing. Indirectly fixed by switching to use
  21394. sqlite3_prepare_v2() in bpo-9303. Patch by Aviv Palivoda.
  21395. - bpo-30017: Allowed calling the close() method of the zip entry writer
  21396. object multiple times. Writing to a closed writer now always produces a
  21397. ValueError.
  21398. - bpo-29998: Pickling and copying ImportError now preserves name and path
  21399. attributes.
  21400. - bpo-29995: re.escape() now escapes only regex special characters.
  21401. - bpo-29962: Add math.remainder operation, implementing remainder as
  21402. specified in IEEE 754.
  21403. - bpo-29649: Improve struct.pack_into() exception messages for problems with
  21404. the buffer size and offset. Patch by Andrew Nester.
  21405. - bpo-29654: Support If-Modified-Since HTTP header (browser cache). Patch
  21406. by Pierre Quentel.
  21407. - bpo-29931: Fixed comparison check for ipaddress.ip_interface objects.
  21408. Patch by Sanjay Sundaresan.
  21409. - bpo-29953: Fixed memory leaks in the replace() method of datetime and time
  21410. objects when pass out of bound fold argument.
  21411. - bpo-29942: Fix a crash in itertools.chain.from_iterable when encountering
  21412. long runs of empty iterables.
  21413. - bpo-10030: Sped up reading encrypted ZIP files by 2 times.
  21414. - bpo-29204: Element.getiterator() and the html parameter of XMLParser()
  21415. were deprecated only in the documentation (since Python 3.2 and 3.4
  21416. correspondingly). Now using them emits a deprecation warning.
  21417. - bpo-27863: Fixed multiple crashes in ElementTree caused by race conditions
  21418. and wrong types.
  21419. - bpo-25996: Added support of file descriptors in os.scandir() on Unix.
  21420. os.fwalk() is sped up by 2 times by using os.scandir().
  21421. - bpo-28699: Fixed a bug in pools in multiprocessing.pool that raising an
  21422. exception at the very first of an iterable may swallow the exception or
  21423. make the program hang. Patch by Davin Potts and Xiang Zhang.
  21424. - bpo-23890: unittest.TestCase.assertRaises() now manually breaks a
  21425. reference cycle to not keep objects alive longer than expected.
  21426. - bpo-29901: The zipapp module now supports general path-like objects, not
  21427. just pathlib.Path.
  21428. - bpo-25803: Avoid incorrect errors raised by Path.mkdir(exist_ok=True) when
  21429. the OS gives priority to errors such as EACCES over EEXIST.
  21430. - bpo-29861: Release references to tasks, their arguments and their results
  21431. as soon as they are finished in multiprocessing.Pool.
  21432. - bpo-19930: The mode argument of os.makedirs() no longer affects the file
  21433. permission bits of newly created intermediate-level directories.
  21434. - bpo-29884: faulthandler: Restore the old sigaltstack during teardown.
  21435. Patch by Christophe Zeitouny.
  21436. - bpo-25455: Fixed crashes in repr of recursive buffered file-like objects.
  21437. - bpo-29800: Fix crashes in partial.__repr__ if the keys of partial.keywords
  21438. are not strings. Patch by Michael Seifert.
  21439. - bpo-8256: Fixed possible failing or crashing input() if attributes
  21440. "encoding" or "errors" of sys.stdin or sys.stdout are not set or are not
  21441. strings.
  21442. - bpo-28692: Using non-integer value for selecting a plural form in gettext
  21443. is now deprecated.
  21444. - bpo-26121: Use C library implementation for math functions erf() and
  21445. erfc().
  21446. - bpo-29619: os.stat() and os.DirEntry.inode() now convert inode (st_ino)
  21447. using unsigned integers.
  21448. - bpo-28298: Fix a bug that prevented array 'Q', 'L' and 'I' from accepting
  21449. big intables (objects that have __int__) as elements.
  21450. - bpo-29645: Speed up importing the webbrowser module.
  21451. webbrowser.register() is now thread-safe.
  21452. - bpo-28231: The zipfile module now accepts path-like objects for external
  21453. paths.
  21454. - bpo-26915: index() and count() methods of collections.abc.Sequence now
  21455. check identity before checking equality when do comparisons.
  21456. - bpo-28682: Added support for bytes paths in os.fwalk().
  21457. - bpo-29728: Add new :const:`socket.TCP_NOTSENT_LOWAT` (Linux 3.12)
  21458. constant. Patch by Nathaniel J. Smith.
  21459. - bpo-29623: Allow use of path-like object as a single argument in
  21460. ConfigParser.read(). Patch by David Ellis.
  21461. - bpo-9303: Migrate sqlite3 module to _v2 API. Patch by Aviv Palivoda.
  21462. - bpo-28963: Fix out of bound iteration in
  21463. asyncio.Future.remove_done_callback implemented in C.
  21464. - bpo-29704: asyncio.subprocess.SubprocessStreamProtocol no longer closes
  21465. before all pipes are closed.
  21466. - bpo-29271: Fix Task.current_task and Task.all_tasks implemented in C to
  21467. accept None argument as their pure Python implementation.
  21468. - bpo-29703: Fix asyncio to support instantiation of new event loops in
  21469. child processes.
  21470. - bpo-29615: SimpleXMLRPCDispatcher no longer chains KeyError (or any other
  21471. exception) to exception(s) raised in the dispatched methods. Patch by Petr
  21472. Motejlek.
  21473. - bpo-7769: Method register_function() of
  21474. xmlrpc.server.SimpleXMLRPCDispatcher and its subclasses can now be used as
  21475. a decorator.
  21476. - bpo-29376: Fix assertion error in threading._DummyThread.is_alive().
  21477. - bpo-28624: Add a test that checks that cwd parameter of Popen() accepts
  21478. PathLike objects. Patch by Sayan Chowdhury.
  21479. - bpo-28518: Start a transaction implicitly before a DML statement. Patch by
  21480. Aviv Palivoda.
  21481. - bpo-29742: get_extra_info() raises exception if get called on closed ssl
  21482. transport. Patch by Nikolay Kim.
  21483. - bpo-16285: urllib.parse.quote is now based on RFC 3986 and hence includes
  21484. '~' in the set of characters that is not quoted by default. Patch by
  21485. Christian Theune and Ratnadeep Debnath.
  21486. - bpo-29532: Altering a kwarg dictionary passed to functools.partial() no
  21487. longer affects a partial object after creation.
  21488. - bpo-29110: Fix file object leak in aifc.open() when file is given as a
  21489. filesystem path and is not in valid AIFF format. Patch by Anthony Zhang.
  21490. - bpo-22807: Add uuid.SafeUUID and uuid.UUID.is_safe to relay information
  21491. from the platform about whether generated UUIDs are generated with a
  21492. multiprocessing safe method.
  21493. - bpo-29576: Improve some deprecations in importlib. Some deprecated methods
  21494. now emit DeprecationWarnings and have better descriptive messages.
  21495. - bpo-29534: Fixed different behaviour of Decimal.from_float() for _decimal
  21496. and _pydecimal. Thanks Andrew Nester.
  21497. - bpo-10379: locale.format_string now supports the 'monetary' keyword
  21498. argument, and locale.format is deprecated.
  21499. - bpo-29851: importlib.reload() now raises ModuleNotFoundError if the module
  21500. lacks a spec.
  21501. - bpo-28556: Various updates to typing module: typing.Counter,
  21502. typing.ChainMap, improved ABC caching, etc. Original PRs by Jelle
  21503. Zijlstra, Ivan Levkivskyi, Manuel Krebber, and Łukasz Langa.
  21504. - bpo-29100: Fix datetime.fromtimestamp() regression introduced in Python
  21505. 3.6.0: check minimum and maximum years.
  21506. - bpo-29416: Prevent infinite loop in pathlib.Path.mkdir
  21507. - bpo-29444: Fixed out-of-bounds buffer access in the group() method of the
  21508. match object. Based on patch by WGH.
  21509. - bpo-29377: Add WrapperDescriptorType, MethodWrapperType, and
  21510. MethodDescriptorType built-in types to types module. Original patch by
  21511. Manuel Krebber.
  21512. - bpo-29218: Unused install_misc command is now removed. It has been
  21513. documented as unused since 2000. Patch by Eric N. Vander Weele.
  21514. - bpo-29368: The extend() method is now called instead of the append()
  21515. method when unpickle collections.deque and other list-like objects. This
  21516. can speed up unpickling to 2 times.
  21517. - bpo-29338: The help of a builtin or extension class now includes the
  21518. constructor signature if __text_signature__ is provided for the class.
  21519. - bpo-29335: Fix subprocess.Popen.wait() when the child process has exited
  21520. to a stopped instead of terminated state (ex: when under ptrace).
  21521. - bpo-29290: Fix a regression in argparse that help messages would wrap at
  21522. non-breaking spaces.
  21523. - bpo-28735: Fixed the comparison of mock.MagickMock with mock.ANY.
  21524. - bpo-29197: Removed deprecated function ntpath.splitunc().
  21525. - bpo-29210: Removed support of deprecated argument "exclude" in
  21526. tarfile.TarFile.add().
  21527. - bpo-29219: Fixed infinite recursion in the repr of uninitialized
  21528. ctypes.CDLL instances.
  21529. - bpo-29192: Removed deprecated features in the http.cookies module.
  21530. - bpo-29193: A format string argument for string.Formatter.format() is now
  21531. positional-only.
  21532. - bpo-29195: Removed support of deprecated undocumented keyword arguments in
  21533. methods of regular expression objects.
  21534. - bpo-28969: Fixed race condition in C implementation of
  21535. functools.lru_cache. KeyError could be raised when cached function with
  21536. full cache was simultaneously called from different threads with the same
  21537. uncached arguments.
  21538. - bpo-20804: The unittest.mock.sentinel attributes now preserve their
  21539. identity when they are copied or pickled.
  21540. - bpo-29142: In urllib.request, suffixes in no_proxy environment variable
  21541. with leading dots could match related hostnames again (e.g. .b.c matches
  21542. a.b.c). Patch by Milan Oberkirch.
  21543. - bpo-28961: Fix unittest.mock._Call helper: don't ignore the name parameter
  21544. anymore. Patch written by Jiajun Huang.
  21545. - bpo-15812: inspect.getframeinfo() now correctly shows the first line of a
  21546. context. Patch by Sam Breese.
  21547. - bpo-28985: Update authorizer constants in sqlite3 module. Patch by
  21548. Dingyuan Wang.
  21549. - bpo-29079: Prevent infinite loop in pathlib.resolve() on Windows
  21550. - bpo-13051: Fixed recursion errors in large or resized
  21551. curses.textpad.Textbox. Based on patch by Tycho Andersen.
  21552. - bpo-9770: curses.ascii predicates now work correctly with negative
  21553. integers.
  21554. - bpo-28427: old keys should not remove new values from WeakValueDictionary
  21555. when collecting from another thread.
  21556. - bpo-28923: Remove editor artifacts from Tix.py.
  21557. - bpo-28871: Fixed a crash when deallocate deep ElementTree.
  21558. - bpo-19542: Fix bugs in WeakValueDictionary.setdefault() and
  21559. WeakValueDictionary.pop() when a GC collection happens in another thread.
  21560. - bpo-20191: Fixed a crash in resource.prlimit() when passing a sequence
  21561. that doesn't own its elements as limits.
  21562. - bpo-16255: subprocess.Popen uses /system/bin/sh on Android as the shell,
  21563. instead of /bin/sh.
  21564. - bpo-28779: multiprocessing.set_forkserver_preload() would crash the
  21565. forkserver process if a preloaded module instantiated some multiprocessing
  21566. objects such as locks.
  21567. - bpo-26937: The chown() method of the tarfile.TarFile class does not fail
  21568. now when the grp module cannot be imported, as for example on Android
  21569. platforms.
  21570. - bpo-28847: dbm.dumb now supports reading read-only files and no longer
  21571. writes the index file when it is not changed. A deprecation warning is
  21572. now emitted if the index file is missed and recreated in the 'r' and 'w'
  21573. modes (will be an error in future Python releases).
  21574. - bpo-27030: Unknown escapes consisting of ``'\'`` and an ASCII letter in
  21575. re.sub() replacement templates regular expressions now are errors.
  21576. - bpo-28835: Fix a regression introduced in warnings.catch_warnings(): call
  21577. warnings.showwarning() if it was overridden inside the context manager.
  21578. - bpo-27172: To assist with upgrades from 2.7, the previously documented
  21579. deprecation of ``inspect.getfullargspec()`` has been reversed. This
  21580. decision may be revisited again after the Python 2.7 branch is no longer
  21581. officially supported.
  21582. - bpo-28740: Add sys.getandroidapilevel(): return the build time API version
  21583. of Android as an integer. Function only available on Android.
  21584. - bpo-26273: Add new :const:`socket.TCP_CONGESTION` (Linux 2.6.13) and
  21585. :const:`socket.TCP_USER_TIMEOUT` (Linux 2.6.37) constants. Patch written
  21586. by Omar Sandoval.
  21587. - bpo-28752: Restored the __reduce__() methods of datetime objects.
  21588. - bpo-28727: Regular expression patterns, _sre.SRE_Pattern objects created
  21589. by re.compile(), become comparable (only x==y and x!=y operators). This
  21590. change should fix the issue #18383: don't duplicate warning filters when
  21591. the warnings module is reloaded (thing usually only done in unit tests).
  21592. - bpo-20572: Remove the subprocess.Popen.wait endtime parameter. It was
  21593. deprecated in 3.4 and undocumented prior to that.
  21594. - bpo-25659: In ctypes, prevent a crash calling the from_buffer() and
  21595. from_buffer_copy() methods on abstract classes like Array.
  21596. - bpo-28548: In the "http.server" module, parse the protocol version if
  21597. possible, to avoid using HTTP 0.9 in some error responses.
  21598. - bpo-19717: Makes Path.resolve() succeed on paths that do not exist. Patch
  21599. by Vajrasky Kok
  21600. - bpo-28563: Fixed possible DoS and arbitrary code execution when handle
  21601. plural form selections in the gettext module. The expression parser now
  21602. supports exact syntax supported by GNU gettext.
  21603. - bpo-28387: Fixed possible crash in _io.TextIOWrapper deallocator when the
  21604. garbage collector is invoked in other thread. Based on patch by Sebastian
  21605. Cufre.
  21606. - bpo-27517: LZMA compressor and decompressor no longer raise exceptions if
  21607. given empty data twice. Patch by Benjamin Fogle.
  21608. - bpo-28549: Fixed segfault in curses's addch() with ncurses6.
  21609. - bpo-28449: tarfile.open() with mode "r" or "r:" now tries to open a tar
  21610. file with compression before trying to open it without compression.
  21611. Otherwise it had 50% chance failed with ignore_zeros=True.
  21612. - bpo-23262: The webbrowser module now supports Firefox 36+ and derived
  21613. browsers. Based on patch by Oleg Broytman.
  21614. - bpo-24241: The webbrowser in an X environment now prefers using the
  21615. default browser directly. Also, the webbrowser register() function now has
  21616. a documented 'preferred' argument, to specify browsers to be returned by
  21617. get() with no arguments. Patch by David Steele
  21618. - bpo-27939: Fixed bugs in tkinter.ttk.LabeledScale and tkinter.Scale caused
  21619. by representing the scale as float value internally in Tk. tkinter.IntVar
  21620. now works if float value is set to underlying Tk variable.
  21621. - bpo-28255: calendar.TextCalendar.prweek() no longer prints a space after a
  21622. weeks's calendar. calendar.TextCalendar.pryear() no longer prints
  21623. redundant newline after a year's calendar. Based on patch by Xiang Zhang.
  21624. - bpo-28255: calendar.TextCalendar.prmonth() no longer prints a space at the
  21625. start of new line after printing a month's calendar. Patch by Xiang
  21626. Zhang.
  21627. - bpo-20491: The textwrap.TextWrapper class now honors non-breaking spaces.
  21628. Based on patch by Kaarle Ritvanen.
  21629. - bpo-28353: os.fwalk() no longer fails on broken links.
  21630. - bpo-28430: Fix iterator of C implemented asyncio.Future doesn't accept
  21631. non-None value is passed to it.send(val).
  21632. - bpo-27025: Generated names for Tkinter widgets now start by the "!" prefix
  21633. for readability.
  21634. - bpo-25464: Fixed HList.header_exists() in tkinter.tix module by addin a
  21635. workaround to Tix library bug.
  21636. - bpo-28488: shutil.make_archive() no longer adds entry "./" to ZIP archive.
  21637. - bpo-25953: re.sub() now raises an error for invalid numerical group
  21638. reference in replacement template even if the pattern is not found in the
  21639. string. Error message for invalid group reference now includes the group
  21640. index and the position of the reference. Based on patch by SilentGhost.
  21641. - bpo-28469: timeit now uses the sequence 1, 2, 5, 10, 20, 50,... instead of
  21642. 1, 10, 100,... for autoranging.
  21643. - bpo-28115: Command-line interface of the zipfile module now uses argparse.
  21644. Added support of long options.
  21645. - bpo-18219: Optimize csv.DictWriter for large number of columns. Patch by
  21646. Mariatta Wijaya.
  21647. - bpo-28448: Fix C implemented asyncio.Future didn't work on Windows.
  21648. - bpo-23214: In the "io" module, the argument to BufferedReader and
  21649. BytesIO's read1() methods is now optional and can be -1, matching the
  21650. BufferedIOBase specification.
  21651. - bpo-28480: Fix error building socket module when multithreading is
  21652. disabled.
  21653. - bpo-28240: timeit: remove ``-c/--clock`` and ``-t/--time`` command line
  21654. options which were deprecated since Python 3.3.
  21655. - bpo-28240: timeit now repeats the benchmarks 5 times instead of only 3 to
  21656. make benchmarks more reliable.
  21657. - bpo-28240: timeit autorange now uses a single loop iteration if the
  21658. benchmark takes less than 10 seconds, instead of 10 iterations. "python3
  21659. -m timeit -s 'import time' 'time.sleep(1)'" now takes 4 seconds instead of
  21660. 40 seconds.
  21661. - Distutils.sdist now looks for README and setup.py files with case
  21662. sensitivity. This behavior matches that found in Setuptools 6.0 and later.
  21663. See `setuptools 100 <https://github.com/pypa/setuptools/issues/100>`_ for
  21664. rationale.
  21665. - bpo-24452: Make webbrowser support Chrome on Mac OS X. Patch by Ned
  21666. Batchelder.
  21667. - bpo-20766: Fix references leaked by pdb in the handling of SIGINT
  21668. handlers.
  21669. - bpo-27998: Fixed bytes path support in os.scandir() on Windows. Patch by
  21670. Eryk Sun.
  21671. - bpo-28317: The disassembler now decodes FORMAT_VALUE argument.
  21672. - bpo-28380: unittest.mock Mock autospec functions now properly support
  21673. assert_called, assert_not_called, and assert_called_once.
  21674. - bpo-28229: lzma module now supports pathlib.
  21675. - bpo-28321: Fixed writing non-BMP characters with binary format in
  21676. plistlib.
  21677. - bpo-28225: bz2 module now supports pathlib. Initial patch by Ethan
  21678. Furman.
  21679. - bpo-28227: gzip now supports pathlib. Patch by Ethan Furman.
  21680. - bpo-28332: Deprecated silent truncations in socket.htons and socket.ntohs.
  21681. Original patch by Oren Milman.
  21682. - bpo-27358: Optimized merging var-keyword arguments and improved error
  21683. message when passing a non-mapping as a var-keyword argument.
  21684. - bpo-28257: Improved error message when passing a non-iterable as a
  21685. var-positional argument. Added opcode BUILD_TUPLE_UNPACK_WITH_CALL.
  21686. - bpo-28322: Fixed possible crashes when unpickle itertools objects from
  21687. incorrect pickle data. Based on patch by John Leitch.
  21688. - bpo-28228: imghdr now supports pathlib.
  21689. - bpo-28226: compileall now supports pathlib.
  21690. - bpo-28314: Fix function declaration (C flags) for the getiterator() method
  21691. of xml.etree.ElementTree.Element.
  21692. - bpo-28148: Stop using localtime() and gmtime() in the time module.
  21693. Introduced platform independent _PyTime_localtime API that is similar to
  21694. POSIX localtime_r, but available on all platforms. Patch by Ed Schouten.
  21695. - bpo-28253: Fixed calendar functions for extreme months: 0001-01 and
  21696. 9999-12. Methods itermonthdays() and itermonthdays2() are reimplemented so
  21697. that they don't call itermonthdates() which can cause datetime.date
  21698. under/overflow.
  21699. - bpo-28275: Fixed possible use after free in the decompress() methods of
  21700. the LZMADecompressor and BZ2Decompressor classes. Original patch by John
  21701. Leitch.
  21702. - bpo-27897: Fixed possible crash in sqlite3.Connection.create_collation()
  21703. if pass invalid string-like object as a name. Patch by Xiang Zhang.
  21704. - bpo-18844: random.choices() now has k as a keyword-only argument to
  21705. improve the readability of common cases and come into line with the
  21706. signature used in other languages.
  21707. - bpo-18893: Fix invalid exception handling in Lib/ctypes/macholib/dyld.py.
  21708. Patch by Madison May.
  21709. - bpo-27611: Fixed support of default root window in the tkinter.tix module.
  21710. Added the master parameter in the DisplayStyle constructor.
  21711. - bpo-27348: In the traceback module, restore the formatting of exception
  21712. messages like "Exception: None". This fixes a regression introduced in
  21713. 3.5a2.
  21714. - bpo-25651: Allow false values to be used for msg parameter of subTest().
  21715. - bpo-27778: Fix a memory leak in os.getrandom() when the getrandom() is
  21716. interrupted by a signal and a signal handler raises a Python exception.
  21717. - bpo-28200: Fix memory leak on Windows in the os module (fix
  21718. path_converter() function).
  21719. - bpo-25400: RobotFileParser now correctly returns default values for
  21720. crawl_delay and request_rate. Initial patch by Peter Wirtz.
  21721. - bpo-27932: Prevent memory leak in win32_ver().
  21722. - Fix UnboundLocalError in socket._sendfile_use_sendfile.
  21723. - bpo-28075: Check for ERROR_ACCESS_DENIED in Windows implementation of
  21724. os.stat(). Patch by Eryk Sun.
  21725. - bpo-22493: Warning message emitted by using inline flags in the middle of
  21726. regular expression now contains a (truncated) regex pattern. Patch by Tim
  21727. Graham.
  21728. - bpo-25270: Prevent codecs.escape_encode() from raising SystemError when an
  21729. empty bytestring is passed.
  21730. - bpo-28181: Get antigravity over HTTPS. Patch by Kaartic Sivaraam.
  21731. - bpo-25895: Enable WebSocket URL schemes in urllib.parse.urljoin. Patch by
  21732. Gergely Imreh and Markus Holtermann.
  21733. - bpo-28114: Fix a crash in parse_envlist() when env contains byte strings.
  21734. Patch by Eryk Sun.
  21735. - bpo-27599: Fixed buffer overrun in binascii.b2a_qp() and
  21736. binascii.a2b_qp().
  21737. - bpo-27906: Fix socket accept exhaustion during high TCP traffic. Patch by
  21738. Kevin Conway.
  21739. - bpo-28174: Handle when SO_REUSEPORT isn't properly supported. Patch by
  21740. Seth Michael Larson.
  21741. - bpo-26654: Inspect functools.partial in asyncio.Handle.__repr__. Patch by
  21742. iceboy.
  21743. - bpo-26909: Fix slow pipes IO in asyncio. Patch by INADA Naoki.
  21744. - bpo-28176: Fix callbacks race in asyncio.SelectorLoop.sock_connect.
  21745. - bpo-27759: Fix selectors incorrectly retain invalid file descriptors.
  21746. Patch by Mark Williams.
  21747. - bpo-28325: Remove vestigial MacOS 9 macurl2path module and its tests.
  21748. - bpo-28368: Refuse monitoring processes if the child watcher has no loop
  21749. attached. Patch by Vincent Michel.
  21750. - bpo-28369: Raise RuntimeError when transport's FD is used with add_reader,
  21751. add_writer, etc.
  21752. - bpo-28370: Speedup asyncio.StreamReader.readexactly. Patch by Коренберг
  21753. Марк.
  21754. - bpo-28371: Deprecate passing asyncio.Handles to run_in_executor.
  21755. - bpo-28372: Fix asyncio to support formatting of non-python coroutines.
  21756. - bpo-28399: Remove UNIX socket from FS before binding. Patch by Коренберг
  21757. Марк.
  21758. - bpo-27972: Prohibit Tasks to await on themselves.
  21759. - bpo-24142: Reading a corrupt config file left configparser in an invalid
  21760. state. Original patch by Florian Höch.
  21761. - bpo-29581: ABCMeta.__new__ now accepts ``**kwargs``, allowing abstract
  21762. base classes to use keyword parameters in __init_subclass__. Patch by Nate
  21763. Soares.
  21764. - bpo-25532: inspect.unwrap() will now only try to unwrap an object
  21765. sys.getrecursionlimit() times, to protect against objects which create a
  21766. new object on every attribute access.
  21767. - bpo-30177: path.resolve(strict=False) no longer cuts the path after the
  21768. first element not present in the filesystem. Patch by Antoine Pietri.
  21769. Documentation
  21770. -------------
  21771. - bpo-31294: Fix incomplete code snippet in the ZeroMQSocketListener and
  21772. ZeroMQSocketHandler examples and adapt them to Python 3.
  21773. - bpo-21649: Add RFC 7525 and Mozilla server side TLS links to SSL
  21774. documentation.
  21775. - bpo-31128: Allow the pydoc server to bind to arbitrary hostnames.
  21776. - bpo-30803: Clarify doc on truth value testing. Original patch by Peter
  21777. Thomassen.
  21778. - bpo-30176: Add missing attribute related constants in curses
  21779. documentation.
  21780. - bpo-30052: the link targets for :func:`bytes` and :func:`bytearray` are
  21781. now their respective type definitions, rather than the corresponding
  21782. builtin function entries. Use :ref:`bytes <func-bytes>` and
  21783. :ref:`bytearray <func-bytearray>` to reference the latter. In order to
  21784. ensure this and future cross-reference updates are applied automatically,
  21785. the daily documentation builds now disable the default output caching
  21786. features in Sphinx.
  21787. - bpo-26985: Add missing info of code object in inspect documentation.
  21788. - bpo-19824: Improve the documentation for, and links to, template strings
  21789. by emphasizing their utility for internationalization, and by clarifying
  21790. some usage constraints. (See also: bpo-20314, bpo-12518)
  21791. - bpo-28929: Link the documentation to its source file on GitHub.
  21792. - bpo-25008: Document smtpd.py as effectively deprecated and add a pointer
  21793. to aiosmtpd, a third-party asyncio-based replacement.
  21794. - bpo-26355: Add canonical header link on each page to corresponding major
  21795. version of the documentation. Patch by Matthias Bussonnier.
  21796. - bpo-29349: Fix Python 2 syntax in code for building the documentation.
  21797. - bpo-23722: The data model reference and the porting section in the 3.6
  21798. What's New guide now cover the additional ``__classcell__`` handling
  21799. needed for custom metaclasses to fully support :pep:`487` and
  21800. zero-argument ``super()``.
  21801. - bpo-28513: Documented command-line interface of zipfile.
  21802. Tests
  21803. -----
  21804. - bpo-29639: test.support.HOST is now "localhost", a new HOSTv4 constant has
  21805. been added for your ``127.0.0.1`` needs, similar to the existing HOSTv6
  21806. constant.
  21807. - bpo-31320: Silence traceback in test_ssl
  21808. - bpo-31346: Prefer PROTOCOL_TLS_CLIENT and PROTOCOL_TLS_SERVER protocols
  21809. for SSLContext.
  21810. - bpo-25674: Remove sha256.tbs-internet.com ssl test
  21811. - bpo-30715: Address ALPN callback changes for OpenSSL 1.1.0f. The latest
  21812. version behaves like OpenSSL 1.0.2 and no longer aborts handshake.
  21813. - bpo-30822: regrtest: Exclude tzdata from regrtest --all. When running the
  21814. test suite using --use=all / -u all, exclude tzdata since it makes
  21815. test_datetime too slow (15-20 min on some buildbots) which then times out
  21816. on some buildbots. Fix also regrtest command line parser to allow passing
  21817. -u extralargefile to run test_zipfile64.
  21818. - bpo-30695: Add the ``set_nomemory(start, stop)`` and
  21819. ``remove_mem_hooks()`` functions to the ``_testcapi`` module.
  21820. - bpo-30357: test_thread: setUp() now uses support.threading_setup() and
  21821. support.threading_cleanup() to wait until threads complete to avoid random
  21822. side effects on following tests. Initial patch written by Grzegorz
  21823. Grzywacz.
  21824. - bpo-30197: Enhanced functions swap_attr() and swap_item() in the
  21825. test.support module. They now work when delete replaced attribute or item
  21826. inside the with statement. The old value of the attribute or item (or
  21827. None if it doesn't exist) now will be assigned to the target of the "as"
  21828. clause, if there is one.
  21829. - bpo-24932: Use proper command line parsing in _testembed
  21830. - bpo-28950: Disallow -j0 to be combined with -T/-l in regrtest command line
  21831. arguments.
  21832. - bpo-28683: Fix the tests that bind() a unix socket and raise
  21833. PermissionError on Android for a non-root user.
  21834. - bpo-26936: Fix the test_socket failures on Android - getservbyname(),
  21835. getservbyport() and getaddrinfo() are broken on some Android API levels.
  21836. - bpo-28666: Now test.support.rmtree is able to remove unwritable or
  21837. unreadable directories.
  21838. - bpo-23839: Various caches now are cleared before running every test file.
  21839. - bpo-26944: Fix test_posix for Android where 'id -G' is entirely wrong or
  21840. missing the effective gid.
  21841. - bpo-28409: regrtest: fix the parser of command line arguments.
  21842. - bpo-28217: Adds _testconsole module to test console input.
  21843. - bpo-26939: Add the support.setswitchinterval() function to fix
  21844. test_functools hanging on the Android armv7 qemu emulator.
  21845. Build
  21846. -----
  21847. - bpo-31354: Allow ``--with-lto`` to be used on all builds, not just ``make
  21848. profile-opt``.
  21849. - bpo-31370: Remove support for building --without-threads. This option is
  21850. not really useful anymore in the 21st century. Removing lots of
  21851. conditional paths allows us to simplify the code base, including in
  21852. difficult to maintain low-level internal code.
  21853. - bpo-31341: Per :pep:`11`, support for the IRIX operating system was
  21854. removed.
  21855. - bpo-30854: Fix compile error when compiling --without-threads. Patch by
  21856. Masayuki Yamamoto.
  21857. - bpo-30687: Locate msbuild.exe on Windows when building rather than
  21858. vcvarsall.bat
  21859. - bpo-20210: Support the *disabled* marker in Setup files. Extension modules
  21860. listed after this marker are not built at all, neither by the Makefile nor
  21861. by setup.py.
  21862. - bpo-29941: Add ``--with-assertions`` configure flag to explicitly enable C
  21863. ``assert()`` checks. Defaults to off. ``--with-pydebug`` implies
  21864. ``--with-assertions``.
  21865. - bpo-28787: Fix out-of-tree builds of Python when configured with
  21866. ``--with--dtrace``.
  21867. - bpo-29243: Prevent unnecessary rebuilding of Python during ``make test``,
  21868. ``make install`` and some other make targets when configured with
  21869. ``--enable-optimizations``.
  21870. - bpo-23404: Don't regenerate generated files based on file modification
  21871. time anymore: the action is now explicit. Replace ``make touch`` with
  21872. ``make regen-all``.
  21873. - bpo-29643: Fix ``--enable-optimization`` didn't work.
  21874. - bpo-27593: sys.version and the platform module python_build(),
  21875. python_branch(), and python_revision() functions now use git information
  21876. rather than hg when building from a repo.
  21877. - bpo-29572: Update Windows build and OS X installers to use OpenSSL 1.0.2k.
  21878. - bpo-27659: Prohibit implicit C function declarations: use
  21879. ``-Werror=implicit-function-declaration`` when possible (GCC and Clang,
  21880. but it depends on the compiler version). Patch written by Chi Hsuan Yen.
  21881. - bpo-29384: Remove old Be OS helper scripts.
  21882. - bpo-26851: Set Android compilation and link flags.
  21883. - bpo-28768: Fix implicit declaration of function _setmode. Patch by
  21884. Masayuki Yamamoto
  21885. - bpo-29080: Removes hard dependency on hg.exe from PCBuild/build.bat
  21886. - bpo-23903: Added missed names to PC/python3.def.
  21887. - bpo-28762: lockf() is available on Android API level 24, but the F_LOCK
  21888. macro is not defined in android-ndk-r13.
  21889. - bpo-28538: Fix the compilation error that occurs because if_nameindex() is
  21890. available on Android API level 24, but the if_nameindex structure is not
  21891. defined.
  21892. - bpo-20211: Do not add the directory for installing C header files and the
  21893. directory for installing object code libraries to the cross compilation
  21894. search paths. Original patch by Thomas Petazzoni.
  21895. - bpo-28849: Do not define sys.implementation._multiarch on Android.
  21896. - bpo-10656: Fix out-of-tree building on AIX. Patch by Tristan Carel and
  21897. Michael Haubenwallner.
  21898. - bpo-26359: Rename --with-optimiations to --enable-optimizations.
  21899. - bpo-28444: Fix missing extensions modules when cross compiling.
  21900. - bpo-28208: Update Windows build and OS X installers to use SQLite 3.14.2.
  21901. - bpo-28248: Update Windows build and OS X installers to use OpenSSL 1.0.2j.
  21902. - bpo-21124: Fix building the _struct module on Cygwin by passing ``NULL``
  21903. instead of ``&PyType_Type`` to PyVarObject_HEAD_INIT. Patch by Masayuki
  21904. Yamamoto.
  21905. - bpo-13756: Fix building extensions modules on Cygwin. Patch by Roumen
  21906. Petrov, based on original patch by Jason Tishler.
  21907. - bpo-21085: Add configure check for siginfo_t.si_band, which Cygwin does
  21908. not provide. Patch by Masayuki Yamamoto with review and rebase by Erik
  21909. Bray.
  21910. - bpo-28258: Fixed build with Estonian locale (python-config and distclean
  21911. targets in Makefile). Patch by Arfrever Frehtes Taifersar Arahesis.
  21912. - bpo-26661: setup.py now detects system libffi with multiarch wrapper.
  21913. - bpo-27979: A full copy of libffi is no longer bundled for use when
  21914. building _ctypes on non-OSX UNIX platforms. An installed copy of libffi
  21915. is now required when building _ctypes on such platforms.
  21916. - bpo-15819: Remove redundant include search directory option for building
  21917. outside the source tree.
  21918. - bpo-28676: Prevent missing 'getentropy' declaration warning on macOS.
  21919. Patch by Gareth Rees.
  21920. Windows
  21921. -------
  21922. - bpo-31392: Update Windows build to use OpenSSL 1.1.0f
  21923. - bpo-30389: Adds detection of Visual Studio 2017 to distutils on Windows.
  21924. - bpo-31358: zlib is no longer bundled in the CPython source, instead it is
  21925. downloaded on demand just like bz2, lzma, OpenSSL, Tcl/Tk, and SQLite.
  21926. - bpo-31340: Change to building with MSVC v141 (included with Visual Studio
  21927. 2017)
  21928. - bpo-30581: os.cpu_count() now returns the correct number of processors on
  21929. Windows when the number of logical processors is greater than 64.
  21930. - bpo-30916: Pre-build OpenSSL, Tcl and Tk and include the binaries in the
  21931. build.
  21932. - bpo-30731: Add a missing xmlns to python.manifest so that it matches the
  21933. schema.
  21934. - bpo-30291: Allow requiring 64-bit interpreters from py.exe using -64
  21935. suffix. Contributed by Steve (Gadget) Barnes.
  21936. - bpo-30362: Adds list options (-0, -0p) to py.exe launcher. Contributed by
  21937. Steve Barnes.
  21938. - bpo-23451: Fix socket deprecation warnings in socketmodule.c. Patch by
  21939. Segev Finer.
  21940. - bpo-30450: The build process on Windows no longer depends on Subversion,
  21941. instead pulling external code from GitHub via a Python script. If Python
  21942. 3.6 is not found on the system (via ``py -3.6``), NuGet is used to
  21943. download a copy of 32-bit Python.
  21944. - bpo-29579: Removes readme.txt from the installer.
  21945. - bpo-25778: winreg does not truncate string correctly (Patch by Eryk Sun)
  21946. - bpo-28896: Deprecate WindowsRegistryFinder and disable it by default
  21947. - bpo-28522: Fixes mishandled buffer reallocation in getpathp.c
  21948. - bpo-28402: Adds signed catalog files for stdlib on Windows.
  21949. - bpo-28333: Enables Unicode for ps1/ps2 and input() prompts. (Patch by Eryk
  21950. Sun)
  21951. - bpo-28251: Improvements to help manuals on Windows.
  21952. - bpo-28110: launcher.msi has different product codes between 32-bit and
  21953. 64-bit
  21954. - bpo-28161: Opening CON for write access fails
  21955. - bpo-28162: WindowsConsoleIO readall() fails if first line starts with
  21956. Ctrl+Z
  21957. - bpo-28163: WindowsConsoleIO fileno() passes wrong flags to _open_osfhandle
  21958. - bpo-28164: _PyIO_get_console_type fails for various paths
  21959. - bpo-28137: Renames Windows path file to ._pth
  21960. - bpo-28138: Windows ._pth file should allow import site
  21961. IDLE
  21962. ----
  21963. - bpo-31493: IDLE code context -- fix code update and font update timers.
  21964. Canceling timers prevents a warning message when test_idle completes.
  21965. - bpo-31488: IDLE - Update non-key options in former extension classes. When
  21966. applying configdialog changes, call .reload for each feature class. Change
  21967. ParenMatch so updated options affect existing instances attached to
  21968. existing editor windows.
  21969. - bpo-31477: IDLE - Improve rstrip entry in doc. Strip trailing whitespace
  21970. strips more than blank spaces. Multiline string literals are not skipped.
  21971. - bpo-31480: IDLE - make tests pass with zzdummy extension disabled by
  21972. default.
  21973. - bpo-31421: Document how IDLE runs tkinter programs. IDLE calls tcl/tk
  21974. update in the background in order to make live interaction and
  21975. experimentation with tkinter applications much easier.
  21976. - bpo-31414: IDLE -- fix tk entry box tests by deleting first. Adding to an
  21977. int entry is not the same as deleting and inserting because int('') will
  21978. fail.
  21979. - bpo-31051: Rearrange IDLE configdialog GenPage into Window, Editor, and
  21980. Help sections.
  21981. - bpo-30617: IDLE - Add docstrings and tests for outwin subclass of editor.
  21982. Move some data and functions from the class to module level. Patch by
  21983. Cheryl Sabella.
  21984. - bpo-31287: IDLE - Do not modify tkinter.message in test_configdialog.
  21985. - bpo-27099: Convert IDLE's built-in 'extensions' to regular features. About
  21986. 10 IDLE features were implemented as supposedly optional extensions. Their
  21987. different behavior could be confusing or worse for users and not good for
  21988. maintenance. Hence the conversion. The main difference for users is that
  21989. user configurable key bindings for builtin features are now handled
  21990. uniformly. Now, editing a binding in a keyset only affects its value in
  21991. the keyset. All bindings are defined together in the system-specific
  21992. default keysets in config-extensions.def. All custom keysets are saved as
  21993. a whole in config-extension.cfg. All take effect as soon as one clicks
  21994. Apply or Ok. The affected events are '<<force-open-completions>>',
  21995. '<<expand-word>>', '<<force-open-calltip>>', '<<flash-paren>>',
  21996. '<<format-paragraph>>', '<<run-module>>', '<<check-module>>', and
  21997. '<<zoom-height>>'. Any (global) customizations made before 3.6.3 will not
  21998. affect their keyset-specific customization after 3.6.3. and vice versa.
  21999. Initial patch by Charles Wohlganger.
  22000. - bpo-31206: IDLE: Factor HighPage(Frame) class from ConfigDialog. Patch by
  22001. Cheryl Sabella.
  22002. - bpo-31001: Add tests for configdialog highlight tab. Patch by Cheryl
  22003. Sabella.
  22004. - bpo-31205: IDLE: Factor KeysPage(Frame) class from ConfigDialog. The
  22005. slightly modified tests continue to pass. Patch by Cheryl Sabella.
  22006. - bpo-31130: IDLE -- stop leaks in test_configdialog. Initial patch by
  22007. Victor Stinner.
  22008. - bpo-31002: Add tests for configdialog keys tab. Patch by Cheryl Sabella.
  22009. - bpo-19903: IDLE: Calltips use ``inspect.signature`` instead of
  22010. ``inspect.getfullargspec``. This improves calltips for builtins converted
  22011. to use Argument Clinic. Patch by Louie Lu.
  22012. - bpo-31083: IDLE - Add an outline of a TabPage class in configdialog.
  22013. Update existing classes to match outline. Initial patch by Cheryl Sabella.
  22014. - bpo-31050: Factor GenPage(Frame) class from ConfigDialog. The slightly
  22015. modified tests continue to pass. Patch by Cheryl Sabella.
  22016. - bpo-31004: IDLE - Factor FontPage(Frame) class from ConfigDialog. Slightly
  22017. modified tests continue to pass. Fix General tests. Patch mostly by Cheryl
  22018. Sabella.
  22019. - bpo-30781: IDLE - Use ttk widgets in ConfigDialog. Patches by Terry Jan
  22020. Reedy and Cheryl Sabella.
  22021. - bpo-31060: IDLE - Finish rearranging methods of ConfigDialog Grouping
  22022. methods pertaining to each tab and the buttons will aid writing tests and
  22023. improving the tabs and will enable splitting the groups into classes.
  22024. - bpo-30853: IDLE -- Factor a VarTrace class out of ConfigDialog. Instance
  22025. tracers manages pairs consisting of a tk variable and a callback function.
  22026. When tracing is turned on, setting the variable calls the function. Test
  22027. coverage for the new class is 100%.
  22028. - bpo-31003: IDLE: Add more tests for General tab.
  22029. - bpo-30993: IDLE - Improve configdialog font page and tests. In
  22030. configdialog: Document causal pathways in create_font_tab docstring.
  22031. Simplify some attribute names. Move set_samples calls to var_changed_font
  22032. (idea from Cheryl Sabella). Move related functions to positions after the
  22033. create widgets function. In test_configdialog: Fix test_font_set so not
  22034. order dependent. Fix renamed test_indent_scale so it tests the widget.
  22035. Adjust tests for movement of set_samples call. Add tests for load
  22036. functions. Put all font tests in one class and tab indent tests in
  22037. another. Except for two lines, these tests completely cover the related
  22038. functions.
  22039. - bpo-30981: IDLE -- Add more configdialog font page tests.
  22040. - bpo-28523: IDLE: replace 'colour' with 'color' in configdialog.
  22041. - bpo-30917: Add tests for idlelib.config.IdleConf. Increase coverage from
  22042. 46% to 96%. Patch by Louie Lu.
  22043. - bpo-30934: Document coverage details for idlelib tests. Add section to
  22044. idlelib/idle-test/README.txt. Include check that branches are taken both
  22045. ways. Exclude IDLE-specific code that does not run during unit tests.
  22046. - bpo-30913: IDLE: Document ConfigDialog tk Vars, methods, and widgets in
  22047. docstrings This will facilitate improving the dialog and splitting up the
  22048. class. Original patch by Cheryl Sabella.
  22049. - bpo-30899: IDLE: Add tests for ConfigParser subclasses in config. Patch by
  22050. Louie Lu.
  22051. - bpo-30881: IDLE: Add docstrings to browser.py. Patch by Cheryl Sabella.
  22052. - bpo-30851: IDLE: Remove unused variables in configdialog. One is a
  22053. duplicate, one is set but cannot be altered by users. Patch by Cheryl
  22054. Sabella.
  22055. - bpo-30870: IDLE: In Settings dialog, select font with Up, Down keys as
  22056. well as mouse. Initial patch by Louie Lu.
  22057. - bpo-8231: IDLE: call config.IdleConf.GetUserCfgDir only once.
  22058. - bpo-30779: IDLE: Factor ConfigChanges class from configdialog, put in
  22059. config; test. * In config, put dump test code in a function; run it and
  22060. unittest in 'if __name__ == '__main__'. * Add class config.ConfigChanges
  22061. based on changes_class_v4.py on bpo issue. * Add class
  22062. test_config.ChangesTest, partly using configdialog_tests_v1.py. * Revise
  22063. configdialog to use ConfigChanges; see tracker msg297804. * Revise
  22064. test_configdialog to match configdialog changes. * Remove configdialog
  22065. functions unused or moved to ConfigChanges. Cheryl Sabella contributed
  22066. parts of the patch.
  22067. - bpo-30777: IDLE: configdialog - Add docstrings and fix comments. Patch by
  22068. Cheryl Sabella.
  22069. - bpo-30495: IDLE: Improve textview with docstrings, PEP8 names, and more
  22070. tests. Patch by Cheryl Sabella.
  22071. - bpo-30723: IDLE: Make several improvements to parenmatch. Add 'parens'
  22072. style to highlight both opener and closer. Make 'default' style, which is
  22073. not default, a synonym for 'opener'. Make time-delay work the same with
  22074. all styles. Add help for config dialog extensions tab, including help for
  22075. parenmatch. Add new tests. Original patch by Charles Wohlganger.
  22076. - bpo-30674: IDLE: add docstrings to grep module. Patch by Cheryl Sabella
  22077. - bpo-21519: IDLE's basic custom key entry dialog now detects duplicates
  22078. properly. Original patch by Saimadhav Heblikar.
  22079. - bpo-29910: IDLE no longer deletes a character after commenting out a
  22080. region by a key shortcut. Add ``return 'break'`` for this and other
  22081. potential conflicts between IDLE and default key bindings.
  22082. - bpo-30728: Review and change idlelib.configdialog names. Lowercase method
  22083. and attribute names. Replace 'colour' with 'color', expand overly cryptic
  22084. names, delete unneeded underscores. Replace ``import *`` with specific
  22085. imports. Patches by Cheryl Sabella.
  22086. - bpo-6739: IDLE: Verify user-entered key sequences by trying to bind them
  22087. with tk. Add tests for all 3 validation functions. Original patch by G
  22088. Polo. Tests added by Cheryl Sabella.
  22089. - bpo-15786: Fix several problems with IDLE's autocompletion box. The
  22090. following should now work: clicking on selection box items; using the
  22091. scrollbar; selecting an item by hitting Return. Hangs on MacOSX should no
  22092. longer happen. Patch by Louie Lu.
  22093. - bpo-25514: Add doc subsubsection about IDLE failure to start. Popup
  22094. no-connection message directs users to this section.
  22095. - bpo-30642: Fix reference leaks in IDLE tests. Patches by Louie Lu and
  22096. Terry Jan Reedy.
  22097. - bpo-30495: Add docstrings for textview.py and use PEP8 names. Patches by
  22098. Cheryl Sabella and Terry Jan Reedy.
  22099. - bpo-30290: Help-about: use pep8 names and add tests. Increase coverage to
  22100. 100%. Patches by Louie Lu, Cheryl Sabella, and Terry Jan Reedy.
  22101. - bpo-30303: Add _utest option to textview; add new tests. Increase coverage
  22102. to 100%. Patches by Louie Lu and Terry Jan Reedy.
  22103. - bpo-29071: IDLE colors f-string prefixes (but not invalid ur prefixes).
  22104. - bpo-28572: Add 10% to coverage of IDLE's test_configdialog. Update and
  22105. augment description of the configuration system.
  22106. Tools/Demos
  22107. -----------
  22108. - bpo-30983: gdb integration commands (py-bt, etc.) work on optimized shared
  22109. builds now, too. :pep:`523` introduced _PyEval_EvalFrameDefault which
  22110. inlines PyEval_EvalFrameEx on non-debug shared builds. This broke the
  22111. ability to use py-bt, py-up, and a few other Python-specific gdb
  22112. integrations. The problem is fixed by only looking for
  22113. _PyEval_EvalFrameDefault frames in python-gdb.py. Original patch by Bruno
  22114. "Polaco" Penteado.
  22115. - bpo-29748: Added the slice index converter in Argument Clinic.
  22116. - bpo-24037: Argument Clinic now uses the converter ``bool(accept={int})``
  22117. rather than ``int`` for semantical booleans. This avoids repeating the
  22118. default value for Python and C and will help in converting to ``bool`` in
  22119. future.
  22120. - bpo-29367: python-gdb.py now supports also ``method-wrapper``
  22121. (``wrapperobject``) objects.
  22122. - bpo-28023: Fix python-gdb.py didn't support new dict implementation.
  22123. - bpo-15369: The pybench and pystone microbenchmark have been removed from
  22124. Tools. Please use the new Python benchmark suite
  22125. https://github.com/python/pyperformance which is more reliable and
  22126. includes a portable version of pybench working on Python 2 and Python 3.
  22127. - bpo-28102: The zipfile module CLI now prints usage to stderr. Patch by
  22128. Stephen J. Turnbull.
  22129. C API
  22130. -----
  22131. - bpo-31338: Added the ``Py_UNREACHABLE()`` macro for code paths which are
  22132. never expected to be reached. This and a few other useful macros are now
  22133. documented in the C API manual.
  22134. - bpo-30832: Remove own implementation for thread-local storage. CPython has
  22135. provided the own implementation for thread-local storage (TLS) on
  22136. Python/thread.c, it's used in the case which a platform has not supplied
  22137. native TLS. However, currently all supported platforms (Windows and
  22138. pthreads) have provided native TLS and defined the Py_HAVE_NATIVE_TLS
  22139. macro with unconditional in any case.
  22140. - bpo-30708: PyUnicode_AsWideCharString() now raises a ValueError if the
  22141. second argument is NULL and the wchar_t\* string contains null characters.
  22142. - bpo-16500: Deprecate PyOS_AfterFork() and add PyOS_BeforeFork(),
  22143. PyOS_AfterFork_Parent() and PyOS_AfterFork_Child().
  22144. - bpo-6532: The type of results of PyThread_start_new_thread() and
  22145. PyThread_get_thread_ident(), and the id parameter of
  22146. PyThreadState_SetAsyncExc() changed from "long" to "unsigned long".
  22147. - bpo-27867: Function PySlice_GetIndicesEx() is deprecated and replaced with
  22148. a macro if Py_LIMITED_API is not set or set to the value between
  22149. 0x03050400 and 0x03060000 (not including) or 0x03060100 or higher. Added
  22150. functions PySlice_Unpack() and PySlice_AdjustIndices().
  22151. - bpo-29083: Fixed the declaration of some public API functions.
  22152. PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in
  22153. limited API. PyArg_ValidateKeywordArguments(), PyArg_UnpackTuple() and
  22154. Py_BuildValue() were not available in limited API of version < 3.3 when
  22155. PY_SSIZE_T_CLEAN is defined.
  22156. - bpo-28769: The result of PyUnicode_AsUTF8AndSize() and PyUnicode_AsUTF8()
  22157. is now of type ``const char *`` rather of ``char *``.
  22158. - bpo-29058: All stable API extensions added after Python 3.2 are now
  22159. available only when Py_LIMITED_API is set to the PY_VERSION_HEX value of
  22160. the minimum Python version supporting this API.
  22161. - bpo-28822: The index parameters *start* and *end* of PyUnicode_FindChar()
  22162. are now adjusted to behave like ``str[start:end]``.
  22163. - bpo-28808: PyUnicode_CompareWithASCIIString() now never raises exceptions.
  22164. - bpo-28761: The fields name and doc of structures PyMemberDef, PyGetSetDef,
  22165. PyStructSequence_Field, PyStructSequence_Desc, and wrapperbase are now of
  22166. type ``const char *`` rather of ``char *``.
  22167. - bpo-28748: Private variable _Py_PackageContext is now of type ``const char
  22168. *`` rather of ``char *``.
  22169. - bpo-19569: Compiler warnings are now emitted if use most of deprecated
  22170. functions.
  22171. - bpo-28426: Deprecated undocumented functions PyUnicode_AsEncodedObject(),
  22172. PyUnicode_AsDecodedObject(), PyUnicode_AsDecodedUnicode() and
  22173. PyUnicode_AsEncodedUnicode().
  22174. What's New in Python 3.6.6 final?
  22175. =================================
  22176. *Release date: 2018-06-27*
  22177. There were no new changes in version 3.6.6.
  22178. What's New in Python 3.6.6 release candidate 1?
  22179. ===============================================
  22180. *Release date: 2018-06-11*
  22181. Core and Builtins
  22182. -----------------
  22183. - bpo-33786: Fix asynchronous generators to handle GeneratorExit in athrow()
  22184. correctly
  22185. - bpo-30654: Fixed reset of the SIGINT handler to SIG_DFL on interpreter
  22186. shutdown even when there was a custom handler set previously. Patch by
  22187. Philipp Kerling.
  22188. - bpo-33622: Fixed a leak when the garbage collector fails to add an object
  22189. with the ``__del__`` method or referenced by it into the
  22190. :data:`gc.garbage` list. :c:func:`PyGC_Collect` can now be called when an
  22191. exception is set and preserves it.
  22192. - bpo-31849: Fix signed/unsigned comparison warning in pyhash.c.
  22193. - bpo-33391: Fix a leak in set_symmetric_difference().
  22194. - bpo-28055: Fix unaligned accesses in siphash24(). Patch by Rolf Eike Beer.
  22195. - bpo-33231: Fix potential memory leak in ``normalizestring()``.
  22196. - bpo-29922: Improved error messages in 'async with' when ``__aenter__()``
  22197. or ``__aexit__()`` return non-awaitable object.
  22198. - bpo-33199: Fix ``ma_version_tag`` in dict implementation is uninitialized
  22199. when copying from key-sharing dict.
  22200. - bpo-33041: Fixed jumping when the function contains an ``async for`` loop.
  22201. - bpo-32282: Fix an unnecessary ifdef in the include of VersionHelpers.h in
  22202. socketmodule on Windows.
  22203. - bpo-21983: Fix a crash in ``ctypes.cast()`` in case the type argument is a
  22204. ctypes structured data type. Patch by Eryk Sun and Oren Milman.
  22205. Library
  22206. -------
  22207. - bpo-30167: Prevent site.main() exception if PYTHONSTARTUP is set. Patch by
  22208. Steve Weber.
  22209. - bpo-33812: Datetime instance d with non-None tzinfo, but with
  22210. d.tzinfo.utcoffset(d) returning None is now treated as naive by the
  22211. astimezone() method.
  22212. - bpo-30805: Avoid race condition with debug logging
  22213. - bpo-33767: The concatenation (``+``) and repetition (``*``) sequence
  22214. operations now raise :exc:`TypeError` instead of :exc:`SystemError` when
  22215. performed on :class:`mmap.mmap` objects. Patch by Zackery Spytz.
  22216. - bpo-32684: Fix gather to propagate cancellation of itself even with
  22217. return_exceptions.
  22218. - bpo-33674: Fix a race condition in SSLProtocol.connection_made() of
  22219. asyncio.sslproto: start immediately the handshake instead of using
  22220. call_soon(). Previously, data_received() could be called before the
  22221. handshake started, causing the handshake to hang or fail.
  22222. - bpo-31647: Fixed bug where calling write_eof() on a
  22223. _SelectorSocketTransport after it's already closed raises AttributeError.
  22224. - bpo-33672: Fix Task.__repr__ crash with Cython's bogus coroutines
  22225. - bpo-33469: Fix RuntimeError after closing loop that used run_in_executor
  22226. - bpo-11874: Use a better regex when breaking usage into wrappable parts.
  22227. Avoids bogus assertion errors from custom metavar strings.
  22228. - bpo-30877: Fixed a bug in the Python implementation of the JSON decoder
  22229. that prevented the cache of parsed strings from clearing after finishing
  22230. the decoding. Based on patch by c-fos.
  22231. - bpo-33548: tempfile._candidate_tempdir_list should consider common TEMP
  22232. locations
  22233. - bpo-33542: Prevent ``uuid.get_node`` from using a DUID instead of a MAC on
  22234. Windows. Patch by Zvi Effron
  22235. - bpo-26819: Fix race condition with ``ReadTransport.resume_reading`` in
  22236. Windows proactor event loop.
  22237. - bpo-28556: Minor fixes in typing module: add annotations to
  22238. ``NamedTuple.__new__``, pass ``*args`` and ``**kwds`` in
  22239. ``Generic.__new__``. Original PRs by Paulius Šarka and Chad Dombrova.
  22240. - bpo-20087: Updated alias mapping with glibc 2.27 supported locales.
  22241. - bpo-33422: Fix trailing quotation marks getting deleted when looking up
  22242. byte/string literals on pydoc. Patch by Andrés Delfino.
  22243. - bpo-33197: Update error message when constructing invalid
  22244. inspect.Parameters Patch by Donghee Na.
  22245. - bpo-33383: Fixed crash in the get() method of the :mod:`dbm.ndbm` database
  22246. object when it is called with a single argument.
  22247. - bpo-33329: Fix multiprocessing regression on newer glibcs
  22248. - bpo-991266: Fix quoting of the ``Comment`` attribute of
  22249. :class:`http.cookies.SimpleCookie`.
  22250. - bpo-33131: Upgrade bundled version of pip to 10.0.1.
  22251. - bpo-33308: Fixed a crash in the :mod:`parser` module when converting an ST
  22252. object to a tree of tuples or lists with ``line_info=False`` and
  22253. ``col_info=True``.
  22254. - bpo-33263: Fix FD leak in ``_SelectorSocketTransport`` Patch by Vlad
  22255. Starostin.
  22256. - bpo-33256: Fix display of ``<module>`` call in the html produced by
  22257. ``cgitb.html()``. Patch by Stéphane Blondon.
  22258. - bpo-33203: ``random.Random.choice()`` now raises ``IndexError`` for empty
  22259. sequences consistently even when called from subclasses without a
  22260. ``getrandbits()`` implementation.
  22261. - bpo-33224: Update difflib.mdiff() for :pep:`479`. Convert an uncaught
  22262. StopIteration in a generator into a return-statement.
  22263. - bpo-33209: End framing at the end of C implementation of
  22264. :func:`pickle.Pickler.dump`.
  22265. - bpo-32861: The urllib.robotparser's ``__str__`` representation now
  22266. includes wildcard entries and the "Crawl-delay" and "Request-rate" fields.
  22267. Patch by Michael Lazar.
  22268. - bpo-33096: Allow ttk.Treeview.insert to insert iid that has a false
  22269. boolean value. Note iid=0 and iid=False would be same. Patch by Garvit
  22270. Khatri.
  22271. - bpo-33127: The ssl module now compiles with LibreSSL 2.7.1.
  22272. - bpo-33021: Release the GIL during fstat() calls, avoiding hang of all
  22273. threads when calling mmap.mmap(), os.urandom(), and random.seed(). Patch
  22274. by Nir Soffer.
  22275. - bpo-27683: Fix a regression in :mod:`ipaddress` that result of
  22276. :meth:`hosts` is empty when the network is constructed by a tuple
  22277. containing an integer mask and only 1 bit left for addresses.
  22278. - bpo-32844: Fix wrong redirection of a low descriptor (0 or 1) to stderr in
  22279. subprocess if another low descriptor is closed.
  22280. - bpo-31908: Fix output of cover files for ``trace`` module command-line
  22281. tool. Previously emitted cover files only when ``--missing`` option was
  22282. used. Patch by Michael Selik.
  22283. - bpo-31457: If nested log adapters are used, the inner ``process()``
  22284. methods are no longer omitted.
  22285. - bpo-16865: Support arrays >=2GiB in :mod:`ctypes`. Patch by Segev Finer.
  22286. - bpo-31238: pydoc: the stop() method of the private ServerThread class now
  22287. waits until DocServer.serve_until_quit() completes and then explicitly
  22288. sets its docserver attribute to None to break a reference cycle.
  22289. Documentation
  22290. -------------
  22291. - bpo-33503: Fix broken pypi link
  22292. - bpo-33421: Add missing documentation for ``typing.AsyncContextManager``.
  22293. - bpo-33378: Add Korean language switcher for https://docs.python.org/3/
  22294. - bpo-33276: Clarify that the ``__path__`` attribute on modules cannot be
  22295. just any value.
  22296. - bpo-33201: Modernize documentation for writing C extension types.
  22297. - bpo-33195: Deprecate ``Py_UNICODE`` usage in ``c-api/arg`` document.
  22298. ``Py_UNICODE`` related APIs are deprecated since Python 3.3, but it is
  22299. missed in the document.
  22300. - bpo-33126: Document PyBuffer_ToContiguous().
  22301. - bpo-27212: Modify documentation for the :func:`islice` recipe to consume
  22302. initial values up to the start index.
  22303. - bpo-28247: Update :mod:`zipapp` documentation to describe how to make
  22304. standalone applications.
  22305. - bpo-18802: Documentation changes for ipaddress. Patch by Jon Foster and
  22306. Berker Peksag.
  22307. - bpo-27428: Update documentation to clarify that ``WindowsRegistryFinder``
  22308. implements ``MetaPathFinder``. (Patch by Himanshu Lakhara)
  22309. - bpo-8243: Add a note about curses.addch and curses.addstr exception
  22310. behavior when writing outside a window, or pad.
  22311. - bpo-31432: Clarify meaning of CERT_NONE, CERT_OPTIONAL, and CERT_REQUIRED
  22312. flags for ssl.SSLContext.verify_mode.
  22313. Tests
  22314. -----
  22315. - bpo-33655: Ignore test_posix_fallocate failures on BSD platforms that
  22316. might be due to running on ZFS.
  22317. - bpo-19417: Add test_bdb.py.
  22318. Build
  22319. -----
  22320. - bpo-5755: Move ``-Wstrict-prototypes`` option to ``CFLAGS_NODIST`` from
  22321. ``OPT``. This option emitted annoying warnings when building extension
  22322. modules written in C++.
  22323. - bpo-33614: Ensures module definition files for the stable ABI on Windows
  22324. are correctly regenerated.
  22325. - bpo-33522: Enable CI builds on Visual Studio Team Services at
  22326. https://python.visualstudio.com/cpython
  22327. - bpo-33012: Add ``-Wno-cast-function-type`` for gcc 8 for silencing
  22328. warnings about function casts like casting to PyCFunction in method
  22329. definition lists.
  22330. - bpo-33394: Enable the verbose build for extension modules, when GNU make
  22331. is passed macros on the command line.
  22332. Windows
  22333. -------
  22334. - bpo-33184: Update Windows installer to OpenSSL 1.0.2o.
  22335. macOS
  22336. -----
  22337. - bpo-33184: Update macOS installer build to use OpenSSL 1.0.2o.
  22338. IDLE
  22339. ----
  22340. - bpo-33656: On Windows, add API call saying that tk scales for DPI. On
  22341. Windows 8.1+ or 10, with DPI compatibility properties of the Python binary
  22342. unchanged, and a monitor resolution greater than 96 DPI, this should make
  22343. text and lines sharper. It should otherwise have no effect.
  22344. - bpo-33768: Clicking on a context line moves that line to the top of the
  22345. editor window.
  22346. - bpo-33763: IDLE: Use read-only text widget for code context instead of
  22347. label widget.
  22348. - bpo-33664: Scroll IDLE editor text by lines. Previously, the mouse wheel
  22349. and scrollbar slider moved text by a fixed number of pixels, resulting in
  22350. partial lines at the top of the editor box. The change also applies to
  22351. the shell and grep output windows, but not to read-only text views.
  22352. - bpo-33679: Enable theme-specific color configuration for Code Context. Use
  22353. the Highlights tab to see the setting for built-in themes or add settings
  22354. to custom themes.
  22355. - bpo-33642: Display up to maxlines non-blank lines for Code Context. If
  22356. there is no current context, show a single blank line.
  22357. - bpo-33628: IDLE: Cleanup codecontext.py and its test.
  22358. - bpo-33564: IDLE's code context now recognizes async as a block opener.
  22359. - bpo-29706: IDLE now colors async and await as keywords in 3.6. They become
  22360. full keywords in 3.7.
  22361. - bpo-21474: Update word/identifier definition from ascii to unicode. In
  22362. text and entry boxes, this affects selection by double-click, movement
  22363. left/right by control-left/right, and deletion left/right by
  22364. control-BACKSPACE/DEL.
  22365. - bpo-33204: IDLE: consistently color invalid string prefixes. A 'u' string
  22366. prefix cannot be paired with either 'r' or 'f'. Consistently color as much
  22367. of the prefix, starting at the right, as is valid. Revise and extend
  22368. colorizer test.
  22369. - bpo-32831: Add docstrings and tests for codecontext.
  22370. Tools/Demos
  22371. -----------
  22372. - bpo-33189: :program:`pygettext.py` now recognizes only literal strings as
  22373. docstrings and translatable strings, and rejects bytes literals and
  22374. f-string expressions.
  22375. - bpo-31920: Fixed handling directories as arguments in the ``pygettext``
  22376. script. Based on patch by Oleg Krasnikov.
  22377. - bpo-29673: Fix pystackv and pystack gdbinit macros.
  22378. - bpo-32885: Add an ``-n`` flag for ``Tools/scripts/pathfix.py`` to disable
  22379. automatic backup creation (files with ``~`` suffix).
  22380. - bpo-31583: Fix 2to3 for using with --add-suffix option but without
  22381. --output-dir option for relative path to files in current directory.
  22382. C API
  22383. -----
  22384. - bpo-32374: Document that m_traverse for multi-phase initialized modules
  22385. can be called with m_state=NULL, and add a sanity check
  22386. What's New in Python 3.6.5 final?
  22387. =================================
  22388. *Release date: 2018-03-28*
  22389. Tests
  22390. -----
  22391. - bpo-32872: Avoid regrtest compatibility issue with namespace packages.
  22392. Build
  22393. -----
  22394. - bpo-33163: Upgrade pip to 9.0.3 and setuptools to v39.0.1.
  22395. What's New in Python 3.6.5 release candidate 1?
  22396. ===============================================
  22397. *Release date: 2018-03-13*
  22398. Security
  22399. --------
  22400. - bpo-33001: Minimal fix to prevent buffer overrun in os.symlink on Windows
  22401. - bpo-32981: Regexes in difflib and poplib were vulnerable to catastrophic
  22402. backtracking. These regexes formed potential DOS vectors (REDOS). They
  22403. have been refactored. This resolves CVE-2018-1060 and CVE-2018-1061. Patch
  22404. by Jamie Davis.
  22405. Core and Builtins
  22406. -----------------
  22407. - bpo-33026: Fixed jumping out of "with" block by setting f_lineno.
  22408. - bpo-17288: Prevent jumps from 'return' and 'exception' trace events.
  22409. - bpo-32889: Update Valgrind suppression list to account for the rename of
  22410. ``Py_ADDRESS_IN_RANG`` to ``address_in_range``.
  22411. - bpo-32650: Pdb and other debuggers dependent on bdb.py will correctly step
  22412. over (next command) native coroutines. Patch by Pablo Galindo.
  22413. - bpo-32685: Improve suggestion when the Python 2 form of print statement is
  22414. either present on the same line as the header of a compound statement or
  22415. else terminated by a semi-colon instead of a newline. Patch by Nitish
  22416. Chandra.
  22417. - bpo-32583: Fix possible crashing in builtin Unicode decoders caused by
  22418. write out-of-bound errors when using customized decode error handlers.
  22419. - bpo-26163: Improved frozenset() hash to create more distinct hash values
  22420. when faced with datasets containing many similar values.
  22421. - bpo-27169: The ``__debug__`` constant is now optimized out at compile
  22422. time. This fixes also bpo-22091.
  22423. - bpo-32329: ``sys.flags.hash_randomization`` is now properly set to 0 when
  22424. hash randomization is turned off by ``PYTHONHASHSEED=0``.
  22425. - bpo-30416: The optimizer is now protected from spending much time doing
  22426. complex calculations and consuming much memory for creating large
  22427. constants in constant folding.
  22428. - bpo-18533: ``repr()`` on a dict containing its own ``values()`` or
  22429. ``items()`` no longer raises ``RecursionError``; OrderedDict similarly.
  22430. Instead, use ``...``, as for other recursive structures. Patch by Ben
  22431. North.
  22432. - bpo-32028: Leading whitespace is now correctly ignored when generating
  22433. suggestions for converting Py2 print statements to Py3 builtin print
  22434. function calls. Patch by Sanyam Khurana.
  22435. - bpo-32137: The repr of deeply nested dict now raises a RecursionError
  22436. instead of crashing due to a stack overflow.
  22437. Library
  22438. -------
  22439. - bpo-33064: lib2to3 now properly supports trailing commas after ``*args``
  22440. and ``**kwargs`` in function signatures.
  22441. - bpo-31804: Avoid failing in multiprocessing.Process if the standard
  22442. streams are closed or None at exit.
  22443. - bpo-33037: Skip sending/receiving data after SSL transport closing.
  22444. - bpo-30353: Fix ctypes pass-by-value for structs on 64-bit Cygwin/MinGW.
  22445. - bpo-33009: Fix inspect.signature() for single-parameter partialmethods.
  22446. - bpo-32969: Expose several missing constants in zlib and fix corresponding
  22447. documentation.
  22448. - bpo-32713: Fixed tarfile.itn handling of out-of-bounds float values. Patch
  22449. by Joffrey Fuhrer.
  22450. - bpo-30622: The ssl module now detects missing NPN support in LibreSSL.
  22451. - bpo-32922: dbm.open() now encodes filename with the filesystem encoding
  22452. rather than default encoding.
  22453. - bpo-32859: In ``os.dup2``, don't check every call whether the ``dup3``
  22454. syscall exists or not.
  22455. - bpo-21060: Rewrite confusing message from setup.py upload from "No dist
  22456. file created in earlier command" to the more helpful "Must create and
  22457. upload files in one command".
  22458. - bpo-32857: In :mod:`tkinter`, ``after_cancel(None)`` now raises a
  22459. :exc:`ValueError` instead of canceling the first scheduled function.
  22460. Patch by Cheryl Sabella.
  22461. - bpo-32852: Make sure sys.argv remains as a list when running trace.
  22462. - bpo-32841: Fixed ``asyncio.Condition`` issue which silently ignored
  22463. cancellation after notifying and cancelling a conditional lock. Patch by
  22464. Bar Harel.
  22465. - bpo-31787: Fixed refleaks of ``__init__()`` methods in various modules.
  22466. (Contributed by Oren Milman)
  22467. - bpo-30157: Fixed guessing quote and delimiter in csv.Sniffer.sniff() when
  22468. only the last field is quoted. Patch by Jake Davis.
  22469. - bpo-32394: socket: Remove TCP_FASTOPEN, TCP_KEEPCNT flags on older version
  22470. Windows during run-time.
  22471. - bpo-32777: Fix a rare but potential pre-exec child process deadlock in
  22472. subprocess on POSIX systems when marking file descriptors inheritable on
  22473. exec in the child process. This bug appears to have been introduced in
  22474. 3.4.
  22475. - bpo-32647: The ctypes module used to depend on indirect linking for
  22476. dlopen. The shared extension is now explicitly linked against libdl on
  22477. platforms with dl.
  22478. - bpo-32734: Fixed ``asyncio.Lock()`` safety issue which allowed acquiring
  22479. and locking the same lock multiple times, without it being free. Patch by
  22480. Bar Harel.
  22481. - bpo-32727: Do not include name field in SMTP envelope from address. Patch
  22482. by Stéphane Wirtel
  22483. - bpo-27931: Fix email address header parsing error when the username is an
  22484. empty quoted string. Patch by Xiang Zhang.
  22485. - bpo-32304: distutils' upload command no longer corrupts tar files ending
  22486. with a CR byte, and no longer tries to convert CR to CRLF in any of the
  22487. upload text fields.
  22488. - bpo-32502: uuid.uuid1 no longer raises an exception if a 64-bit hardware
  22489. address is encountered.
  22490. - bpo-31848: Fix the error handling in Aifc_read.initfp() when the SSND
  22491. chunk is not found. Patch by Zackery Spytz.
  22492. - bpo-32555: On FreeBSD and Solaris, os.strerror() now always decode the
  22493. byte string from the current locale encoding, rather than using
  22494. ASCII/surrogateescape in some cases.
  22495. - bpo-32521: The nis module is now compatible with new libnsl and headers
  22496. location.
  22497. - bpo-32473: Improve ABCMeta._dump_registry() output readability
  22498. - bpo-32521: glibc has removed Sun RPC. Use replacement libtirpc headers and
  22499. library in nis module.
  22500. - bpo-32228: Ensure that ``truncate()`` preserves the file position (as
  22501. reported by ``tell()``) after writes longer than the buffer size.
  22502. - bpo-26133: Don't unsubscribe signals in asyncio UNIX event loop on
  22503. interpreter shutdown.
  22504. - bpo-32185: The SSL module no longer sends IP addresses in SNI TLS
  22505. extension on platforms with OpenSSL 1.0.2+ or inet_pton.
  22506. - bpo-32323: :func:`urllib.parse.urlsplit()` does not convert zone-id
  22507. (scope) to lower case for scoped IPv6 addresses in hostnames now.
  22508. - bpo-32302: Fix bdist_wininst of distutils for CRT v142: it binary
  22509. compatible with CRT v140.
  22510. - bpo-32255: A single empty field is now always quoted when written into a
  22511. CSV file. This allows to distinguish an empty row from a row consisting of
  22512. a single empty field. Patch by Licht Takeuchi.
  22513. - bpo-32277: Raise ``NotImplementedError`` instead of ``SystemError`` on
  22514. platforms where ``chmod(..., follow_symlinks=False)`` is not supported.
  22515. Patch by Anthony Sottile.
  22516. - bpo-32199: The getnode() ip getter now uses 'ip link' instead of 'ip link
  22517. list'.
  22518. - bpo-27456: Ensure TCP_NODELAY is set on Linux. Tests by Victor Stinner.
  22519. - bpo-31900: The :func:`locale.localeconv` function now sets temporarily the
  22520. ``LC_CTYPE`` locale to the ``LC_NUMERIC`` locale to decode
  22521. ``decimal_point`` and ``thousands_sep`` byte strings if they are non-ASCII
  22522. or longer than 1 byte, and the ``LC_NUMERIC`` locale is different than the
  22523. ``LC_CTYPE`` locale. This temporary change affects other threads. Same
  22524. change for the :meth:`str.format` method when formatting a number
  22525. (:class:`int`, :class:`float`, :class:`float` and subclasses) with the
  22526. ``n`` type (ex: ``'{:n}'.format(1234)``).
  22527. - bpo-31802: Importing native path module (``posixpath``, ``ntpath``) now
  22528. works even if the ``os`` module still is not imported.
  22529. Documentation
  22530. -------------
  22531. - bpo-17232: Clarify docs for -O and -OO. Patch by Terry Reedy.
  22532. - bpo-32800: Update link to w3c doc for xml default namespaces.
  22533. - bpo-8722: Document :meth:`__getattr__` behavior when property :meth:`get`
  22534. method raises :exc:`AttributeError`.
  22535. - bpo-32614: Modify RE examples in documentation to use raw strings to
  22536. prevent :exc:`DeprecationWarning` and add text to REGEX HOWTO to highlight
  22537. the deprecation.
  22538. - bpo-31972: Improve docstrings for ``pathlib.PurePath`` subclasses.
  22539. - bpo-17799: Explain real behaviour of sys.settrace and sys.setprofile and
  22540. their C-API counterparts regarding which type of events are received in
  22541. each function. Patch by Pablo Galindo Salgado.
  22542. Tests
  22543. -----
  22544. - bpo-32517: Fix failing ``test_asyncio`` on macOS 10.12.2+ due to transport
  22545. of ``KqueueSelector`` loop was not being closed.
  22546. - bpo-32721: Fix test_hashlib to not fail if the _md5 module is not built.
  22547. - bpo-32252: Fix faulthandler_suppress_crash_report() used to prevent core
  22548. dump files when testing crashes. getrlimit() returns zero on success.
  22549. - bpo-31518: Debian Unstable has disabled TLS 1.0 and 1.1 for
  22550. SSLv23_METHOD(). Change TLS/SSL protocol of some tests to PROTOCOL_TLS or
  22551. PROTOCOL_TLSv1_2 to make them pass on Debian.
  22552. Build
  22553. -----
  22554. - bpo-32635: Fix segfault of the crypt module when libxcrypt is provided
  22555. instead of libcrypt at the system.
  22556. Windows
  22557. -------
  22558. - bpo-33016: Fix potential use of uninitialized memory in
  22559. nt._getfinalpathname
  22560. - bpo-32903: Fix a memory leak in os.chdir() on Windows if the current
  22561. directory is set to a UNC path.
  22562. - bpo-31966: Fixed WindowsConsoleIO.write() for writing empty data.
  22563. - bpo-32409: Ensures activate.bat can handle Unicode contents.
  22564. - bpo-32457: Improves handling of denormalized executable path when
  22565. launching Python.
  22566. - bpo-32370: Use the correct encoding for ipconfig output in the uuid
  22567. module. Patch by Segev Finer.
  22568. - bpo-29248: Fix :func:`os.readlink` on Windows, which was mistakenly
  22569. treating the ``PrintNameOffset`` field of the reparse data buffer as a
  22570. number of characters instead of bytes. Patch by Craig Holmquist and SSE4.
  22571. - bpo-32588: Create standalone _distutils_findvs module.
  22572. macOS
  22573. -----
  22574. - bpo-32726: Provide an additional, more modern macOS installer variant that
  22575. supports macOS 10.9+ systems in 64-bit mode only. Upgrade the supplied
  22576. third-party libraries to OpenSSL 1.0.2n, XZ 5.2.3, and SQLite 3.22.0. The
  22577. 10.9+ installer now links with and supplies its own copy of Tcl/Tk 8.6.8.
  22578. IDLE
  22579. ----
  22580. - bpo-32984: Set ``__file__`` while running a startup file. Like Python,
  22581. IDLE optionally runs one startup file in the Shell window before
  22582. presenting the first interactive input prompt. For IDLE, ``-s`` runs a
  22583. file named in environmental variable :envvar:`IDLESTARTUP` or
  22584. :envvar:`PYTHONSTARTUP`; ``-r file`` runs ``file``. Python sets
  22585. ``__file__`` to the startup file name before running the file and unsets
  22586. it before the first prompt. IDLE now does the same when run normally,
  22587. without the ``-n`` option.
  22588. - bpo-32940: Simplify and rename StringTranslatePseudoMapping in pyparse.
  22589. - bpo-32916: Change ``str`` to ``code`` in pyparse.
  22590. - bpo-32905: Remove unused code in pyparse module.
  22591. - bpo-32874: Add tests for pyparse.
  22592. - bpo-32837: Using the system and place-dependent default encoding for
  22593. open() is a bad idea for IDLE's system and location-independent files.
  22594. - bpo-32826: Add "encoding=utf-8" to open() in IDLE's test_help_about. GUI
  22595. test test_file_buttons() only looks at initial ascii-only lines, but
  22596. failed on systems where open() defaults to 'ascii' because readline()
  22597. internally reads and decodes far enough ahead to encounter a non-ascii
  22598. character in CREDITS.txt.
  22599. - bpo-32765: Update configdialog General tab docstring to add new widgets to
  22600. the widget list.
  22601. Tools/Demos
  22602. -----------
  22603. - bpo-24960: 2to3 and lib2to3 can now read pickled grammar files using
  22604. pkgutil.get_data() rather than probing the filesystem. This lets 2to3 and
  22605. lib2to3 work when run from a zipfile.
  22606. - bpo-32222: Fix pygettext not extracting docstrings for functions with type
  22607. annotated arguments. Patch by Toby Harradine.
  22608. C API
  22609. -----
  22610. - bpo-29084: Undocumented C API for OrderedDict has been excluded from the
  22611. limited C API. It was added by mistake and actually never worked in the
  22612. limited C API.
  22613. What's New in Python 3.6.4 final?
  22614. =================================
  22615. *Release date: 2017-12-18*
  22616. There were no new code changes in version 3.6.4 since v3.6.4rc1.
  22617. What's New in Python 3.6.4 release candidate 1?
  22618. ===============================================
  22619. *Release date: 2017-12-05*
  22620. Core and Builtins
  22621. -----------------
  22622. - bpo-32176: co_flags.CO_NOFREE is now always set correctly by the code
  22623. object constructor based on freevars and cellvars, rather than needing to
  22624. be set correctly by the caller. This ensures it will be cleared
  22625. automatically when additional cell references are injected into a modified
  22626. code object and function.
  22627. - bpo-31949: Fixed several issues in printing tracebacks
  22628. (PyTraceBack_Print()). Setting sys.tracebacklimit to 0 or less now
  22629. suppresses printing tracebacks. Setting sys.tracebacklimit to None now
  22630. causes using the default limit. Setting sys.tracebacklimit to an integer
  22631. larger than LONG_MAX now means using the limit LONG_MAX rather than the
  22632. default limit. Fixed integer overflows in the case of more than ``2**31``
  22633. traceback items on Windows. Fixed output errors handling.
  22634. - bpo-30696: Fix the interactive interpreter looping endlessly when no
  22635. memory.
  22636. - bpo-20047: Bytearray methods partition() and rpartition() now accept only
  22637. bytes-like objects as separator, as documented. In particular they now
  22638. raise TypeError rather of returning a bogus result when an integer is
  22639. passed as a separator.
  22640. - bpo-31852: Fix a segmentation fault caused by a combination of the async
  22641. soft keyword and continuation lines.
  22642. - bpo-21720: BytesWarning no longer emitted when the *fromlist* argument of
  22643. ``__import__()`` or the ``__all__`` attribute of the module contain bytes
  22644. instances.
  22645. - bpo-31825: Fixed OverflowError in the 'unicode-escape' codec and in
  22646. codecs.escape_decode() when decode an escaped non-ascii byte.
  22647. - bpo-28603: Print the full context/cause chain of exceptions on interpreter
  22648. exit, even if an exception in the chain is unhashable or compares equal to
  22649. later ones. Patch by Zane Bitter.
  22650. - bpo-31786: Fix timeout rounding in the select module to round correctly
  22651. negative timeouts between -1.0 and 0.0. The functions now block waiting
  22652. for events as expected. Previously, the call was incorrectly non-blocking.
  22653. Patch by Pablo Galindo.
  22654. - bpo-31642: Restored blocking "from package import module" by setting
  22655. sys.modules["package.module"] to None.
  22656. - bpo-31626: Fixed a bug in debug memory allocator. There was a write to
  22657. freed memory after shrinking a memory block.
  22658. - bpo-31619: Fixed a ValueError when convert a string with large number of
  22659. underscores to integer with binary base.
  22660. - bpo-31592: Fixed an assertion failure in Python parser in case of a bad
  22661. ``unicodedata.normalize()``. Patch by Oren Milman.
  22662. - bpo-31588: Raise a ``TypeError`` with a helpful error message when class
  22663. creation fails due to a metaclass with a bad ``__prepare__()`` method.
  22664. Patch by Oren Milman.
  22665. - bpo-31566: Fix an assertion failure in ``_warnings.warn()`` in case of a
  22666. bad ``__name__`` global. Patch by Oren Milman.
  22667. - bpo-31505: Fix an assertion failure in ``json``, in case
  22668. ``_json.make_encoder()`` received a bad ``encoder()`` argument. Patch by
  22669. Oren Milman.
  22670. - bpo-31492: Fix assertion failures in case of failing to import from a
  22671. module with a bad ``__name__`` attribute, and in case of failing to access
  22672. an attribute of such a module. Patch by Oren Milman.
  22673. - bpo-31490: Fix an assertion failure in ``ctypes`` class definition, in
  22674. case the class has an attribute whose name is specified in ``_anonymous_``
  22675. but not in ``_fields_``. Patch by Oren Milman.
  22676. - bpo-31478: Fix an assertion failure in ``_random.Random.seed()`` in case
  22677. the argument has a bad ``__abs__()`` method. Patch by Oren Milman.
  22678. - bpo-31315: Fix an assertion failure in imp.create_dynamic(), when
  22679. spec.name is not a string. Patch by Oren Milman.
  22680. - bpo-31311: Fix a crash in the ``__setstate__()`` method of
  22681. ``ctypes._CData``, in case of a bad ``__dict__``. Patch by Oren Milman.
  22682. - bpo-31293: Fix crashes in true division and multiplication of a timedelta
  22683. object by a float with a bad as_integer_ratio() method. Patch by Oren
  22684. Milman.
  22685. - bpo-31285: Fix an assertion failure in ``warnings.warn_explicit``, when
  22686. the return value of the received loader's ``get_source()`` has a bad
  22687. ``splitlines()`` method. Patch by Oren Milman.
  22688. - bpo-30817: ``PyErr_PrintEx()`` clears now the ignored exception that may
  22689. be raised by ``_PySys_SetObjectId()``, for example when no memory.
  22690. Library
  22691. -------
  22692. - bpo-28556: Two minor fixes for ``typing`` module: allow shallow copying
  22693. instances of generic classes, improve interaction of ``__init_subclass__``
  22694. with generics. Original PRs by Ivan Levkivskyi.
  22695. - bpo-27240: The header folding algorithm for the new email policies has
  22696. been rewritten, which also fixes bpo-30788, bpo-31831, and bpo-32182. In
  22697. particular, RFC2231 folding is now done correctly.
  22698. - bpo-32186: io.FileIO.readall() and io.FileIO.read() now release the GIL
  22699. when getting the file size. Fixed hang of all threads with inaccessible
  22700. NFS server. Patch by Nir Soffer.
  22701. - bpo-12239: Make :meth:`msilib.SummaryInformation.GetProperty` return
  22702. ``None`` when the value of property is ``VT_EMPTY``. Initial patch by
  22703. Mark Mc Mahon.
  22704. - bpo-31325: Fix wrong usage of :func:`collections.namedtuple` in the
  22705. :meth:`RobotFileParser.parse() <urllib.robotparser.RobotFileParser.parse>`
  22706. method. Initial patch by Robin Wellner.
  22707. - bpo-12382: :func:`msilib.OpenDatabase` now raises a better exception
  22708. message when it couldn't open or create an MSI file. Initial patch by
  22709. William Tisäter.
  22710. - bpo-32110: ``codecs.StreamReader.read(n)`` now returns not more than *n*
  22711. characters/bytes for non-negative *n*. This makes it compatible with
  22712. ``read()`` methods of other file-like objects.
  22713. - bpo-32072: Fixed issues with binary plists: Fixed saving bytearrays.
  22714. Identical objects will be saved only once. Equal references will be load
  22715. as identical objects. Added support for saving and loading recursive data
  22716. structures.
  22717. - bpo-32034: Make asyncio.IncompleteReadError and LimitOverrunError
  22718. pickleable.
  22719. - bpo-32015: Fixed the looping of asyncio in the case of reconnection the
  22720. socket during waiting async read/write from/to the socket.
  22721. - bpo-32011: Restored support of loading marshal files with the TYPE_INT64
  22722. code. These files can be produced in Python 2.7.
  22723. - bpo-31970: Reduce performance overhead of asyncio debug mode.
  22724. - bpo-9678: Fixed determining the MAC address in the uuid module: Using
  22725. ifconfig on NetBSD and OpenBSD. Using arp on Linux, FreeBSD, NetBSD and
  22726. OpenBSD. Based on patch by Takayuki Shimizukawa.
  22727. - bpo-30057: Fix potential missed signal in signal.signal().
  22728. - bpo-31933: Fix Blake2 params leaf_size and node_offset on big endian
  22729. platforms. Patch by Jack O'Connor.
  22730. - bpo-31927: Fixed compilation of the socket module on NetBSD 8. Fixed
  22731. assertion failure or reading arbitrary data when parse a AF_BLUETOOTH
  22732. address on NetBSD and DragonFly BSD.
  22733. - bpo-27666: Fixed stack corruption in curses.box() and curses.ungetmouse()
  22734. when the size of types chtype or mmask_t is less than the size of C long.
  22735. curses.box() now accepts characters as arguments. Based on patch by Steve
  22736. Fink.
  22737. - bpo-31897: plistlib now catches more errors when read binary plists and
  22738. raises InvalidFileException instead of unexpected exceptions.
  22739. - bpo-25720: Fix the method for checking pad state of curses WINDOW. Patch
  22740. by Masayuki Yamamoto.
  22741. - bpo-31893: Fixed the layout of the kqueue_event structure on OpenBSD and
  22742. NetBSD. Fixed the comparison of the kqueue_event objects.
  22743. - bpo-31891: Fixed building the curses module on NetBSD.
  22744. - bpo-28416: Instances of pickle.Pickler subclass with the persistent_id()
  22745. method and pickle.Unpickler subclass with the persistent_load() method no
  22746. longer create reference cycles.
  22747. - bpo-28326: Fix multiprocessing.Process when stdout and/or stderr is closed
  22748. or None.
  22749. - bpo-31457: If nested log adapters are used, the inner ``process()``
  22750. methods are no longer omitted.
  22751. - bpo-31457: The ``manager`` property on LoggerAdapter objects is now
  22752. properly settable.
  22753. - bpo-31806: Fix timeout rounding in time.sleep(), threading.Lock.acquire()
  22754. and socket.socket.settimeout() to round correctly negative timeouts
  22755. between -1.0 and 0.0. The functions now block waiting for events as
  22756. expected. Previously, the call was incorrectly non-blocking. Patch by
  22757. Pablo Galindo.
  22758. - bpo-28603: traceback: Fix a TypeError that occurred during printing of
  22759. exception tracebacks when either the current exception or an exception in
  22760. its context/cause chain is unhashable. Patch by Zane Bitter.
  22761. - bpo-30058: Fixed buffer overflow in select.kqueue.control().
  22762. - bpo-31770: Prevent a crash when calling the ``__init__()`` method of a
  22763. ``sqlite3.Cursor`` object more than once. Patch by Oren Milman.
  22764. - bpo-31672: ``idpattern`` in ``string.Template`` matched some non-ASCII
  22765. characters. Now it uses ``-i`` regular expression local flag to avoid
  22766. non-ASCII characters.
  22767. - bpo-31764: Prevent a crash in ``sqlite3.Cursor.close()`` in case the
  22768. ``Cursor`` object is uninitialized. Patch by Oren Milman.
  22769. - bpo-31752: Fix possible crash in timedelta constructor called with custom
  22770. integers.
  22771. - bpo-31701: On Windows, faulthandler.enable() now ignores MSC and COM
  22772. exceptions.
  22773. - bpo-31728: Prevent crashes in ``_elementtree`` due to unsafe cleanup of
  22774. ``Element.text`` and ``Element.tail``. Patch by Oren Milman.
  22775. - bpo-31620: an empty asyncio.Queue now doesn't leak memory when queue.get
  22776. pollers timeout
  22777. - bpo-31632: Fix method set_protocol() of class _SSLProtocolTransport in
  22778. asyncio module. This method was previously modifying a wrong reference to
  22779. the protocol.
  22780. - bpo-31675: Fixed memory leaks in Tkinter's methods splitlist() and split()
  22781. when pass a string larger than 2 GiB.
  22782. - bpo-31673: Fixed typo in the name of Tkinter's method adderrorinfo().
  22783. - bpo-30806: Fix the string representation of a netrc object.
  22784. - bpo-15037: Added a workaround for getkey() in curses for ncurses 5.7 and
  22785. earlier.
  22786. - bpo-25351: Avoid venv activate failures with undefined variables
  22787. - bpo-25532: inspect.unwrap() will now only try to unwrap an object
  22788. sys.getrecursionlimit() times, to protect against objects which create a
  22789. new object on every attribute access.
  22790. - bpo-30347: Stop crashes when concurrently iterate over itertools.groupby()
  22791. iterators.
  22792. - bpo-31516: ``threading.current_thread()`` should not return a dummy thread
  22793. at shutdown.
  22794. - bpo-31351: python -m ensurepip now exits with non-zero exit code if pip
  22795. bootstrapping has failed.
  22796. - bpo-31482: ``random.seed()`` now works with bytes in version=1
  22797. - bpo-31334: Fix ``poll.poll([timeout])`` in the ``select`` module for
  22798. arbitrary negative timeouts on all OSes where it can only be a
  22799. non-negative integer or -1. Patch by Riccardo Coccioli.
  22800. - bpo-31310: multiprocessing's semaphore tracker should be launched again if
  22801. crashed.
  22802. - bpo-31308: Make multiprocessing's forkserver process immune to Ctrl-C and
  22803. other user interruptions. If it crashes, restart it when necessary.
  22804. Documentation
  22805. -------------
  22806. - bpo-32105: Added asyncio.BaseEventLoop.connect_accepted_socket
  22807. versionadded marker.
  22808. - bpo-31537: Fix incorrect usage of ``get_history_length`` in readline
  22809. documentation example code. Patch by Brad Smith.
  22810. - bpo-30085: The operator functions without double underscores are preferred
  22811. for clarity. The one with underscores are only kept for
  22812. back-compatibility.
  22813. Tests
  22814. -----
  22815. - bpo-31380: Skip test_httpservers test_undecodable_file on macOS: fails on
  22816. APFS.
  22817. - bpo-31705: Skip test_socket.test_sha256() on Linux kernel older than 4.5.
  22818. The test fails with ENOKEY on kernel 3.10 (on ppc64le). A fix was merged
  22819. into the kernel 4.5.
  22820. - bpo-31174: Fix test_tools.test_unparse: DirectoryTestCase now stores the
  22821. names sample to always test the same files. It prevents false alarms when
  22822. hunting reference leaks.
  22823. - bpo-30695: Add the ``set_nomemory(start, stop)`` and
  22824. ``remove_mem_hooks()`` functions to the ``_testcapi`` module.
  22825. Build
  22826. -----
  22827. - bpo-32059: ``detect_modules()`` in ``setup.py`` now also searches the
  22828. sysroot paths when cross-compiling.
  22829. - bpo-31957: Fixes Windows SDK version detection when building for Windows.
  22830. - bpo-31609: Fixes quotes in PCbuild/clean.bat
  22831. - bpo-31934: Abort the build when building out of a not clean source tree.
  22832. - bpo-31926: Fixed Argument Clinic sometimes causing compilation errors when
  22833. there was more than one function and/or method in a .c file with the same
  22834. name.
  22835. - bpo-28791: Update Windows builds to use SQLite 3.21.0.
  22836. - bpo-28791: Update OS X installer to use SQLite 3.21.0.
  22837. - bpo-22140: Prevent double substitution of prefix in python-config.sh.
  22838. - bpo-31536: Avoid wholesale rebuild after ``make regen-all`` if nothing
  22839. changed.
  22840. Windows
  22841. -------
  22842. - bpo-1102: Return ``None`` when ``View.Fetch()`` returns
  22843. ``ERROR_NO_MORE_ITEMS`` instead of raising ``MSIError``. Initial patch by
  22844. Anthony Tuininga.
  22845. - bpo-31944: Fixes Modify button in Apps and Features dialog.
  22846. macOS
  22847. -----
  22848. - bpo-31392: Update macOS installer to use OpenSSL 1.0.2m
  22849. IDLE
  22850. ----
  22851. - bpo-32207: Improve tk event exception tracebacks in IDLE. When tk event
  22852. handling is driven by IDLE's run loop, a confusing and distracting
  22853. queue.EMPTY traceback context is no longer added to tk event exception
  22854. tracebacks. The traceback is now the same as when event handling is
  22855. driven by user code. Patch based on a suggestion by Serhiy Storchaka.
  22856. - bpo-32164: Delete unused file idlelib/tabbedpages.py. Use of TabbedPageSet
  22857. in configdialog was replaced by ttk.Notebook.
  22858. - bpo-32100: IDLE: Fix old and new bugs in pathbrowser; improve tests. Patch
  22859. mostly by Cheryl Sabella.
  22860. - bpo-31858: IDLE -- Restrict shell prompt manipulation to the shell. Editor
  22861. and output windows only see an empty last prompt line. This simplifies
  22862. the code and fixes a minor bug when newline is inserted. Sys.ps1, if
  22863. present, is read on Shell start-up, but is not set or changed.
  22864. - bpo-31860: The font sample in the IDLE configuration dialog is now
  22865. editable. Changes persist while IDLE remains open
  22866. - bpo-31836: Test_code_module now passes if run after test_idle, which sets
  22867. ps1. The code module uses sys.ps1 if present or sets it to '>>> ' if not.
  22868. Test_code_module now properly tests both behaviors. Ditto for ps2.
  22869. - bpo-28603: Fix a TypeError that caused a shell restart when printing a
  22870. traceback that includes an exception that is unhashable. Patch by Zane
  22871. Bitter.
  22872. - bpo-13802: Use non-Latin characters in the IDLE's Font settings sample.
  22873. Even if one selects a font that defines a limited subset of the unicode
  22874. Basic Multilingual Plane, tcl/tk will use other fonts that define a
  22875. character. The expanded example give users of non-Latin characters a
  22876. better idea of what they might see in IDLE's shell and editors. To make
  22877. room for the expanded sample, frames on the Font tab are re-arranged. The
  22878. Font/Tabs help explains a bit about the additions.
  22879. - bpo-31460: Simplify the API of IDLE's Module Browser. Passing a widget
  22880. instead of an flist with a root widget opens the option of creating a
  22881. browser frame that is only part of a window. Passing a full file name
  22882. instead of pieces assumed to come from a .py file opens the possibility of
  22883. browsing python files that do not end in .py.
  22884. - bpo-31649: IDLE - Make _htest, _utest parameters keyword only.
  22885. - bpo-31559: Remove test order dependence in idle_test.test_browser.
  22886. - bpo-31459: Rename IDLE's module browser from Class Browser to Module
  22887. Browser. The original module-level class and method browser became a
  22888. module browser, with the addition of module-level functions, years ago.
  22889. Nested classes and functions were added yesterday. For
  22890. back-compatibility, the virtual event <<open-class-browser>>, which
  22891. appears on the Keys tab of the Settings dialog, is not changed. Patch by
  22892. Cheryl Sabella.
  22893. - bpo-31500: Default fonts now are scaled on HiDPI displays.
  22894. - bpo-1612262: IDLE module browser now shows nested classes and functions.
  22895. Original patches for code and tests by Guilherme Polo and Cheryl Sabella,
  22896. respectively.
  22897. Tools/Demos
  22898. -----------
  22899. - bpo-30722: Make redemo work with Python 3.6 and newer versions. Also,
  22900. remove the ``LOCALE`` option since it doesn't work with string patterns in
  22901. Python 3. Patch by Christoph Sarnowski.
  22902. C API
  22903. -----
  22904. - bpo-20891: Fix PyGILState_Ensure(). When PyGILState_Ensure() is called in
  22905. a non-Python thread before PyEval_InitThreads(), only call
  22906. PyEval_InitThreads() after calling PyThreadState_New() to fix a crash.
  22907. - bpo-31532: Fix memory corruption due to allocator mix in getpath.c between
  22908. Py_GetPath() and Py_SetPath()
  22909. - bpo-30697: The ``PyExc_RecursionErrorInst`` singleton is removed and
  22910. ``PyErr_NormalizeException()`` does not use it anymore. This singleton is
  22911. persistent and its members being never cleared may cause a segfault during
  22912. finalization of the interpreter. See also issue #22898.
  22913. What's New in Python 3.6.3 final?
  22914. =================================
  22915. *Release date: 2017-10-03*
  22916. Library
  22917. -------
  22918. - bpo-31641: Re-allow arbitrary iterables in
  22919. ``concurrent.futures.as_completed()``. Fixes regression in 3.6.3rc1.
  22920. Build
  22921. -----
  22922. - bpo-31662: Fix typos in Windows ``uploadrelease.bat`` script. Fix Windows
  22923. Doc build issues in ``Doc/make.bat``.
  22924. - bpo-31423: Fix building the PDF documentation with newer versions of
  22925. Sphinx.
  22926. What's New in Python 3.6.3 release candidate 1?
  22927. ===============================================
  22928. *Release date: 2017-09-18*
  22929. Security
  22930. --------
  22931. - bpo-29781: SSLObject.version() now correctly returns None when handshake
  22932. over BIO has not been performed yet.
  22933. - bpo-30947: Upgrade libexpat embedded copy from version 2.2.1 to 2.2.3 to
  22934. get security fixes.
  22935. Core and Builtins
  22936. -----------------
  22937. - bpo-31471: Fix an assertion failure in ``subprocess.Popen()`` on Windows,
  22938. in case the env argument has a bad ``keys()`` method. Patch by Oren
  22939. Milman.
  22940. - bpo-31418: Fix an assertion failure in ``PyErr_WriteUnraisable()`` in case
  22941. of an exception with a bad ``__module__`` attribute. Patch by Oren Milman.
  22942. - bpo-31416: Fix assertion failures in case of a bad warnings.filters or
  22943. warnings.defaultaction. Patch by Oren Milman.
  22944. - bpo-31411: Raise a TypeError instead of SystemError in case
  22945. warnings.onceregistry is not a dictionary. Patch by Oren Milman.
  22946. - bpo-31373: Fix several possible instances of undefined behavior due to
  22947. floating-point demotions.
  22948. - bpo-30465: Location information (``lineno`` and ``col_offset``) in
  22949. f-strings is now (mostly) correct. This fixes tools like flake8 from
  22950. showing warnings on the wrong line (typically the first line of the file).
  22951. - bpo-31343: Include sys/sysmacros.h for major(), minor(), and makedev().
  22952. GNU C libray plans to remove the functions from sys/types.h.
  22953. - bpo-31291: Fix an assertion failure in ``zipimport.zipimporter.get_data``
  22954. on Windows, when the return value of ``pathname.replace('/','\\')`` isn't
  22955. a string. Patch by Oren Milman.
  22956. - bpo-31271: Fix an assertion failure in the ``write()`` method of
  22957. ``io.TextIOWrapper``, when the encoder doesn't return a bytes object.
  22958. Patch by Oren Milman.
  22959. - bpo-31243: Fix a crash in some methods of ``io.TextIOWrapper``, when the
  22960. decoder's state is invalid. Patch by Oren Milman.
  22961. - bpo-30721: ``print`` now shows correct usage hint for using Python 2
  22962. redirection syntax. Patch by Sanyam Khurana.
  22963. - bpo-31070: Fix a race condition in importlib _get_module_lock().
  22964. - bpo-31095: Fix potential crash during GC caused by ``tp_dealloc`` which
  22965. doesn't call ``PyObject_GC_UnTrack()``.
  22966. - bpo-31071: Avoid masking original TypeError in call with * unpacking when
  22967. other arguments are passed.
  22968. - bpo-30978: str.format_map() now passes key lookup exceptions through.
  22969. Previously any exception was replaced with a KeyError exception.
  22970. - bpo-30808: Use _Py_atomic API for concurrency-sensitive signal state.
  22971. - bpo-30876: Relative import from unloaded package now reimports the package
  22972. instead of failing with SystemError. Relative import from non-package now
  22973. fails with ImportError rather than SystemError.
  22974. - bpo-30703: Improve signal delivery. Avoid using Py_AddPendingCall from
  22975. signal handler, to avoid calling signal-unsafe functions. The tests I'm
  22976. adding here fail without the rest of the patch, on Linux and OS X. This
  22977. means our signal delivery logic had defects (some signals could be lost).
  22978. - bpo-30765: Avoid blocking in pthread_mutex_lock() when
  22979. PyThread_acquire_lock() is asked not to block.
  22980. - bpo-31161: Make sure the 'Missing parentheses' syntax error message is
  22981. only applied to SyntaxError, not to subclasses. Patch by Martijn Pieters.
  22982. - bpo-30814: Fixed a race condition when import a submodule from a package.
  22983. - bpo-30597: ``print`` now shows expected input in custom error message when
  22984. used as a Python 2 statement. Patch by Sanyam Khurana.
  22985. Library
  22986. -------
  22987. - bpo-31499: xml.etree: Fix a crash when a parser is part of a reference
  22988. cycle.
  22989. - bpo-28556: typing.get_type_hints now finds the right globalns for classes
  22990. and modules by default (when no ``globalns`` was specified by the caller).
  22991. - bpo-28556: Speed improvements to the ``typing`` module. Original PRs by
  22992. Ivan Levkivskyi and Mitar.
  22993. - bpo-31544: The C accelerator module of ElementTree ignored exceptions
  22994. raised when looking up TreeBuilder target methods in XMLParser().
  22995. - bpo-31234: socket.create_connection() now fixes manually a reference
  22996. cycle: clear the variable storing the last exception on success.
  22997. - bpo-31457: LoggerAdapter objects can now be nested.
  22998. - bpo-31400: Improves SSL error handling to avoid losing error numbers.
  22999. - bpo-28958: ssl.SSLContext() now uses OpenSSL error information when a
  23000. context cannot be instantiated.
  23001. - bpo-27340: SSLSocket.sendall() now uses memoryview to create slices of
  23002. data. This fixes support for all bytes-like object. It is also more
  23003. efficient and avoids costly copies.
  23004. - bpo-31178: Fix string concatenation bug in rare error path in the
  23005. subprocess module
  23006. - bpo-31350: Micro-optimize :func:`asyncio._get_running_loop` to become up
  23007. to 10% faster.
  23008. - bpo-31170: expat: Update libexpat from 2.2.3 to 2.2.4. Fix copying of
  23009. partial characters for UTF-8 input (libexpat bug 115):
  23010. https://github.com/libexpat/libexpat/issues/115
  23011. - bpo-29136: Add TLS 1.3 cipher suites and OP_NO_TLSv1_3.
  23012. - bpo-29212: Fix concurrent.futures.thread.ThreadPoolExecutor threads to
  23013. have a non repr() based thread name by default when no thread_name_prefix
  23014. is supplied. They will now identify themselves as
  23015. "ThreadPoolExecutor-y_n".
  23016. - bpo-9146: Fix a segmentation fault in _hashopenssl when standard hash
  23017. functions such as md5 are not available in the linked OpenSSL library. As
  23018. in some special FIPS-140 build environments.
  23019. - bpo-27144: The ``map()`` and ``as_completed()`` iterators in
  23020. ``concurrent.futures`` now avoid keeping a reference to yielded objects.
  23021. - bpo-10746: Fix ctypes producing wrong :pep:`3118` type codes for integer
  23022. types.
  23023. - bpo-22536: The subprocess module now sets the filename when
  23024. FileNotFoundError is raised on POSIX systems due to the executable or cwd
  23025. not being found.
  23026. - bpo-31249: concurrent.futures: WorkItem.run() used by ThreadPoolExecutor
  23027. now breaks a reference cycle between an exception object and the WorkItem
  23028. object.
  23029. - bpo-31247: xmlrpc.server now explicitly breaks reference cycles when using
  23030. sys.exc_info() in code handling exceptions.
  23031. - bpo-30102: The ssl and hashlib modules now call
  23032. OPENSSL_add_all_algorithms_noconf() on OpenSSL < 1.1.0. The function
  23033. detects CPU features and enables optimizations on some CPU architectures
  23034. such as POWER8. Patch is based on research from Gustavo Serra Scalet.
  23035. - bpo-31185: Fixed miscellaneous errors in asyncio speedup module.
  23036. - bpo-31135: ttk: fix the destroy() method of LabeledScale and OptionMenu
  23037. classes. Call the parent destroy() method even if the used attribute
  23038. doesn't exist. The LabeledScale.destroy() method now also explicitly
  23039. clears label and scale attributes to help the garbage collector to destroy
  23040. all widgets.
  23041. - bpo-31107: Fix ``copyreg._slotnames()`` mangled attribute calculation for
  23042. classes whose name begins with an underscore. Patch by Shane Harvey.
  23043. - bpo-31061: Fixed a crash when using asyncio and threads.
  23044. - bpo-30502: Fix handling of long oids in ssl. Based on patch by Christian
  23045. Heimes.
  23046. - bpo-30119: ftplib.FTP.putline() now throws ValueError on commands that
  23047. contains CR or LF. Patch by Donghee Na.
  23048. - bpo-30595: multiprocessing.Queue.get() with a timeout now polls its reader
  23049. in non-blocking mode if it succeeded to acquire the lock but the acquire
  23050. took longer than the timeout.
  23051. - bpo-29403: Fix ``unittest.mock``'s autospec to not fail on method-bound
  23052. builtin functions. Patch by Aaron Gallagher.
  23053. - bpo-30961: Fix decrementing a borrowed reference in tracemalloc.
  23054. - bpo-25684: Change ``ttk.OptionMenu`` radiobuttons to be unique across
  23055. instances of ``OptionMenu``.
  23056. - bpo-30886: Fix multiprocessing.Queue.join_thread(): it now waits until the
  23057. thread completes, even if the thread was started by the same process which
  23058. created the queue.
  23059. - bpo-29854: Fix segfault in readline when using readline's history-size
  23060. option. Patch by Nir Soffer.
  23061. - bpo-30319: socket.close() now ignores ECONNRESET error.
  23062. - bpo-30828: Fix out of bounds write in
  23063. ``asyncio.CFuture.remove_done_callback()``.
  23064. - bpo-30807: signal.setitimer() may disable the timer when passed a tiny
  23065. value. Tiny values (such as 1e-6) are valid non-zero values for
  23066. setitimer(), which is specified as taking microsecond-resolution
  23067. intervals. However, on some platform, our conversion routine could convert
  23068. 1e-6 into a zero interval, therefore disabling the timer instead of
  23069. (re-)scheduling it.
  23070. - bpo-30441: Fix bug when modifying os.environ while iterating over it
  23071. - bpo-30532: Fix email header value parser dropping folding white space in
  23072. certain cases.
  23073. - bpo-30879: os.listdir() and os.scandir() now emit bytes names when called
  23074. with bytes-like argument.
  23075. - bpo-30746: Prohibited the '=' character in environment variable names in
  23076. ``os.putenv()`` and ``os.spawn*()``.
  23077. - bpo-29755: Fixed the lgettext() family of functions in the gettext module.
  23078. They now always return bytes.
  23079. Documentation
  23080. -------------
  23081. - bpo-31294: Fix incomplete code snippet in the ZeroMQSocketListener and
  23082. ZeroMQSocketHandler examples and adapt them to Python 3.
  23083. - bpo-21649: Add RFC 7525 and Mozilla server side TLS links to SSL
  23084. documentation.
  23085. - bpo-30803: Clarify doc on truth value testing. Original patch by Peter
  23086. Thomassen.
  23087. Tests
  23088. -----
  23089. - bpo-31320: Silence traceback in test_ssl
  23090. - bpo-25674: Remove sha256.tbs-internet.com ssl test
  23091. - bpo-30715: Address ALPN callback changes for OpenSSL 1.1.0f. The latest
  23092. version behaves like OpenSSL 1.0.2 and no longer aborts handshake.
  23093. - bpo-30822: regrtest: Exclude tzdata from regrtest --all. When running the
  23094. test suite using --use=all / -u all, exclude tzdata since it makes
  23095. test_datetime too slow (15-20 min on some buildbots) which then times out
  23096. on some buildbots. Fix also regrtest command line parser to allow passing
  23097. -u extralargefile to run test_zipfile64.
  23098. Build
  23099. -----
  23100. - bpo-30854: Fix compile error when compiling --without-threads. Patch by
  23101. Masayuki Yamamoto.
  23102. Windows
  23103. -------
  23104. - bpo-30389: Adds detection of Visual Studio 2017 to distutils on Windows.
  23105. - bpo-31340: Change to building with MSVC v141 (included with Visual Studio
  23106. 2017)
  23107. - bpo-30581: os.cpu_count() now returns the correct number of processors on
  23108. Windows when the number of logical processors is greater than 64.
  23109. - bpo-30731: Add a missing xmlns to python.manifest so that it matches the
  23110. schema.
  23111. IDLE
  23112. ----
  23113. - bpo-31493: IDLE code context -- fix code update and font update timers.
  23114. Canceling timers prevents a warning message when test_idle completes.
  23115. - bpo-31488: IDLE - Update non-key options in former extension classes. When
  23116. applying configdialog changes, call .reload for each feature class. Change
  23117. ParenMatch so updated options affect existing instances attached to
  23118. existing editor windows.
  23119. - bpo-31477: IDLE - Improve rstrip entry in doc. Strip trailing whitespace
  23120. strips more than blank spaces. Multiline string literals are not skipped.
  23121. - bpo-31480: IDLE - make tests pass with zzdummy extension disabled by
  23122. default.
  23123. - bpo-31421: Document how IDLE runs tkinter programs. IDLE calls tcl/tk
  23124. update in the background in order to make live interaction and
  23125. experimentation with tkinter applications much easier.
  23126. - bpo-31414: IDLE -- fix tk entry box tests by deleting first. Adding to an
  23127. int entry is not the same as deleting and inserting because int('') will
  23128. fail.
  23129. - bpo-31051: Rearrange IDLE configdialog GenPage into Window, Editor, and
  23130. Help sections.
  23131. - bpo-30617: IDLE - Add docstrings and tests for outwin subclass of editor.
  23132. Move some data and functions from the class to module level. Patch by
  23133. Cheryl Sabella.
  23134. - bpo-31287: IDLE - Do not modify tkinter.message in test_configdialog.
  23135. - bpo-27099: Convert IDLE's built-in 'extensions' to regular features. About
  23136. 10 IDLE features were implemented as supposedly optional extensions. Their
  23137. different behavior could be confusing or worse for users and not good for
  23138. maintenance. Hence the conversion. The main difference for users is that
  23139. user configurable key bindings for builtin features are now handled
  23140. uniformly. Now, editing a binding in a keyset only affects its value in
  23141. the keyset. All bindings are defined together in the system-specific
  23142. default keysets in config-extensions.def. All custom keysets are saved as
  23143. a whole in config-extension.cfg. All take effect as soon as one clicks
  23144. Apply or Ok. The affected events are '<<force-open-completions>>',
  23145. '<<expand-word>>', '<<force-open-calltip>>', '<<flash-paren>>',
  23146. '<<format-paragraph>>', '<<run-module>>', '<<check-module>>', and
  23147. '<<zoom-height>>'. Any (global) customizations made before 3.6.3 will not
  23148. affect their keyset-specific customization after 3.6.3. and vice versa.
  23149. Initial patch by Charles Wohlganger.
  23150. - bpo-31206: IDLE: Factor HighPage(Frame) class from ConfigDialog. Patch by
  23151. Cheryl Sabella.
  23152. - bpo-31001: Add tests for configdialog highlight tab. Patch by Cheryl
  23153. Sabella.
  23154. - bpo-31205: IDLE: Factor KeysPage(Frame) class from ConfigDialog. The
  23155. slightly modified tests continue to pass. Patch by Cheryl Sabella.
  23156. - bpo-31130: IDLE -- stop leaks in test_configdialog. Initial patch by
  23157. Victor Stinner.
  23158. - bpo-31002: Add tests for configdialog keys tab. Patch by Cheryl Sabella.
  23159. - bpo-19903: IDLE: Calltips use ``inspect.signature`` instead of
  23160. ``inspect.getfullargspec``. This improves calltips for builtins converted
  23161. to use Argument Clinic. Patch by Louie Lu.
  23162. - bpo-31083: IDLE - Add an outline of a TabPage class in configdialog.
  23163. Update existing classes to match outline. Initial patch by Cheryl Sabella.
  23164. - bpo-31050: Factor GenPage(Frame) class from ConfigDialog. The slightly
  23165. modified tests continue to pass. Patch by Cheryl Sabella.
  23166. - bpo-31004: IDLE - Factor FontPage(Frame) class from ConfigDialog. Slightly
  23167. modified tests continue to pass. Fix General tests. Patch mostly by Cheryl
  23168. Sabella.
  23169. - bpo-30781: IDLE - Use ttk widgets in ConfigDialog. Patches by Terry Jan
  23170. Reedy and Cheryl Sabella.
  23171. - bpo-31060: IDLE - Finish rearranging methods of ConfigDialog Grouping
  23172. methods pertaining to each tab and the buttons will aid writing tests and
  23173. improving the tabs and will enable splitting the groups into classes.
  23174. - bpo-30853: IDLE -- Factor a VarTrace class out of ConfigDialog. Instance
  23175. tracers manages pairs consisting of a tk variable and a callback function.
  23176. When tracing is turned on, setting the variable calls the function. Test
  23177. coverage for the new class is 100%.
  23178. - bpo-31003: IDLE: Add more tests for General tab.
  23179. - bpo-30993: IDLE - Improve configdialog font page and tests. In
  23180. configdialog: Document causal pathways in create_font_tab docstring.
  23181. Simplify some attribute names. Move set_samples calls to var_changed_font
  23182. (idea from Cheryl Sabella). Move related functions to positions after the
  23183. create widgets function. In test_configdialog: Fix test_font_set so not
  23184. order dependent. Fix renamed test_indent_scale so it tests the widget.
  23185. Adjust tests for movement of set_samples call. Add tests for load
  23186. functions. Put all font tests in one class and tab indent tests in
  23187. another. Except for two lines, these tests completely cover the related
  23188. functions.
  23189. - bpo-30981: IDLE -- Add more configdialog font page tests.
  23190. - bpo-28523: IDLE: replace 'colour' with 'color' in configdialog.
  23191. - bpo-30917: Add tests for idlelib.config.IdleConf. Increase coverage from
  23192. 46% to 96%. Patch by Louie Lu.
  23193. - bpo-30934: Document coverage details for idlelib tests. Add section to
  23194. idlelib/idle-test/README.txt. Include check that branches are taken both
  23195. ways. Exclude IDLE-specific code that does not run during unit tests.
  23196. - bpo-30913: IDLE: Document ConfigDialog tk Vars, methods, and widgets in
  23197. docstrings This will facilitate improving the dialog and splitting up the
  23198. class. Original patch by Cheryl Sabella.
  23199. - bpo-30899: IDLE: Add tests for ConfigParser subclasses in config. Patch by
  23200. Louie Lu.
  23201. - bpo-30881: IDLE: Add docstrings to browser.py. Patch by Cheryl Sabella.
  23202. - bpo-30851: IDLE: Remove unused variables in configdialog. One is a
  23203. duplicate, one is set but cannot be altered by users. Patch by Cheryl
  23204. Sabella.
  23205. - bpo-30870: IDLE: In Settings dialog, select font with Up, Down keys as
  23206. well as mouse. Initial patch by Louie Lu.
  23207. - bpo-8231: IDLE: call config.IdleConf.GetUserCfgDir only once.
  23208. - bpo-30779: IDLE: Factor ConfigChanges class from configdialog, put in
  23209. config; test. * In config, put dump test code in a function; run it and
  23210. unittest in 'if __name__ == '__main__'. * Add class config.ConfigChanges
  23211. based on changes_class_v4.py on bpo issue. * Add class
  23212. test_config.ChangesTest, partly using configdialog_tests_v1.py. * Revise
  23213. configdialog to use ConfigChanges; see tracker msg297804. * Revise
  23214. test_configdialog to match configdialog changes. * Remove configdialog
  23215. functions unused or moved to ConfigChanges. Cheryl Sabella contributed
  23216. parts of the patch.
  23217. - bpo-30777: IDLE: configdialog - Add docstrings and fix comments. Patch by
  23218. Cheryl Sabella.
  23219. - bpo-30495: IDLE: Improve textview with docstrings, PEP8 names, and more
  23220. tests. Patch by Cheryl Sabella.
  23221. - bpo-30723: IDLE: Make several improvements to parenmatch. Add 'parens'
  23222. style to highlight both opener and closer. Make 'default' style, which is
  23223. not default, a synonym for 'opener'. Make time-delay work the same with
  23224. all styles. Add help for config dialog extensions tab, including help for
  23225. parenmatch. Add new tests. Original patch by Charles Wohlganger.
  23226. - bpo-30674: IDLE: add docstrings to grep module. Patch by Cheryl Sabella
  23227. - bpo-21519: IDLE's basic custom key entry dialog now detects duplicates
  23228. properly. Original patch by Saimadhav Heblikar.
  23229. - bpo-29910: IDLE no longer deletes a character after commenting out a
  23230. region by a key shortcut. Add ``return 'break'`` for this and other
  23231. potential conflicts between IDLE and default key bindings.
  23232. - bpo-30728: Review and change idlelib.configdialog names. Lowercase method
  23233. and attribute names. Replace 'colour' with 'color', expand overly cryptic
  23234. names, delete unneeded underscores. Replace ``import *`` with specific
  23235. imports. Patches by Cheryl Sabella.
  23236. - bpo-6739: IDLE: Verify user-entered key sequences by trying to bind them
  23237. with tk. Add tests for all 3 validation functions. Original patch by G
  23238. Polo. Tests added by Cheryl Sabella.
  23239. Tools/Demos
  23240. -----------
  23241. - bpo-30983: gdb integration commands (py-bt, etc.) work on optimized shared
  23242. builds now, too. :pep:`523` introduced _PyEval_EvalFrameDefault which
  23243. inlines PyEval_EvalFrameEx on non-debug shared builds. This broke the
  23244. ability to use py-bt, py-up, and a few other Python-specific gdb
  23245. integrations. The problem is fixed by only looking for
  23246. _PyEval_EvalFrameDefault frames in python-gdb.py. Original patch by Bruno
  23247. "Polaco" Penteado.
  23248. What's New in Python 3.6.2 final?
  23249. =================================
  23250. *Release date: 2017-07-17*
  23251. No changes since release candidate 2
  23252. What's New in Python 3.6.2 release candidate 2?
  23253. ===============================================
  23254. *Release date: 2017-07-07*
  23255. Security
  23256. --------
  23257. - bpo-30730: Prevent environment variables injection in subprocess on
  23258. Windows. Prevent passing other environment variables and command
  23259. arguments.
  23260. - bpo-30694: Upgrade expat copy from 2.2.0 to 2.2.1 to get fixes of multiple
  23261. security vulnerabilities including: CVE-2017-9233 (External entity
  23262. infinite loop DoS), CVE-2016-9063 (Integer overflow, re-fix),
  23263. CVE-2016-0718 (Fix regression bugs from 2.2.0's fix to CVE-2016-0718) and
  23264. CVE-2012-0876 (Counter hash flooding with SipHash). Note: the
  23265. CVE-2016-5300 (Use os-specific entropy sources like getrandom) doesn't
  23266. impact Python, since Python already gets entropy from the OS to set the
  23267. expat secret using ``XML_SetHashSalt()``.
  23268. - bpo-30500: Fix urllib.parse.splithost() to correctly parse fragments. For
  23269. example, ``splithost('//127.0.0.1#@evil.com/')`` now correctly returns the
  23270. ``127.0.0.1`` host, instead of treating ``@evil.com`` as the host in an
  23271. authentication (``login@host``).
  23272. What's New in Python 3.6.2 release candidate 1?
  23273. ===============================================
  23274. *Release date: 2017-06-17*
  23275. Security
  23276. --------
  23277. - bpo-29591: Update expat copy from 2.1.1 to 2.2.0 to get fixes of
  23278. CVE-2016-0718 and CVE-2016-4472. See
  23279. https://sourceforge.net/p/expat/bugs/537/ for more information.
  23280. Core and Builtins
  23281. -----------------
  23282. - bpo-30682: Removed a too-strict assertion that failed for certain
  23283. f-strings, such as eval("f'\\\n'") and eval("f'\\\r'").
  23284. - bpo-30604: Move co_extra_freefuncs to not be per-thread to avoid crashes
  23285. - bpo-29104: Fixed parsing backslashes in f-strings.
  23286. - bpo-27945: Fixed various segfaults with dict when input collections are
  23287. mutated during searching, inserting or comparing. Based on patches by
  23288. Duane Griffin and Tim Mitchell.
  23289. - bpo-25794: Fixed type.__setattr__() and type.__delattr__() for
  23290. non-interned attribute names. Based on patch by Eryk Sun.
  23291. - bpo-30039: If a KeyboardInterrupt happens when the interpreter is in the
  23292. middle of resuming a chain of nested 'yield from' or 'await' calls, it's
  23293. now correctly delivered to the innermost frame.
  23294. - bpo-12414: sys.getsizeof() on a code object now returns the sizes which
  23295. includes the code struct and sizes of objects which it references. Patch
  23296. by Donghee Na.
  23297. - bpo-29949: Fix memory usage regression of set and frozenset object.
  23298. - bpo-29935: Fixed error messages in the index() method of tuple, list and
  23299. deque when pass indices of wrong type.
  23300. - bpo-29859: Show correct error messages when any of the pthread_* calls in
  23301. thread_pthread.h fails.
  23302. - bpo-28876: ``bool(range)`` works even if ``len(range)`` raises
  23303. :exc:`OverflowError`.
  23304. - bpo-29600: Fix wrapping coroutine return values in StopIteration.
  23305. - bpo-28856: Fix an oversight that %b format for bytes should support
  23306. objects follow the buffer protocol.
  23307. - bpo-29714: Fix a regression that bytes format may fail when containing
  23308. zero bytes inside.
  23309. - bpo-29478: If max_line_length=None is specified while using the Compat32
  23310. policy, it is no longer ignored. Patch by Mircea Cosbuc.
  23311. Library
  23312. -------
  23313. - bpo-30616: Functional API of enum allows to create empty enums. Patched by
  23314. Donghee Na
  23315. - bpo-30038: Fix race condition between signal delivery and wakeup file
  23316. descriptor. Patch by Nathaniel Smith.
  23317. - bpo-23894: lib2to3 now recognizes ``rb'...'`` and ``f'...'`` strings.
  23318. - bpo-23890: unittest.TestCase.assertRaises() now manually breaks a
  23319. reference cycle to not keep objects alive longer than expected.
  23320. - bpo-30149: inspect.signature() now supports callables with
  23321. variable-argument parameters wrapped with partialmethod. Patch by Donghee
  23322. Na.
  23323. - bpo-30645: Fix path calculation in imp.load_package(), fixing it for cases
  23324. when a package is only shipped with bytecodes. Patch by Alexandru
  23325. Ardelean.
  23326. - bpo-29931: Fixed comparison check for ipaddress.ip_interface objects.
  23327. Patch by Sanjay Sundaresan.
  23328. - bpo-30605: re.compile() no longer raises a BytesWarning when compiling a
  23329. bytes instance with misplaced inline modifier. Patch by Roy Williams.
  23330. - bpo-24484: Avoid race condition in multiprocessing cleanup (#2159)
  23331. - bpo-28994: The traceback no longer displayed for SystemExit raised in a
  23332. callback registered by atexit.
  23333. - bpo-30508: Don't log exceptions if Task/Future "cancel()" method was
  23334. called.
  23335. - bpo-28556: Updates to typing module: Add generic AsyncContextManager, add
  23336. support for ContextManager on all versions. Original PRs by Jelle Zijlstra
  23337. and Ivan Levkivskyi
  23338. - bpo-29870: Fix ssl sockets leaks when connection is aborted in asyncio/ssl
  23339. implementation. Patch by Michaël Sghaïer.
  23340. - bpo-29743: Closing transport during handshake process leaks open socket.
  23341. Patch by Nikolay Kim
  23342. - bpo-27585: Fix waiter cancellation in asyncio.Lock. Patch by Mathieu
  23343. Sornay.
  23344. - bpo-30418: On Windows, subprocess.Popen.communicate() now also ignore
  23345. EINVAL on stdin.write() if the child process is still running but closed
  23346. the pipe.
  23347. - bpo-29822: inspect.isabstract() now works during __init_subclass__. Patch
  23348. by Nate Soares.
  23349. - bpo-29581: ABCMeta.__new__ now accepts ``**kwargs``, allowing abstract
  23350. base classes to use keyword parameters in __init_subclass__. Patch by Nate
  23351. Soares.
  23352. - bpo-30557: faulthandler now correctly filters and displays exception codes
  23353. on Windows
  23354. - bpo-30378: Fix the problem that logging.handlers.SysLogHandler cannot
  23355. handle IPv6 addresses.
  23356. - bpo-29960: Preserve generator state when _random.Random.setstate() raises
  23357. an exception. Patch by Bryan Olson.
  23358. - bpo-30414: multiprocessing.Queue._feed background running thread do not
  23359. break from main loop on exception.
  23360. - bpo-30003: Fix handling escape characters in HZ codec. Based on patch by
  23361. Ma Lin.
  23362. - bpo-30301: Fix AttributeError when using SimpleQueue.empty() under *spawn*
  23363. and *forkserver* start methods.
  23364. - bpo-30329: imaplib and poplib now catch the Windows socket WSAEINVAL error
  23365. (code 10022) on shutdown(SHUT_RDWR): An invalid operation was attempted.
  23366. This error occurs sometimes on SSL connections.
  23367. - bpo-30375: Warnings emitted when compile a regular expression now always
  23368. point to the line in the user code. Previously they could point into
  23369. inners of the re module if emitted from inside of groups or conditionals.
  23370. - bpo-30048: Fixed ``Task.cancel()`` can be ignored when the task is running
  23371. coroutine and the coroutine returned without any more ``await``.
  23372. - bpo-30266: contextlib.AbstractContextManager now supports
  23373. anti-registration by setting __enter__ = None or __exit__ = None,
  23374. following the pattern introduced in bpo-25958. Patch by Jelle Zijlstra.
  23375. - bpo-30298: Weaken the condition of deprecation warnings for inline
  23376. modifiers. Now allowed several subsequential inline modifiers at the start
  23377. of the pattern (e.g. ``'(?i)(?s)...'``). In verbose mode whitespaces and
  23378. comments now are allowed before and between inline modifiers (e.g. ``'(?x)
  23379. (?i) (?s)...'``).
  23380. - bpo-29990: Fix range checking in GB18030 decoder. Original patch by Ma
  23381. Lin.
  23382. - bpo-26293: Change resulted because of zipfile breakage. (See also:
  23383. bpo-29094)
  23384. - bpo-30243: Removed the __init__ methods of _json's scanner and encoder.
  23385. Misusing them could cause memory leaks or crashes. Now scanner and
  23386. encoder objects are completely initialized in the __new__ methods.
  23387. - bpo-30185: Avoid KeyboardInterrupt tracebacks in forkserver helper process
  23388. when Ctrl-C is received.
  23389. - bpo-28556: Various updates to typing module: add typing.NoReturn type, use
  23390. WrapperDescriptorType, minor bug-fixes. Original PRs by Jim
  23391. Fasarakis-Hilliard and Ivan Levkivskyi.
  23392. - bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux.
  23393. - bpo-30070: Fixed leaks and crashes in errors handling in the parser
  23394. module.
  23395. - bpo-30061: Fixed crashes in IOBase methods __next__() and readlines() when
  23396. readline() or __next__() respectively return non-sizeable object. Fixed
  23397. possible other errors caused by not checking results of PyObject_Size(),
  23398. PySequence_Size(), or PyMapping_Size().
  23399. - bpo-30017: Allowed calling the close() method of the zip entry writer
  23400. object multiple times. Writing to a closed writer now always produces a
  23401. ValueError.
  23402. - bpo-30068: _io._IOBase.readlines will check if it's closed first when hint
  23403. is present.
  23404. - bpo-29694: Fixed race condition in pathlib mkdir with flags parents=True.
  23405. Patch by Armin Rigo.
  23406. - bpo-29692: Fixed arbitrary unchaining of RuntimeError exceptions in
  23407. contextlib.contextmanager. Patch by Siddharth Velankar.
  23408. - bpo-29998: Pickling and copying ImportError now preserves name and path
  23409. attributes.
  23410. - bpo-29953: Fixed memory leaks in the replace() method of datetime and time
  23411. objects when pass out of bound fold argument.
  23412. - bpo-29942: Fix a crash in itertools.chain.from_iterable when encountering
  23413. long runs of empty iterables.
  23414. - bpo-27863: Fixed multiple crashes in ElementTree caused by race conditions
  23415. and wrong types.
  23416. - bpo-28699: Fixed a bug in pools in multiprocessing.pool that raising an
  23417. exception at the very first of an iterable may swallow the exception or
  23418. make the program hang. Patch by Davin Potts and Xiang Zhang.
  23419. - bpo-25803: Avoid incorrect errors raised by Path.mkdir(exist_ok=True) when
  23420. the OS gives priority to errors such as EACCES over EEXIST.
  23421. - bpo-29861: Release references to tasks, their arguments and their results
  23422. as soon as they are finished in multiprocessing.Pool.
  23423. - bpo-29884: faulthandler: Restore the old sigaltstack during teardown.
  23424. Patch by Christophe Zeitouny.
  23425. - bpo-25455: Fixed crashes in repr of recursive buffered file-like objects.
  23426. - bpo-29800: Fix crashes in partial.__repr__ if the keys of partial.keywords
  23427. are not strings. Patch by Michael Seifert.
  23428. - bpo-29742: get_extra_info() raises exception if get called on closed ssl
  23429. transport. Patch by Nikolay Kim.
  23430. - bpo-8256: Fixed possible failing or crashing input() if attributes
  23431. "encoding" or "errors" of sys.stdin or sys.stdout are not set or are not
  23432. strings.
  23433. - bpo-28298: Fix a bug that prevented array 'Q', 'L' and 'I' from accepting
  23434. big intables (objects that have __int__) as elements. Patch by Oren
  23435. Milman.
  23436. - bpo-28231: The zipfile module now accepts path-like objects for external
  23437. paths.
  23438. - bpo-26915: index() and count() methods of collections.abc.Sequence now
  23439. check identity before checking equality when do comparisons.
  23440. - bpo-29615: SimpleXMLRPCDispatcher no longer chains KeyError (or any other
  23441. exception) to exception(s) raised in the dispatched methods. Patch by Petr
  23442. Motejlek.
  23443. - bpo-30177: path.resolve(strict=False) no longer cuts the path after the
  23444. first element not present in the filesystem. Patch by Antoine Pietri.
  23445. IDLE
  23446. ----
  23447. - bpo-15786: Fix several problems with IDLE's autocompletion box. The
  23448. following should now work: clicking on selection box items; using the
  23449. scrollbar; selecting an item by hitting Return. Hangs on MacOSX should no
  23450. longer happen. Patch by Louie Lu.
  23451. - bpo-25514: Add doc subsubsection about IDLE failure to start. Popup
  23452. no-connection message directs users to this section.
  23453. - bpo-30642: Fix reference leaks in IDLE tests. Patches by Louie Lu and
  23454. Terry Jan Reedy.
  23455. - bpo-30495: Add docstrings for textview.py and use PEP8 names. Patches by
  23456. Cheryl Sabella and Terry Jan Reedy.
  23457. - bpo-30290: Help-about: use pep8 names and add tests. Increase coverage to
  23458. 100%. Patches by Louie Lu, Cheryl Sabella, and Terry Jan Reedy.
  23459. - bpo-30303: Add _utest option to textview; add new tests. Increase coverage
  23460. to 100%. Patches by Louie Lu and Terry Jan Reedy.
  23461. C API
  23462. -----
  23463. - bpo-27867: Function PySlice_GetIndicesEx() no longer replaced with a macro
  23464. if Py_LIMITED_API is not set.
  23465. Build
  23466. -----
  23467. - bpo-29941: Add ``--with-assertions`` configure flag to explicitly enable C
  23468. ``assert()`` checks. Defaults to off. ``--with-pydebug`` implies
  23469. ``--with-assertions``.
  23470. - bpo-28787: Fix out-of-tree builds of Python when configured with
  23471. ``--with--dtrace``.
  23472. - bpo-29243: Prevent unnecessary rebuilding of Python during ``make test``,
  23473. ``make install`` and some other make targets when configured with
  23474. ``--enable-optimizations``.
  23475. - bpo-23404: Don't regenerate generated files based on file modification
  23476. time anymore: the action is now explicit. Replace ``make touch`` with
  23477. ``make regen-all``.
  23478. - bpo-29643: Fix ``--enable-optimization`` didn't work.
  23479. Documentation
  23480. -------------
  23481. - bpo-30176: Add missing attribute related constants in curses
  23482. documentation.
  23483. - bpo-30052: the link targets for :func:`bytes` and :func:`bytearray` are
  23484. now their respective type definitions, rather than the corresponding
  23485. builtin function entries. Use :ref:`bytes <func-bytes>` and
  23486. :ref:`bytearray <func-bytearray>` to reference the latter. In order to
  23487. ensure this and future cross-reference updates are applied automatically,
  23488. the daily documentation builds now disable the default output caching
  23489. features in Sphinx.
  23490. - bpo-26985: Add missing info of code object in inspect documentation.
  23491. Tools/Demos
  23492. -----------
  23493. - bpo-29367: python-gdb.py now supports also ``method-wrapper``
  23494. (``wrapperobject``) objects.
  23495. Tests
  23496. -----
  23497. - bpo-30357: test_thread: setUp() now uses support.threading_setup() and
  23498. support.threading_cleanup() to wait until threads complete to avoid random
  23499. side effects on following tests. Initial patch written by Grzegorz
  23500. Grzywacz.
  23501. - bpo-30197: Enhanced functions swap_attr() and swap_item() in the
  23502. test.support module. They now work when delete replaced attribute or item
  23503. inside the with statement. The old value of the attribute or item (or
  23504. None if it doesn't exist) now will be assigned to the target of the "as"
  23505. clause, if there is one.
  23506. Windows
  23507. -------
  23508. - bpo-30687: Locate msbuild.exe on Windows when building rather than
  23509. vcvarsall.bat
  23510. - bpo-30450: The build process on Windows no longer depends on Subversion,
  23511. instead pulling external code from GitHub via a Python script. If Python
  23512. 3.6 is not found on the system (via ``py -3.6``), NuGet is used to
  23513. download a copy of 32-bit Python.
  23514. What's New in Python 3.6.1 final?
  23515. =================================
  23516. *Release date: 2017-03-21*
  23517. Core and Builtins
  23518. -----------------
  23519. - bpo-29723: The ``sys.path[0]`` initialization change for bpo-29139 caused
  23520. a regression by revealing an inconsistency in how sys.path is initialized
  23521. when executing ``__main__`` from a zipfile, directory, or other import
  23522. location. The interpreter now consistently avoids ever adding the import
  23523. location's parent directory to ``sys.path``, and ensures no other
  23524. ``sys.path`` entries are inadvertently modified when inserting the import
  23525. location named on the command line.
  23526. Build
  23527. -----
  23528. - bpo-27593: fix format of git information used in sys.version
  23529. - Fix incompatible comment in python.h
  23530. What's New in Python 3.6.1 release candidate 1?
  23531. ===============================================
  23532. *Release date: 2017-03-04*
  23533. Core and Builtins
  23534. -----------------
  23535. - bpo-28893: Set correct __cause__ for errors about invalid awaitables
  23536. returned from __aiter__ and __anext__.
  23537. - bpo-29683: Fixes to memory allocation in _PyCode_SetExtra. Patch by Brian
  23538. Coleman.
  23539. - bpo-29684: Fix minor regression of PyEval_CallObjectWithKeywords. It
  23540. should raise TypeError when kwargs is not a dict. But it might cause segv
  23541. when args=NULL and kwargs is not a dict.
  23542. - bpo-28598: Support __rmod__ for subclasses of str being called before
  23543. str.__mod__. Patch by Martijn Pieters.
  23544. - bpo-29607: Fix stack_effect computation for CALL_FUNCTION_EX. Patch by
  23545. Matthieu Dartiailh.
  23546. - bpo-29602: Fix incorrect handling of signed zeros in complex constructor
  23547. for complex subclasses and for inputs having a __complex__ method. Patch
  23548. by Serhiy Storchaka.
  23549. - bpo-29347: Fixed possibly dereferencing undefined pointers when creating
  23550. weakref objects.
  23551. - bpo-29438: Fixed use-after-free problem in key sharing dict.
  23552. - bpo-29319: Prevent RunMainFromImporter overwriting sys.path[0].
  23553. - bpo-29337: Fixed possible BytesWarning when compare the code objects.
  23554. Warnings could be emitted at compile time.
  23555. - bpo-29327: Fixed a crash when pass the iterable keyword argument to
  23556. sorted().
  23557. - bpo-29034: Fix memory leak and use-after-free in os module
  23558. (path_converter).
  23559. - bpo-29159: Fix regression in bytes(x) when x.__index__() raises Exception.
  23560. - bpo-28932: Do not include <sys/random.h> if it does not exist.
  23561. - bpo-25677: Correct the positioning of the syntax error caret for indented
  23562. blocks. Based on patch by Michael Layzell.
  23563. - bpo-29000: Fixed bytes formatting of octals with zero padding in alternate
  23564. form.
  23565. - bpo-26919: On Android, operating system data is now always encoded/decoded
  23566. to/from UTF-8, instead of the locale encoding to avoid inconsistencies
  23567. with os.fsencode() and os.fsdecode() which are already using UTF-8.
  23568. - bpo-28991: functools.lru_cache() was susceptible to an obscure reentrancy
  23569. bug triggerable by a monkey-patched len() function.
  23570. - bpo-28739: f-string expressions are no longer accepted as docstrings and
  23571. by ast.literal_eval() even if they do not include expressions.
  23572. - bpo-28512: Fixed setting the offset attribute of SyntaxError by
  23573. PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject().
  23574. - bpo-28918: Fix the cross compilation of xxlimited when Python has been
  23575. built with Py_DEBUG defined.
  23576. - bpo-28731: Optimize _PyDict_NewPresized() to create correct size dict.
  23577. Improve speed of dict literal with constant keys up to 30%.
  23578. Library
  23579. -------
  23580. - bpo-29169: Update zlib to 1.2.11.
  23581. - bpo-29623: Allow use of path-like object as a single argument in
  23582. ConfigParser.read(). Patch by David Ellis.
  23583. - bpo-28963: Fix out of bound iteration in
  23584. asyncio.Future.remove_done_callback implemented in C.
  23585. - bpo-29704: asyncio.subprocess.SubprocessStreamProtocol no longer closes
  23586. before all pipes are closed.
  23587. - bpo-29271: Fix Task.current_task and Task.all_tasks implemented in C to
  23588. accept None argument as their pure Python implementation.
  23589. - bpo-29703: Fix asyncio to support instantiation of new event loops in
  23590. child processes.
  23591. - bpo-29376: Fix assertion error in threading._DummyThread.is_alive().
  23592. - bpo-28624: Add a test that checks that cwd parameter of Popen() accepts
  23593. PathLike objects. Patch by Sayan Chowdhury.
  23594. - bpo-28518: Start a transaction implicitly before a DML statement. Patch by
  23595. Aviv Palivoda.
  23596. - bpo-29532: Altering a kwarg dictionary passed to functools.partial() no
  23597. longer affects a partial object after creation.
  23598. - bpo-29110: Fix file object leak in aifc.open() when file is given as a
  23599. filesystem path and is not in valid AIFF format. Patch by Anthony Zhang.
  23600. - bpo-28556: Various updates to typing module: typing.Counter,
  23601. typing.ChainMap, improved ABC caching, etc. Original PRs by Jelle
  23602. Zijlstra, Ivan Levkivskyi, Manuel Krebber, and Łukasz Langa.
  23603. - bpo-29100: Fix datetime.fromtimestamp() regression introduced in Python
  23604. 3.6.0: check minimum and maximum years.
  23605. - bpo-29519: Fix weakref spewing exceptions during interpreter shutdown when
  23606. used with a rare combination of multiprocessing and custom codecs.
  23607. - bpo-29416: Prevent infinite loop in pathlib.Path.mkdir
  23608. - bpo-29444: Fixed out-of-bounds buffer access in the group() method of the
  23609. match object. Based on patch by WGH.
  23610. - bpo-29335: Fix subprocess.Popen.wait() when the child process has exited
  23611. to a stopped instead of terminated state (ex: when under ptrace).
  23612. - bpo-29290: Fix a regression in argparse that help messages would wrap at
  23613. non-breaking spaces.
  23614. - bpo-28735: Fixed the comparison of mock.MagickMock with mock.ANY.
  23615. - bpo-29316: Restore the provisional status of typing module, add
  23616. corresponding note to documentation. Patch by Ivan L.
  23617. - bpo-29219: Fixed infinite recursion in the repr of uninitialized
  23618. ctypes.CDLL instances.
  23619. - bpo-29011: Fix an important omission by adding Deque to the typing module.
  23620. - bpo-28969: Fixed race condition in C implementation of
  23621. functools.lru_cache. KeyError could be raised when cached function with
  23622. full cache was simultaneously called from different threads with the same
  23623. uncached arguments.
  23624. - bpo-29142: In urllib.request, suffixes in no_proxy environment variable
  23625. with leading dots could match related hostnames again (e.g. .b.c matches
  23626. a.b.c). Patch by Milan Oberkirch.
  23627. - bpo-28961: Fix unittest.mock._Call helper: don't ignore the name parameter
  23628. anymore. Patch written by Jiajun Huang.
  23629. - bpo-29203: functools.lru_cache() now respects :pep:`468` and preserves the
  23630. order of keyword arguments. f(a=1, b=2) is now cached separately from
  23631. f(b=2, a=1) since both calls could potentially give different results.
  23632. - bpo-15812: inspect.getframeinfo() now correctly shows the first line of a
  23633. context. Patch by Sam Breese.
  23634. - bpo-29094: Offsets in a ZIP file created with extern file object and modes
  23635. "w" and "x" now are relative to the start of the file.
  23636. - bpo-29085: Allow random.Random.seed() to use high quality OS randomness
  23637. rather than the pid and time.
  23638. - bpo-29061: Fixed bug in secrets.randbelow() which would hang when given a
  23639. negative input. Patch by Brendan Donegan.
  23640. - bpo-29079: Prevent infinite loop in pathlib.resolve() on Windows
  23641. - bpo-13051: Fixed recursion errors in large or resized
  23642. curses.textpad.Textbox. Based on patch by Tycho Andersen.
  23643. - bpo-29119: Fix weakrefs in the pure python version of
  23644. collections.OrderedDict move_to_end() method. Contributed by Andra
  23645. Bogildea.
  23646. - bpo-9770: curses.ascii predicates now work correctly with negative
  23647. integers.
  23648. - bpo-28427: old keys should not remove new values from WeakValueDictionary
  23649. when collecting from another thread.
  23650. - bpo-28923: Remove editor artifacts from Tix.py.
  23651. - bpo-29055: Neaten-up empty population error on random.choice() by
  23652. suppressing the upstream exception.
  23653. - bpo-28871: Fixed a crash when deallocate deep ElementTree.
  23654. - bpo-19542: Fix bugs in WeakValueDictionary.setdefault() and
  23655. WeakValueDictionary.pop() when a GC collection happens in another thread.
  23656. - bpo-20191: Fixed a crash in resource.prlimit() when passing a sequence
  23657. that doesn't own its elements as limits.
  23658. - bpo-28779: multiprocessing.set_forkserver_preload() would crash the
  23659. forkserver process if a preloaded module instantiated some multiprocessing
  23660. objects such as locks.
  23661. - bpo-28847: dbm.dumb now supports reading read-only files and no longer
  23662. writes the index file when it is not changed.
  23663. - bpo-26937: The chown() method of the tarfile.TarFile class does not fail
  23664. now when the grp module cannot be imported, as for example on Android
  23665. platforms.
  23666. IDLE
  23667. ----
  23668. - bpo-29071: IDLE colors f-string prefixes (but not invalid ur prefixes).
  23669. - bpo-28572: Add 10% to coverage of IDLE's test_configdialog. Update and
  23670. augment description of the configuration system.
  23671. Windows
  23672. -------
  23673. - bpo-29579: Removes readme.txt from the installer
  23674. - bpo-29326: Ignores blank lines in ._pth files (Patch by Alexey Izbyshev)
  23675. - bpo-28164: Correctly handle special console filenames (patch by Eryk Sun)
  23676. - bpo-29409: Implement :pep:`529` for io.FileIO (Patch by Eryk Sun)
  23677. - bpo-29392: Prevent crash when passing invalid arguments into msvcrt
  23678. module.
  23679. - bpo-25778: winreg does not truncate string correctly (Patch by Eryk Sun)
  23680. - bpo-28896: Deprecate WindowsRegistryFinder and disable it by default.
  23681. C API
  23682. -----
  23683. - bpo-27867: Function PySlice_GetIndicesEx() is replaced with a macro if
  23684. Py_LIMITED_API is not set or set to the value between 0x03050400 and
  23685. 0x03060000 (not including) or 0x03060100 or higher.
  23686. - bpo-29083: Fixed the declaration of some public API functions.
  23687. PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in
  23688. limited API. PyArg_ValidateKeywordArguments(), PyArg_UnpackTuple() and
  23689. Py_BuildValue() were not available in limited API of version < 3.3 when
  23690. PY_SSIZE_T_CLEAN is defined.
  23691. - bpo-29058: All stable API extensions added after Python 3.2 are now
  23692. available only when Py_LIMITED_API is set to the PY_VERSION_HEX value of
  23693. the minimum Python version supporting this API.
  23694. Documentation
  23695. -------------
  23696. - bpo-28929: Link the documentation to its source file on GitHub.
  23697. - bpo-25008: Document smtpd.py as effectively deprecated and add a pointer
  23698. to aiosmtpd, a third-party asyncio-based replacement.
  23699. - bpo-26355: Add canonical header link on each page to corresponding major
  23700. version of the documentation. Patch by Matthias Bussonnier.
  23701. - bpo-29349: Fix Python 2 syntax in code for building the documentation.
  23702. Tests
  23703. -----
  23704. - bpo-28087: Skip test_asyncore and test_eintr poll failures on macOS. Skip
  23705. some tests of select.poll when running on macOS due to unresolved issues
  23706. with the underlying system poll function on some macOS versions.
  23707. - bpo-29571: to match the behaviour of the ``re.LOCALE`` flag,
  23708. test_re.test_locale_flag now uses ``locale.getpreferredencoding(False)``
  23709. to determine the candidate encoding for the test regex (allowing it to
  23710. correctly skip the test when the default locale encoding is a multi-byte
  23711. encoding)
  23712. - bpo-28950: Disallow -j0 to be combined with -T/-l in regrtest command line
  23713. arguments.
  23714. - bpo-28683: Fix the tests that bind() a unix socket and raise
  23715. PermissionError on Android for a non-root user.
  23716. - bpo-26939: Add the support.setswitchinterval() function to fix
  23717. test_functools hanging on the Android armv7 qemu emulator.
  23718. Build
  23719. -----
  23720. - bpo-27593: sys.version and the platform module python_build(),
  23721. python_branch(), and python_revision() functions now use git information
  23722. rather than hg when building from a repo.
  23723. - bpo-29572: Update Windows build and OS X installers to use OpenSSL 1.0.2k.
  23724. - bpo-26851: Set Android compilation and link flags.
  23725. - bpo-28768: Fix implicit declaration of function _setmode. Patch by
  23726. Masayuki Yamamoto
  23727. - bpo-29080: Removes hard dependency on hg.exe from PCBuild/build.bat
  23728. - bpo-23903: Added missed names to PC/python3.def.
  23729. - bpo-28762: lockf() is available on Android API level 24, but the F_LOCK
  23730. macro is not defined in android-ndk-r13.
  23731. - bpo-28538: Fix the compilation error that occurs because if_nameindex() is
  23732. available on Android API level 24, but the if_nameindex structure is not
  23733. defined.
  23734. - bpo-20211: Do not add the directory for installing C header files and the
  23735. directory for installing object code libraries to the cross compilation
  23736. search paths. Original patch by Thomas Petazzoni.
  23737. - bpo-28849: Do not define sys.implementation._multiarch on Android.
  23738. What's New in Python 3.6.0 final?
  23739. =================================
  23740. *Release date: 2016-12-23*
  23741. No changes since release candidate 2
  23742. What's New in Python 3.6.0 release candidate 2?
  23743. ===============================================
  23744. *Release date: 2016-12-16*
  23745. Core and Builtins
  23746. -----------------
  23747. - bpo-28147: Fix a memory leak in split-table dictionaries: setattr() must
  23748. not convert combined table into split table. Patch written by INADA Naoki.
  23749. - bpo-28990: Fix asyncio SSL hanging if connection is closed before
  23750. handshake is completed. (Patch by HoHo-Ho)
  23751. Tools/Demos
  23752. -----------
  23753. - bpo-28770: Fix python-gdb.py for fastcalls.
  23754. Windows
  23755. -------
  23756. - bpo-28896: Deprecate WindowsRegistryFinder.
  23757. Build
  23758. -----
  23759. - bpo-28898: Prevent gdb build errors due to HAVE_LONG_LONG redefinition.
  23760. What's New in Python 3.6.0 release candidate 1?
  23761. ===============================================
  23762. *Release date: 2016-12-06*
  23763. Core and Builtins
  23764. -----------------
  23765. - bpo-23722: Rather than silently producing a class that doesn't support
  23766. zero-argument ``super()`` in methods, failing to pass the new
  23767. ``__classcell__`` namespace entry up to ``type.__new__`` now results in a
  23768. ``DeprecationWarning`` and a class that supports zero-argument
  23769. ``super()``.
  23770. - bpo-28797: Modifying the class __dict__ inside the __set_name__ method of
  23771. a descriptor that is used inside that class no longer prevents calling the
  23772. __set_name__ method of other descriptors.
  23773. - bpo-28782: Fix a bug in the implementation ``yield from`` when checking if
  23774. the next instruction is YIELD_FROM. Regression introduced by WORDCODE
  23775. (issue #26647).
  23776. Library
  23777. -------
  23778. - bpo-27030: Unknown escapes in re.sub() replacement template are allowed
  23779. again. But they still are deprecated and will be disabled in 3.7.
  23780. - bpo-28835: Fix a regression introduced in warnings.catch_warnings(): call
  23781. warnings.showwarning() if it was overridden inside the context manager.
  23782. - bpo-27172: To assist with upgrades from 2.7, the previously documented
  23783. deprecation of ``inspect.getfullargspec()`` has been reversed. This
  23784. decision may be revisited again after the Python 2.7 branch is no longer
  23785. officially supported.
  23786. - bpo-26273: Add new :const:`socket.TCP_CONGESTION` (Linux 2.6.13) and
  23787. :const:`socket.TCP_USER_TIMEOUT` (Linux 2.6.37) constants. Patch written
  23788. by Omar Sandoval.
  23789. - bpo-24142: Reading a corrupt config file left configparser in an invalid
  23790. state. Original patch by Florian Höch.
  23791. - bpo-28843: Fix asyncio C Task to handle exceptions __traceback__.
  23792. C API
  23793. -----
  23794. - bpo-28808: PyUnicode_CompareWithASCIIString() now never raises exceptions.
  23795. Documentation
  23796. -------------
  23797. - bpo-23722: The data model reference and the porting section in the What's
  23798. New guide now cover the additional ``__classcell__`` handling needed for
  23799. custom metaclasses to fully support :pep:`487` and zero-argument
  23800. ``super()``.
  23801. Tools/Demos
  23802. -----------
  23803. - bpo-28023: Fix python-gdb.py didn't support new dict implementation.
  23804. What's New in Python 3.6.0 beta 4?
  23805. ==================================
  23806. *Release date: 2016-11-21*
  23807. Core and Builtins
  23808. -----------------
  23809. - bpo-28532: Show sys.version when -V option is supplied twice.
  23810. - bpo-27100: The with-statement now checks for __enter__ before it checks
  23811. for __exit__. This gives less confusing error messages when both methods
  23812. are missing. Patch by Jonathan Ellington.
  23813. - bpo-28746: Fix the set_inheritable() file descriptor method on platforms
  23814. that do not have the ioctl FIOCLEX and FIONCLEX commands.
  23815. - bpo-26920: Fix not getting the locale's charset upon initializing the
  23816. interpreter, on platforms that do not have langinfo.
  23817. - bpo-28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X
  23818. when decode astral characters. Patch by Xiang Zhang.
  23819. - bpo-19398: Extra slash no longer added to sys.path components in case of
  23820. empty compile-time PYTHONPATH components.
  23821. - bpo-28665: Improve speed of the STORE_DEREF opcode by 40%.
  23822. - bpo-28583: PyDict_SetDefault didn't combine split table when needed. Patch
  23823. by Xiang Zhang.
  23824. - bpo-27243: Change PendingDeprecationWarning -> DeprecationWarning. As it
  23825. was agreed in the issue, __aiter__ returning an awaitable should result in
  23826. PendingDeprecationWarning in 3.5 and in DeprecationWarning in 3.6.
  23827. - bpo-26182: Fix a refleak in code that raises DeprecationWarning.
  23828. - bpo-28721: Fix asynchronous generators aclose() and athrow() to handle
  23829. StopAsyncIteration propagation properly.
  23830. Library
  23831. -------
  23832. - bpo-28752: Restored the __reduce__() methods of datetime objects.
  23833. - bpo-28727: Regular expression patterns, _sre.SRE_Pattern objects created
  23834. by re.compile(), become comparable (only x==y and x!=y operators). This
  23835. change should fix the issue #18383: don't duplicate warning filters when
  23836. the warnings module is reloaded (thing usually only done in unit tests).
  23837. - bpo-20572: The subprocess.Popen.wait method's undocumented endtime
  23838. parameter now raises a DeprecationWarning.
  23839. - bpo-25659: In ctypes, prevent a crash calling the from_buffer() and
  23840. from_buffer_copy() methods on abstract classes like Array.
  23841. - bpo-19717: Makes Path.resolve() succeed on paths that do not exist. Patch
  23842. by Vajrasky Kok
  23843. - bpo-28563: Fixed possible DoS and arbitrary code execution when handle
  23844. plural form selections in the gettext module. The expression parser now
  23845. supports exact syntax supported by GNU gettext.
  23846. - bpo-28387: Fixed possible crash in _io.TextIOWrapper deallocator when the
  23847. garbage collector is invoked in other thread. Based on patch by Sebastian
  23848. Cufre.
  23849. - bpo-28600: Optimize loop.call_soon.
  23850. - bpo-28613: Fix get_event_loop() return the current loop if called from
  23851. coroutines/callbacks.
  23852. - bpo-28634: Fix asyncio.isfuture() to support unittest.Mock.
  23853. - bpo-26081: Fix refleak in _asyncio.Future.__iter__().throw.
  23854. - bpo-28639: Fix inspect.isawaitable to always return bool Patch by Justin
  23855. Mayfield.
  23856. - bpo-28652: Make loop methods reject socket kinds they do not support.
  23857. - bpo-28653: Fix a refleak in functools.lru_cache.
  23858. - bpo-28703: Fix asyncio.iscoroutinefunction to handle Mock objects.
  23859. - bpo-28704: Fix create_unix_server to support Path-like objects (PEP 519).
  23860. - bpo-28720: Add collections.abc.AsyncGenerator.
  23861. Documentation
  23862. -------------
  23863. - bpo-28513: Documented command-line interface of zipfile.
  23864. Tests
  23865. -----
  23866. - bpo-28666: Now test.support.rmtree is able to remove unwritable or
  23867. unreadable directories.
  23868. - bpo-23839: Various caches now are cleared before running every test file.
  23869. Build
  23870. -----
  23871. - bpo-10656: Fix out-of-tree building on AIX. Patch by Tristan Carel and
  23872. Michael Haubenwallner.
  23873. - bpo-26359: Rename --with-optimiations to --enable-optimizations.
  23874. - bpo-28676: Prevent missing 'getentropy' declaration warning on macOS.
  23875. Patch by Gareth Rees.
  23876. What's New in Python 3.6.0 beta 3?
  23877. ==================================
  23878. *Release date: 2016-10-31*
  23879. Core and Builtins
  23880. -----------------
  23881. - bpo-28128: Deprecation warning for invalid str and byte escape sequences
  23882. now prints better information about where the error occurs. Patch by
  23883. Serhiy Storchaka and Eric Smith.
  23884. - bpo-28509: dict.update() no longer allocate unnecessary large memory.
  23885. - bpo-28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug
  23886. build.
  23887. - bpo-28517: Fixed of-by-one error in the peephole optimizer that caused
  23888. keeping unreachable code.
  23889. - bpo-28214: Improved exception reporting for problematic __set_name__
  23890. attributes.
  23891. - bpo-23782: Fixed possible memory leak in _PyTraceback_Add() and exception
  23892. loss in PyTraceBack_Here().
  23893. - bpo-28471: Fix "Python memory allocator called without holding the GIL"
  23894. crash in socket.setblocking.
  23895. Library
  23896. -------
  23897. - bpo-27517: LZMA compressor and decompressor no longer raise exceptions if
  23898. given empty data twice. Patch by Benjamin Fogle.
  23899. - bpo-28549: Fixed segfault in curses's addch() with ncurses6.
  23900. - bpo-28449: tarfile.open() with mode "r" or "r:" now tries to open a tar
  23901. file with compression before trying to open it without compression.
  23902. Otherwise it had 50% chance failed with ignore_zeros=True.
  23903. - bpo-23262: The webbrowser module now supports Firefox 36+ and derived
  23904. browsers. Based on patch by Oleg Broytman.
  23905. - bpo-27939: Fixed bugs in tkinter.ttk.LabeledScale and tkinter.Scale caused
  23906. by representing the scale as float value internally in Tk. tkinter.IntVar
  23907. now works if float value is set to underlying Tk variable.
  23908. - bpo-18844: The various ways of specifying weights for random.choices() now
  23909. produce the same result sequences.
  23910. - bpo-28255: calendar.TextCalendar().prmonth() no longer prints a space at
  23911. the start of new line after printing a month's calendar. Patch by Xiang
  23912. Zhang.
  23913. - bpo-20491: The textwrap.TextWrapper class now honors non-breaking spaces.
  23914. Based on patch by Kaarle Ritvanen.
  23915. - bpo-28353: os.fwalk() no longer fails on broken links.
  23916. - bpo-28430: Fix iterator of C implemented asyncio.Future doesn't accept
  23917. non-None value is passed to it.send(val).
  23918. - bpo-27025: Generated names for Tkinter widgets now start by the "!" prefix
  23919. for readability.
  23920. - bpo-25464: Fixed HList.header_exists() in tkinter.tix module by addin a
  23921. workaround to Tix library bug.
  23922. - bpo-28488: shutil.make_archive() no longer adds entry "./" to ZIP archive.
  23923. - bpo-25953: re.sub() now raises an error for invalid numerical group
  23924. reference in replacement template even if the pattern is not found in the
  23925. string. Error message for invalid group reference now includes the group
  23926. index and the position of the reference. Based on patch by SilentGhost.
  23927. - bpo-18219: Optimize csv.DictWriter for large number of columns. Patch by
  23928. Mariatta Wijaya.
  23929. - bpo-28448: Fix C implemented asyncio.Future didn't work on Windows.
  23930. - bpo-28480: Fix error building socket module when multithreading is
  23931. disabled.
  23932. - bpo-24452: Make webbrowser support Chrome on Mac OS X.
  23933. - bpo-20766: Fix references leaked by pdb in the handling of SIGINT
  23934. handlers.
  23935. - bpo-28492: Fix how StopIteration exception is raised in _asyncio.Future.
  23936. - bpo-28500: Fix asyncio to handle async gens GC from another thread.
  23937. - bpo-26923: Fix asyncio.Gather to refuse being cancelled once all children
  23938. are done. Patch by Johannes Ebke.
  23939. - bpo-26796: Don't configure the number of workers for default threadpool
  23940. executor. Initial patch by Hans Lawrenz.
  23941. - bpo-28544: Implement asyncio.Task in C.
  23942. Windows
  23943. -------
  23944. - bpo-28522: Fixes mishandled buffer reallocation in getpathp.c
  23945. Build
  23946. -----
  23947. - bpo-28444: Fix missing extensions modules when cross compiling.
  23948. - bpo-28208: Update Windows build and OS X installers to use SQLite 3.14.2.
  23949. - bpo-28248: Update Windows build and OS X installers to use OpenSSL 1.0.2j.
  23950. Tests
  23951. -----
  23952. - bpo-26944: Fix test_posix for Android where 'id -G' is entirely wrong or
  23953. missing the effective gid.
  23954. - bpo-28409: regrtest: fix the parser of command line arguments.
  23955. What's New in Python 3.6.0 beta 2?
  23956. ==================================
  23957. *Release date: 2016-10-10*
  23958. Core and Builtins
  23959. -----------------
  23960. - bpo-28183: Optimize and cleanup dict iteration.
  23961. - bpo-26081: Added C implementation of asyncio.Future. Original patch by
  23962. Yury Selivanov.
  23963. - bpo-28379: Added sanity checks and tests for PyUnicode_CopyCharacters().
  23964. Patch by Xiang Zhang.
  23965. - bpo-28376: The type of long range iterator is now registered as Iterator.
  23966. Patch by Oren Milman.
  23967. - bpo-28376: Creating instances of range_iterator by calling range_iterator
  23968. type now is deprecated. Patch by Oren Milman.
  23969. - bpo-28376: The constructor of range_iterator now checks that step is not
  23970. 0. Patch by Oren Milman.
  23971. - bpo-26906: Resolving special methods of uninitialized type now causes
  23972. implicit initialization of the type instead of a fail.
  23973. - bpo-18287: PyType_Ready() now checks that tp_name is not NULL. Original
  23974. patch by Niklas Koep.
  23975. - bpo-24098: Fixed possible crash when AST is changed in process of
  23976. compiling it.
  23977. - bpo-28201: Dict reduces possibility of 2nd conflict in hash table when
  23978. hashes have same lower bits.
  23979. - bpo-28350: String constants with null character no longer interned.
  23980. - bpo-26617: Fix crash when GC runs during weakref callbacks.
  23981. - bpo-27942: String constants now interned recursively in tuples and
  23982. frozensets.
  23983. - bpo-21578: Fixed misleading error message when ImportError called with
  23984. invalid keyword args.
  23985. - bpo-28203: Fix incorrect type in complex(1.0, {2:3}) error message. Patch
  23986. by Soumya Sharma.
  23987. - bpo-28086: Single var-positional argument of tuple subtype was passed
  23988. unscathed to the C-defined function. Now it is converted to exact tuple.
  23989. - bpo-28214: Now __set_name__ is looked up on the class instead of the
  23990. instance.
  23991. - bpo-27955: Fallback on reading /dev/urandom device when the getrandom()
  23992. syscall fails with EPERM, for example when blocked by SECCOMP.
  23993. - bpo-28192: Don't import readline in isolated mode.
  23994. - Upgrade internal unicode databases to Unicode version 9.0.0.
  23995. - bpo-28131: Fix a regression in zipimport's compile_source(). zipimport
  23996. should use the same optimization level as the interpreter.
  23997. - bpo-28126: Replace Py_MEMCPY with memcpy(). Visual Studio can properly
  23998. optimize memcpy().
  23999. - bpo-28120: Fix dict.pop() for splitted dictionary when trying to remove a
  24000. "pending key" (Not yet inserted in split-table). Patch by Xiang Zhang.
  24001. - bpo-26182: Raise DeprecationWarning when async and await keywords are used
  24002. as variable/attribute/class/function name.
  24003. Library
  24004. -------
  24005. - bpo-27998: Fixed bytes path support in os.scandir() on Windows. Patch by
  24006. Eryk Sun.
  24007. - bpo-28317: The disassembler now decodes FORMAT_VALUE argument.
  24008. - bpo-26293: Fixed writing ZIP files that starts not from the start of the
  24009. file. Offsets in ZIP file now are relative to the start of the archive in
  24010. conforming to the specification.
  24011. - bpo-28380: unittest.mock Mock autospec functions now properly support
  24012. assert_called, assert_not_called, and assert_called_once.
  24013. - bpo-27181: remove statistics.geometric_mean and defer until 3.7.
  24014. - bpo-28229: lzma module now supports pathlib.
  24015. - bpo-28321: Fixed writing non-BMP characters with binary format in
  24016. plistlib.
  24017. - bpo-28225: bz2 module now supports pathlib. Initial patch by Ethan
  24018. Furman.
  24019. - bpo-28227: gzip now supports pathlib. Patch by Ethan Furman.
  24020. - bpo-27358: Optimized merging var-keyword arguments and improved error
  24021. message when passing a non-mapping as a var-keyword argument.
  24022. - bpo-28257: Improved error message when passing a non-iterable as a
  24023. var-positional argument. Added opcode BUILD_TUPLE_UNPACK_WITH_CALL.
  24024. - bpo-28322: Fixed possible crashes when unpickle itertools objects from
  24025. incorrect pickle data. Based on patch by John Leitch.
  24026. - bpo-28228: imghdr now supports pathlib.
  24027. - bpo-28226: compileall now supports pathlib.
  24028. - bpo-28314: Fix function declaration (C flags) for the getiterator() method
  24029. of xml.etree.ElementTree.Element.
  24030. - bpo-28148: Stop using localtime() and gmtime() in the time module.
  24031. Introduced platform independent _PyTime_localtime API that is similar to
  24032. POSIX localtime_r, but available on all platforms. Patch by Ed Schouten.
  24033. - bpo-28253: Fixed calendar functions for extreme months: 0001-01 and
  24034. 9999-12. Methods itermonthdays() and itermonthdays2() are reimplemented so
  24035. that they don't call itermonthdates() which can cause datetime.date
  24036. under/overflow.
  24037. - bpo-28275: Fixed possible use after free in the decompress() methods of
  24038. the LZMADecompressor and BZ2Decompressor classes. Original patch by John
  24039. Leitch.
  24040. - bpo-27897: Fixed possible crash in sqlite3.Connection.create_collation()
  24041. if pass invalid string-like object as a name. Patch by Xiang Zhang.
  24042. - bpo-18844: random.choices() now has k as a keyword-only argument to
  24043. improve the readability of common cases and come into line with the
  24044. signature used in other languages.
  24045. - bpo-18893: Fix invalid exception handling in Lib/ctypes/macholib/dyld.py.
  24046. Patch by Madison May.
  24047. - bpo-27611: Fixed support of default root window in the tkinter.tix module.
  24048. Added the master parameter in the DisplayStyle constructor.
  24049. - bpo-27348: In the traceback module, restore the formatting of exception
  24050. messages like "Exception: None". This fixes a regression introduced in
  24051. 3.5a2.
  24052. - bpo-25651: Allow false values to be used for msg parameter of subTest().
  24053. - bpo-27778: Fix a memory leak in os.getrandom() when the getrandom() is
  24054. interrupted by a signal and a signal handler raises a Python exception.
  24055. - bpo-28200: Fix memory leak on Windows in the os module (fix
  24056. path_converter() function).
  24057. - bpo-25400: RobotFileParser now correctly returns default values for
  24058. crawl_delay and request_rate. Initial patch by Peter Wirtz.
  24059. - bpo-27932: Prevent memory leak in win32_ver().
  24060. - Fix UnboundLocalError in socket._sendfile_use_sendfile.
  24061. - bpo-28075: Check for ERROR_ACCESS_DENIED in Windows implementation of
  24062. os.stat(). Patch by Eryk Sun.
  24063. - bpo-22493: Warning message emitted by using inline flags in the middle of
  24064. regular expression now contains a (truncated) regex pattern. Patch by Tim
  24065. Graham.
  24066. - bpo-25270: Prevent codecs.escape_encode() from raising SystemError when an
  24067. empty bytestring is passed.
  24068. - bpo-28181: Get antigravity over HTTPS. Patch by Kaartic Sivaraam.
  24069. - bpo-25895: Enable WebSocket URL schemes in urllib.parse.urljoin. Patch by
  24070. Gergely Imreh and Markus Holtermann.
  24071. - bpo-28114: Fix a crash in parse_envlist() when env contains byte strings.
  24072. Patch by Eryk Sun.
  24073. - bpo-27599: Fixed buffer overrun in binascii.b2a_qp() and
  24074. binascii.a2b_qp().
  24075. - bpo-27906: Fix socket accept exhaustion during high TCP traffic. Patch by
  24076. Kevin Conway.
  24077. - bpo-28174: Handle when SO_REUSEPORT isn't properly supported. Patch by
  24078. Seth Michael Larson.
  24079. - bpo-26654: Inspect functools.partial in asyncio.Handle.__repr__. Patch by
  24080. iceboy.
  24081. - bpo-26909: Fix slow pipes IO in asyncio. Patch by INADA Naoki.
  24082. - bpo-28176: Fix callbacks race in asyncio.SelectorLoop.sock_connect.
  24083. - bpo-27759: Fix selectors incorrectly retain invalid file descriptors.
  24084. Patch by Mark Williams.
  24085. - bpo-28368: Refuse monitoring processes if the child watcher has no loop
  24086. attached. Patch by Vincent Michel.
  24087. - bpo-28369: Raise RuntimeError when transport's FD is used with add_reader,
  24088. add_writer, etc.
  24089. - bpo-28370: Speedup asyncio.StreamReader.readexactly. Patch by Коренберг
  24090. Марк.
  24091. - bpo-28371: Deprecate passing asyncio.Handles to run_in_executor.
  24092. - bpo-28372: Fix asyncio to support formatting of non-python coroutines.
  24093. - bpo-28399: Remove UNIX socket from FS before binding. Patch by Коренберг
  24094. Марк.
  24095. - bpo-27972: Prohibit Tasks to await on themselves.
  24096. Windows
  24097. -------
  24098. - bpo-28402: Adds signed catalog files for stdlib on Windows.
  24099. - bpo-28333: Enables Unicode for ps1/ps2 and input() prompts. (Patch by Eryk
  24100. Sun)
  24101. - bpo-28251: Improvements to help manuals on Windows.
  24102. - bpo-28110: launcher.msi has different product codes between 32-bit and
  24103. 64-bit
  24104. - bpo-28161: Opening CON for write access fails
  24105. - bpo-28162: WindowsConsoleIO readall() fails if first line starts with
  24106. Ctrl+Z
  24107. - bpo-28163: WindowsConsoleIO fileno() passes wrong flags to _open_osfhandle
  24108. - bpo-28164: _PyIO_get_console_type fails for various paths
  24109. - bpo-28137: Renames Windows path file to ._pth
  24110. - bpo-28138: Windows ._pth file should allow import site
  24111. C API
  24112. -----
  24113. - bpo-28426: Deprecated undocumented functions PyUnicode_AsEncodedObject(),
  24114. PyUnicode_AsDecodedObject(), PyUnicode_AsDecodedUnicode() and
  24115. PyUnicode_AsEncodedUnicode().
  24116. Build
  24117. -----
  24118. - bpo-28258: Fixed build with Estonian locale (python-config and distclean
  24119. targets in Makefile). Patch by Arfrever Frehtes Taifersar Arahesis.
  24120. - bpo-26661: setup.py now detects system libffi with multiarch wrapper.
  24121. - bpo-15819: Remove redundant include search directory option for building
  24122. outside the source tree.
  24123. Tests
  24124. -----
  24125. - bpo-28217: Adds _testconsole module to test console input.
  24126. What's New in Python 3.6.0 beta 1?
  24127. ==================================
  24128. *Release date: 2016-09-12*
  24129. Core and Builtins
  24130. -----------------
  24131. - bpo-23722: The __class__ cell used by zero-argument super() is now
  24132. initialized from type.__new__ rather than __build_class__, so class
  24133. methods relying on that will now work correctly when called from metaclass
  24134. methods during class creation. Patch by Martin Teichmann.
  24135. - bpo-25221: Fix corrupted result from PyLong_FromLong(0) when Python is
  24136. compiled with NSMALLPOSINTS = 0.
  24137. - bpo-27080: Implement formatting support for :pep:`515`. Initial patch by
  24138. Chris Angelico.
  24139. - bpo-27199: In tarfile, expose copyfileobj bufsize to improve throughput.
  24140. Patch by Jason Fried.
  24141. - bpo-27948: In f-strings, only allow backslashes inside the braces (where
  24142. the expressions are). This is a breaking change from the 3.6 alpha
  24143. releases, where backslashes are allowed anywhere in an f-string. Also,
  24144. require that expressions inside f-strings be enclosed within literal
  24145. braces, and not escapes like ``f'\x7b"hi"\x7d'``.
  24146. - bpo-28046: Remove platform-specific directories from sys.path.
  24147. - bpo-28071: Add early-out for differencing from an empty set.
  24148. - bpo-25758: Prevents zipimport from unnecessarily encoding a filename
  24149. (patch by Eryk Sun)
  24150. - bpo-25856: The __module__ attribute of extension classes and functions now
  24151. is interned. This leads to more compact pickle data with protocol 4.
  24152. - bpo-27213: Rework CALL_FUNCTION* opcodes to produce shorter and more
  24153. efficient bytecode. Patch by Demur Rumed, design by Serhiy Storchaka,
  24154. reviewed by Serhiy Storchaka and Victor Stinner.
  24155. - bpo-26331: Implement tokenizing support for :pep:`515`. Patch by Georg
  24156. Brandl.
  24157. - bpo-27999: Make "global after use" a SyntaxError, and ditto for nonlocal.
  24158. Patch by Ivan Levkivskyi.
  24159. - bpo-28003: Implement :pep:`525` -- Asynchronous Generators.
  24160. - bpo-27985: Implement :pep:`526` -- Syntax for Variable Annotations. Patch
  24161. by Ivan Levkivskyi.
  24162. - bpo-26058: Add a new private version to the builtin dict type, incremented
  24163. at each dictionary creation and at each dictionary change. Implementation
  24164. of the PEP 509.
  24165. - bpo-27364: A backslash-character pair that is not a valid escape sequence
  24166. now generates a DeprecationWarning. Patch by Emanuel Barry.
  24167. - bpo-27350: ``dict`` implementation is changed like PyPy. It is more
  24168. compact and preserves insertion order. (Concept developed by Raymond
  24169. Hettinger and patch by Inada Naoki.)
  24170. - bpo-27911: Remove unnecessary error checks in
  24171. ``exec_builtin_or_dynamic()``.
  24172. - bpo-27078: Added BUILD_STRING opcode. Optimized f-strings evaluation.
  24173. - bpo-17884: Python now requires systems with inttypes.h and stdint.h
  24174. - bpo-27961: Require platforms to support ``long long``. Python hasn't
  24175. compiled without ``long long`` for years, so this is basically a
  24176. formality.
  24177. - bpo-27355: Removed support for Windows CE. It was never finished, and
  24178. Windows CE is no longer a relevant platform for Python.
  24179. - Implement :pep:`523`.
  24180. - bpo-27870: A left shift of zero by a large integer no longer attempts to
  24181. allocate large amounts of memory.
  24182. - bpo-25402: In int-to-decimal-string conversion, improve the estimate of
  24183. the intermediate memory required, and remove an unnecessarily strict
  24184. overflow check. Patch by Serhiy Storchaka.
  24185. - bpo-27214: In long_invert, be more careful about modifying object returned
  24186. by long_add, and remove an unnecessary check for small longs. Thanks Oren
  24187. Milman for analysis and patch.
  24188. - bpo-27506: Support passing the bytes/bytearray.translate() "delete"
  24189. argument by keyword.
  24190. - bpo-27812: Properly clear out a generator's frame's backreference to the
  24191. generator to prevent crashes in frame.clear().
  24192. - bpo-27811: Fix a crash when a coroutine that has not been awaited is
  24193. finalized with warnings-as-errors enabled.
  24194. - bpo-27587: Fix another issue found by PVS-Studio: Null pointer check after
  24195. use of 'def' in _PyState_AddModule(). Initial patch by Christian Heimes.
  24196. - bpo-27792: The modulo operation applied to ``bool`` and other ``int``
  24197. subclasses now always returns an ``int``. Previously the return type
  24198. depended on the input values. Patch by Xiang Zhang.
  24199. - bpo-26984: int() now always returns an instance of exact int.
  24200. - bpo-25604: Fix a minor bug in integer true division; this bug could
  24201. potentially have caused off-by-one-ulp results on platforms with
  24202. unreliable ldexp implementations.
  24203. - bpo-24254: Make class definition namespace ordered by default.
  24204. - bpo-27662: Fix an overflow check in ``List_New``: the original code was
  24205. checking against ``Py_SIZE_MAX`` instead of the correct upper bound of
  24206. ``Py_SSIZE_T_MAX``. Patch by Xiang Zhang.
  24207. - bpo-27782: Multi-phase extension module import now correctly allows the
  24208. ``m_methods`` field to be used to add module level functions to instances
  24209. of non-module types returned from ``Py_create_mod``. Patch by Xiang Zhang.
  24210. - bpo-27936: The round() function accepted a second None argument for some
  24211. types but not for others. Fixed the inconsistency by accepting None for
  24212. all numeric types.
  24213. - bpo-27487: Warn if a submodule argument to "python -m" or
  24214. runpy.run_module() is found in sys.modules after parent packages are
  24215. imported, but before the submodule is executed.
  24216. - bpo-27157: Make only type() itself accept the one-argument form. Patch by
  24217. Eryk Sun and Emanuel Barry.
  24218. - bpo-27558: Fix a SystemError in the implementation of "raise" statement.
  24219. In a brand new thread, raise a RuntimeError since there is no active
  24220. exception to reraise. Patch written by Xiang Zhang.
  24221. - bpo-28008: Implement :pep:`530` -- asynchronous comprehensions.
  24222. - bpo-27942: Fix memory leak in codeobject.c
  24223. Library
  24224. -------
  24225. - bpo-28732: Fix crash in os.spawnv() with no elements in args
  24226. - bpo-28485: Always raise ValueError for negative
  24227. compileall.compile_dir(workers=...) parameter, even when multithreading is
  24228. unavailable.
  24229. - bpo-28037: Use sqlite3_get_autocommit() instead of setting
  24230. Connection->inTransaction manually.
  24231. - bpo-25283: Attributes tm_gmtoff and tm_zone are now available on all
  24232. platforms in the return values of time.localtime() and time.gmtime().
  24233. - bpo-24454: Regular expression match object groups are now accessible using
  24234. __getitem__. "mo[x]" is equivalent to "mo.group(x)".
  24235. - bpo-10740: sqlite3 no longer implicitly commit an open transaction before
  24236. DDL statements.
  24237. - bpo-17941: Add a *module* parameter to collections.namedtuple().
  24238. - bpo-22493: Inline flags now should be used only at the start of the
  24239. regular expression. Deprecation warning is emitted if uses them in the
  24240. middle of the regular expression.
  24241. - bpo-26885: xmlrpc now supports unmarshalling additional data types used by
  24242. Apache XML-RPC implementation for numerics and None.
  24243. - bpo-28070: Fixed parsing inline verbose flag in regular expressions.
  24244. - bpo-19500: Add client-side SSL session resumption to the ssl module.
  24245. - bpo-28022: Deprecate ssl-related arguments in favor of SSLContext. The
  24246. deprecation include manual creation of SSLSocket and certfile/keyfile (or
  24247. similar) in ftplib, httplib, imaplib, smtplib, poplib and urllib.
  24248. - bpo-28043: SSLContext has improved default settings: OP_NO_SSLv2,
  24249. OP_NO_SSLv3, OP_NO_COMPRESSION, OP_CIPHER_SERVER_PREFERENCE,
  24250. OP_SINGLE_DH_USE, OP_SINGLE_ECDH_USE and HIGH ciphers without MD5.
  24251. - bpo-24693: Changed some RuntimeError's in the zipfile module to more
  24252. appropriate types. Improved some error messages and debugging output.
  24253. - bpo-17909: ``json.load`` and ``json.loads`` now support binary input
  24254. encoded as UTF-8, UTF-16 or UTF-32. Patch by Serhiy Storchaka.
  24255. - bpo-27137: the pure Python fallback implementation of
  24256. ``functools.partial`` now matches the behaviour of its accelerated C
  24257. counterpart for subclassing, pickling and text representation purposes.
  24258. Patch by Emanuel Barry and Serhiy Storchaka.
  24259. - Fix possible integer overflows and crashes in the mmap module with unusual
  24260. usage patterns.
  24261. - bpo-1703178: Fix the ability to pass the --link-objects option to the
  24262. distutils build_ext command.
  24263. - bpo-28019: itertools.count() no longer rounds non-integer step in range
  24264. between 1.0 and 2.0 to 1.
  24265. - bpo-18401: Pdb now supports the 'readrc' keyword argument to control
  24266. whether .pdbrc files should be read. Patch by Martin Matusiak and Sam
  24267. Kimbrel.
  24268. - bpo-25969: Update the lib2to3 grammar to handle the unpacking
  24269. generalizations added in 3.5.
  24270. - bpo-14977: mailcap now respects the order of the lines in the mailcap
  24271. files ("first match"), as required by RFC 1542. Patch by Michael Lazar.
  24272. - bpo-28082: Convert re flag constants to IntFlag.
  24273. - bpo-28025: Convert all ssl module constants to IntEnum and IntFlags.
  24274. SSLContext properties now return flags and enums.
  24275. - bpo-23591: Add Flag, IntFlag, and auto() to enum module.
  24276. - bpo-433028: Added support of modifier spans in regular expressions.
  24277. - bpo-24594: Validates persist parameter when opening MSI database
  24278. - bpo-17582: xml.etree.ElementTree nows preserves whitespaces in attributes
  24279. (Patch by Duane Griffin. Reviewed and approved by Stefan Behnel.)
  24280. - bpo-28047: Fixed calculation of line length used for the base64 CTE in the
  24281. new email policies.
  24282. - bpo-27576: Fix call order in OrderedDict.__init__().
  24283. - email.generator.DecodedGenerator now supports the policy keyword.
  24284. - bpo-28027: Remove undocumented modules from ``Lib/plat-*``: IN, CDROM,
  24285. DLFCN, TYPES, CDIO, and STROPTS.
  24286. - bpo-27445: Don't pass str(_charset) to MIMEText.set_payload(). Patch by
  24287. Claude Paroz.
  24288. - bpo-24277: The new email API is no longer provisional, and the docs have
  24289. been reorganized and rewritten to emphasize the new API.
  24290. - bpo-22450: urllib now includes an ``Accept: */*`` header among the default
  24291. headers. This makes the results of REST API requests more consistent and
  24292. predictable especially when proxy servers are involved.
  24293. - lib2to3.pgen3.driver.load_grammar() now creates a stable cache file
  24294. between runs given the same Grammar.txt input regardless of the hash
  24295. randomization setting.
  24296. - bpo-28005: Allow ImportErrors in encoding implementation to propagate.
  24297. - bpo-26667: Support path-like objects in importlib.util.
  24298. - bpo-27570: Avoid zero-length memcpy() etc calls with null source pointers
  24299. in the "ctypes" and "array" modules.
  24300. - bpo-22233: Break email header lines *only* on the RFC specified CR and LF
  24301. characters, not on arbitrary unicode line breaks. This also fixes a bug
  24302. in HTTP header parsing.
  24303. - bpo-27331: The email.mime classes now all accept an optional policy
  24304. keyword.
  24305. - bpo-27988: Fix email iter_attachments incorrect mutation of payload list.
  24306. - bpo-16113: Add SHA-3 and SHAKE support to hashlib module.
  24307. - Eliminate a tautological-pointer-compare warning in _scproxy.c.
  24308. - bpo-27776: The :func:`os.urandom` function does now block on Linux 3.17
  24309. and newer until the system urandom entropy pool is initialized to increase
  24310. the security. This change is part of the :pep:`524`.
  24311. - bpo-27778: Expose the Linux ``getrandom()`` syscall as a new
  24312. :func:`os.getrandom` function. This change is part of the :pep:`524`.
  24313. - bpo-27691: Fix ssl module's parsing of GEN_RID subject alternative name
  24314. fields in X.509 certs.
  24315. - bpo-18844: Add random.choices().
  24316. - bpo-25761: Improved error reporting about truncated pickle data in C
  24317. implementation of unpickler. UnpicklingError is now raised instead of
  24318. AttributeError and ValueError in some cases.
  24319. - bpo-26798: Add BLAKE2 (blake2b and blake2s) to hashlib.
  24320. - bpo-26032: Optimized globbing in pathlib by using os.scandir(); it is now
  24321. about 1.5--4 times faster.
  24322. - bpo-25596: Optimized glob() and iglob() functions in the glob module; they
  24323. are now about 3--6 times faster.
  24324. - bpo-27928: Add scrypt (password-based key derivation function) to hashlib
  24325. module (requires OpenSSL 1.1.0).
  24326. - bpo-27850: Remove 3DES from ssl module's default cipher list to counter
  24327. measure sweet32 attack (CVE-2016-2183).
  24328. - bpo-27766: Add ChaCha20 Poly1305 to ssl module's default cipher list.
  24329. (Required OpenSSL 1.1.0 or LibreSSL).
  24330. - bpo-25387: Check return value of winsound.MessageBeep.
  24331. - bpo-27866: Add SSLContext.get_ciphers() method to get a list of all
  24332. enabled ciphers.
  24333. - bpo-27744: Add AF_ALG (Linux Kernel crypto) to socket module.
  24334. - bpo-26470: Port ssl and hashlib module to OpenSSL 1.1.0.
  24335. - bpo-11620: Fix support for SND_MEMORY in winsound.PlaySound. Based on a
  24336. patch by Tim Lesher.
  24337. - bpo-11734: Add support for IEEE 754 half-precision floats to the struct
  24338. module. Based on a patch by Eli Stevens.
  24339. - bpo-27919: Deprecated ``extra_path`` distribution option in distutils
  24340. packaging.
  24341. - bpo-23229: Add new ``cmath`` constants: ``cmath.inf`` and ``cmath.nan`` to
  24342. match ``math.inf`` and ``math.nan``, and also ``cmath.infj`` and
  24343. ``cmath.nanj`` to match the format used by complex repr.
  24344. - bpo-27842: The csv.DictReader now returns rows of type OrderedDict.
  24345. (Contributed by Steve Holden.)
  24346. - Remove support for passing a file descriptor to os.access. It never worked
  24347. but previously didn't raise.
  24348. - bpo-12885: Fix error when distutils encounters symlink.
  24349. - bpo-27881: Fixed possible bugs when setting
  24350. sqlite3.Connection.isolation_level. Based on patch by Xiang Zhang.
  24351. - bpo-27861: Fixed a crash in sqlite3.Connection.cursor() when a factory
  24352. creates not a cursor. Patch by Xiang Zhang.
  24353. - bpo-19884: Avoid spurious output on OS X with Gnu Readline.
  24354. - bpo-27706: Restore deterministic behavior of random.Random().seed() for
  24355. string seeds using seeding version 1. Allows sequences of calls to
  24356. random() to exactly match those obtained in Python 2. Patch by Nofar
  24357. Schnider.
  24358. - bpo-10513: Fix a regression in Connection.commit(). Statements should not
  24359. be reset after a commit.
  24360. - bpo-12319: Chunked transfer encoding support added to
  24361. http.client.HTTPConnection requests. The
  24362. urllib.request.AbstractHTTPHandler class does not enforce a Content-Length
  24363. header any more. If a HTTP request has a file or iterable body, but no
  24364. Content-Length header, the library now falls back to use chunked
  24365. transfer-encoding.
  24366. - A new version of typing.py from https://github.com/python/typing: -
  24367. Collection (only for 3.6) (Issue #27598) - Add FrozenSet to __all__
  24368. (upstream #261) - fix crash in _get_type_vars() (upstream #259) - Remove
  24369. the dict constraint in ForwardRef._eval_type (upstream #252)
  24370. - bpo-27832: Make ``_normalize`` parameter to ``Fraction`` constructor
  24371. keyword-only, so that ``Fraction(2, 3, 4)`` now raises ``TypeError``.
  24372. - bpo-27539: Fix unnormalised ``Fraction.__pow__`` result in the case of
  24373. negative exponent and negative base.
  24374. - bpo-21718: cursor.description is now available for queries using CTEs.
  24375. - bpo-27819: In distutils sdists, simply produce the "gztar" (gzipped tar
  24376. format) distributions on all platforms unless "formats" is supplied.
  24377. - bpo-2466: posixpath.ismount now correctly recognizes mount points which
  24378. the user does not have permission to access.
  24379. - bpo-9998: On Linux, ctypes.util.find_library now looks in LD_LIBRARY_PATH
  24380. for shared libraries.
  24381. - bpo-27573: exit message for code.interact is now configurable.
  24382. - bpo-27930: Improved behaviour of logging.handlers.QueueListener. Thanks to
  24383. Paulo Andrade and Petr Viktorin for the analysis and patch.
  24384. - bpo-6766: Distributed reference counting added to multiprocessing to
  24385. support nesting of shared values / proxy objects.
  24386. - bpo-21201: Improves readability of multiprocessing error message. Thanks
  24387. to Wojciech Walczak for patch.
  24388. - asyncio: Add set_protocol / get_protocol to Transports.
  24389. - bpo-27456: asyncio: Set TCP_NODELAY by default.
  24390. IDLE
  24391. ----
  24392. - bpo-15308: Add 'interrupt execution' (^C) to Shell menu. Patch by Roger
  24393. Serwy, updated by Bayard Randel.
  24394. - bpo-27922: Stop IDLE tests from 'flashing' gui widgets on the screen.
  24395. - bpo-27891: Consistently group and sort imports within idlelib modules.
  24396. - bpo-17642: add larger font sizes for classroom projection.
  24397. - Add version to title of IDLE help window.
  24398. - bpo-25564: In section on IDLE -- console differences, mention that using
  24399. exec means that __builtins__ is defined for each statement.
  24400. - bpo-27821: Fix 3.6.0a3 regression that prevented custom key sets from
  24401. being selected when no custom theme was defined.
  24402. C API
  24403. -----
  24404. - bpo-26900: Excluded underscored names and other private API from limited
  24405. API.
  24406. - bpo-26027: Add support for path-like objects in PyUnicode_FSConverter() &
  24407. PyUnicode_FSDecoder().
  24408. Tests
  24409. -----
  24410. - bpo-27427: Additional tests for the math module. Patch by Francisco Couzo.
  24411. - bpo-27953: Skip math and cmath tests that fail on OS X 10.4 due to a poor
  24412. libm implementation of tan.
  24413. - bpo-26040: Improve test_math and test_cmath coverage and rigour. Patch by
  24414. Jeff Allen.
  24415. - bpo-27787: Call gc.collect() before checking each test for "dangling
  24416. threads", since the dangling threads are weak references.
  24417. Build
  24418. -----
  24419. - bpo-27566: Fix clean target in freeze makefile (patch by Lisa Roach)
  24420. - bpo-27705: Update message in validate_ucrtbase.py
  24421. - bpo-27976: Deprecate building _ctypes with the bundled copy of libffi on
  24422. non-OSX UNIX platforms.
  24423. - bpo-27983: Cause lack of llvm-profdata tool when using clang as required
  24424. for PGO linking to be a configure time error rather than make time when
  24425. ``--with-optimizations`` is enabled. Also improve our ability to find the
  24426. llvm-profdata tool on MacOS and some Linuxes.
  24427. - bpo-21590: Support for DTrace and SystemTap probes.
  24428. - bpo-26307: The profile-opt build now applies PGO to the built-in modules.
  24429. - bpo-26359: Add the --with-optimizations flag to turn on LTO and PGO build
  24430. support when available.
  24431. - bpo-27917: Set platform triplets for Android builds.
  24432. - bpo-25825: Update references to the $(LIBPL) installation path on AIX.
  24433. This path was changed in 3.2a4.
  24434. - Update OS X installer to use SQLite 3.14.1 and XZ 5.2.2.
  24435. - bpo-21122: Fix LTO builds on OS X.
  24436. - bpo-17128: Build OS X installer with a private copy of OpenSSL. Also
  24437. provide a sample Install Certificates command script to install a set of
  24438. root certificates from the third-party certifi module.
  24439. Tools/Demos
  24440. -----------
  24441. - bpo-27952: Get Tools/scripts/fixcid.py working with Python 3 and the
  24442. current "re" module, avoid invalid Python backslash escapes, and fix a bug
  24443. parsing escaped C quote signs.
  24444. Windows
  24445. -------
  24446. - bpo-28065: Update xz dependency to 5.2.2 and build it from source.
  24447. - bpo-25144: Ensures TargetDir is set before continuing with custom install.
  24448. - bpo-1602: Windows console doesn't input or print Unicode (PEP 528)
  24449. - bpo-27781: Change file system encoding on Windows to UTF-8 (PEP 529)
  24450. - bpo-27731: Opt-out of MAX_PATH on Windows 10
  24451. - bpo-6135: Adds encoding and errors parameters to subprocess.
  24452. - bpo-27959: Adds oem encoding, alias ansi to mbcs, move aliasmbcs to codec
  24453. lookup.
  24454. - bpo-27982: The functions of the winsound module now accept keyword
  24455. arguments.
  24456. - bpo-20366: Build full text search support into SQLite on Windows.
  24457. - bpo-27756: Adds new icons for Python files and processes on Windows.
  24458. Designs by Cherry Wang.
  24459. - bpo-27883: Update sqlite to 3.14.1.0 on Windows.
  24460. What's New in Python 3.6.0 alpha 4?
  24461. ===================================
  24462. *Release date: 2016-08-15*
  24463. Core and Builtins
  24464. -----------------
  24465. - bpo-27704: Optimized creating bytes and bytearray from byte-like objects
  24466. and iterables. Speed up to 3 times for short objects. Original patch by
  24467. Naoki Inada.
  24468. - bpo-26823: Large sections of repeated lines in tracebacks are now
  24469. abbreviated as "[Previous line repeated {count} more times]" by the
  24470. builtin traceback rendering. Patch by Emanuel Barry.
  24471. - bpo-27574: Decreased an overhead of parsing keyword arguments in functions
  24472. implemented with using Argument Clinic.
  24473. - bpo-22557: Now importing already imported modules is up to 2.5 times
  24474. faster.
  24475. - bpo-17596: Include <wincrypt.h> to help with Min GW building.
  24476. - bpo-17599: On Windows, rename the privately defined REPARSE_DATA_BUFFER
  24477. structure to avoid conflicting with the definition from Min GW.
  24478. - bpo-27507: Add integer overflow check in bytearray.extend(). Patch by
  24479. Xiang Zhang.
  24480. - bpo-27581: Don't rely on wrapping for overflow check in
  24481. PySequence_Tuple(). Patch by Xiang Zhang.
  24482. - bpo-1621: Avoid signed integer overflow in list and tuple operations.
  24483. Patch by Xiang Zhang.
  24484. - bpo-27419: Standard __import__() no longer look up "__import__" in globals
  24485. or builtins for importing submodules or "from import". Fixed a crash if
  24486. raise a warning about unabling to resolve package from __spec__ or
  24487. __package__.
  24488. - bpo-27083: Respect the PYTHONCASEOK environment variable under Windows.
  24489. - bpo-27514: Make having too many statically nested blocks a SyntaxError
  24490. instead of SystemError.
  24491. - bpo-27366: Implemented :pep:`487` (Simpler customization of class
  24492. creation). Upon subclassing, the __init_subclass__ classmethod is called
  24493. on the base class. Descriptors are initialized with __set_name__ after
  24494. class creation.
  24495. Library
  24496. -------
  24497. - bpo-26027: Add :pep:`519`/__fspath__() support to the os and os.path
  24498. modules. Includes code from Jelle Zijlstra. (See also: bpo-27524)
  24499. - bpo-27598: Add Collections to collections.abc. Patch by Ivan Levkivskyi,
  24500. docs by Neil Girdhar.
  24501. - bpo-25958: Support "anti-registration" of special methods from various
  24502. ABCs, like __hash__, __iter__ or __len__. All these (and several more)
  24503. can be set to None in an implementation class and the behavior will be as
  24504. if the method is not defined at all. (Previously, this mechanism existed
  24505. only for __hash__, to make mutable classes unhashable.) Code contributed
  24506. by Andrew Barnert and Ivan Levkivskyi.
  24507. - bpo-16764: Support keyword arguments to zlib.decompress(). Patch by Xiang
  24508. Zhang.
  24509. - bpo-27736: Prevent segfault after interpreter re-initialization due to ref
  24510. count problem introduced in code for Issue #27038 in 3.6.0a3. Patch by
  24511. Xiang Zhang.
  24512. - bpo-25628: The *verbose* and *rename* parameters for
  24513. collections.namedtuple are now keyword-only.
  24514. - bpo-12345: Add mathematical constant tau to math and cmath. See also
  24515. :pep:`628`.
  24516. - bpo-26823: traceback.StackSummary.format now abbreviates large sections of
  24517. repeated lines as "[Previous line repeated {count} more times]" (this
  24518. change then further affects other traceback display operations in the
  24519. module). Patch by Emanuel Barry.
  24520. - bpo-27664: Add to concurrent.futures.thread.ThreadPoolExecutor() the
  24521. ability to specify a thread name prefix.
  24522. - bpo-27181: Add geometric_mean and harmonic_mean to statistics module.
  24523. - bpo-27573: code.interact now prints an message when exiting.
  24524. - bpo-6422: Add autorange method to timeit.Timer objects.
  24525. - bpo-27773: Correct some memory management errors server_hostname in
  24526. _ssl.wrap_socket().
  24527. - bpo-26750: unittest.mock.create_autospec() now works properly for
  24528. subclasses of property() and other data descriptors. Removes the never
  24529. publicly used, never documented unittest.mock.DescriptorTypes tuple.
  24530. - bpo-26754: Undocumented support of general bytes-like objects as path in
  24531. compile() and similar functions is now deprecated.
  24532. - bpo-26800: Undocumented support of general bytes-like objects as paths in
  24533. os functions is now deprecated.
  24534. - bpo-26981: Add _order_ compatibility shim to enum.Enum for Python 2/3 code
  24535. bases.
  24536. - bpo-27661: Added tzinfo keyword argument to datetime.combine.
  24537. - In the curses module, raise an error if window.getstr() or window.instr()
  24538. is passed a negative value.
  24539. - bpo-27783: Fix possible usage of uninitialized memory in
  24540. operator.methodcaller.
  24541. - bpo-27774: Fix possible Py_DECREF on unowned object in _sre.
  24542. - bpo-27760: Fix possible integer overflow in binascii.b2a_qp.
  24543. - bpo-27758: Fix possible integer overflow in the _csv module for large
  24544. record lengths.
  24545. - bpo-27568: Prevent HTTPoxy attack (CVE-2016-1000110). Ignore the
  24546. HTTP_PROXY variable when REQUEST_METHOD environment is set, which
  24547. indicates that the script is in CGI mode.
  24548. - bpo-7063: Remove dead code from the "array" module's slice handling. Patch
  24549. by Chuck.
  24550. - bpo-27656: Do not assume sched.h defines any SCHED_* constants.
  24551. - bpo-27130: In the "zlib" module, fix handling of large buffers (typically
  24552. 4 GiB) when compressing and decompressing. Previously, inputs were
  24553. limited to 4 GiB, and compression and decompression operations did not
  24554. properly handle results of 4 GiB.
  24555. - bpo-24773: Implemented :pep:`495` (Local Time Disambiguation).
  24556. - Expose the EPOLLEXCLUSIVE constant (when it is defined) in the select
  24557. module.
  24558. - bpo-27567: Expose the EPOLLRDHUP and POLLRDHUP constants in the select
  24559. module.
  24560. - bpo-1621: Avoid signed int negation overflow in the "audioop" module.
  24561. - bpo-27533: Release GIL in nt._isdir
  24562. - bpo-17711: Fixed unpickling by the persistent ID with protocol 0. Original
  24563. patch by Alexandre Vassalotti.
  24564. - bpo-27522: Avoid an unintentional reference cycle in email.feedparser.
  24565. - bpo-27512: Fix a segfault when os.fspath() called an __fspath__() method
  24566. that raised an exception. Patch by Xiang Zhang.
  24567. IDLE
  24568. ----
  24569. - bpo-27714: text_textview and test_autocomplete now pass when re-run in the
  24570. same process. This occurs when test_idle fails when run with the -w
  24571. option but without -jn. Fix warning from test_config.
  24572. - bpo-27621: Put query response validation error messages in the query box
  24573. itself instead of in a separate messagebox. Redo tests to match. Add Mac
  24574. OSX refinements. Original patch by Mark Roseman.
  24575. - bpo-27620: Escape key now closes Query box as cancelled.
  24576. - bpo-27609: IDLE: tab after initial whitespace should tab, not
  24577. autocomplete. This fixes problem with writing docstrings at least twice
  24578. indented.
  24579. - bpo-27609: Explicitly return None when there are also non-None returns. In
  24580. a few cases, reverse a condition and eliminate a return.
  24581. - bpo-25507: IDLE no longer runs buggy code because of its tkinter imports.
  24582. Users must include the same imports required to run directly in Python.
  24583. - bpo-27173: Add 'IDLE Modern Unix' to the built-in key sets. Make the
  24584. default key set depend on the platform. Add tests for the changes to the
  24585. config module.
  24586. - bpo-27452: add line counter and crc to IDLE configHandler test dump.
  24587. Tests
  24588. -----
  24589. - bpo-25805: Skip a test in test_pkgutil as needed that doesn't work when
  24590. ``__name__ == __main__``. Patch by SilentGhost.
  24591. - bpo-27472: Add test.support.unix_shell as the path to the default shell.
  24592. - bpo-27369: In test_pyexpat, avoid testing an error message detail that
  24593. changed in Expat 2.2.0.
  24594. - bpo-27594: Prevent assertion error when running test_ast with coverage
  24595. enabled: ensure code object has a valid first line number. Patch suggested
  24596. by Ivan Levkivskyi.
  24597. Windows
  24598. -------
  24599. - bpo-27647: Update bundled Tcl/Tk to 8.6.6.
  24600. - bpo-27610: Adds :pep:`514` metadata to Windows installer
  24601. - bpo-27469: Adds a shell extension to the launcher so that drag and drop
  24602. works correctly.
  24603. - bpo-27309: Enables proper Windows styles in python[w].exe manifest.
  24604. Build
  24605. -----
  24606. - bpo-27713: Suppress spurious build warnings when updating importlib's
  24607. bootstrap files. Patch by Xiang Zhang
  24608. - bpo-25825: Correct the references to Modules/python.exp, which is required
  24609. on AIX. The references were accidentally changed in 3.5.0a1.
  24610. - bpo-27453: CPP invocation in configure must use CPPFLAGS. Patch by Chi
  24611. Hsuan Yen.
  24612. - bpo-27641: The configure script now inserts comments into the makefile to
  24613. prevent the pgen and _freeze_importlib executables from being
  24614. cross-compiled.
  24615. - bpo-26662: Set PYTHON_FOR_GEN in configure as the Python program to be
  24616. used for file generation during the build.
  24617. - bpo-10910: Avoid C++ compilation errors on FreeBSD and OS X. Also update
  24618. FreedBSD version checks for the original ctype UTF-8 workaround.
  24619. What's New in Python 3.6.0 alpha 3?
  24620. ===================================
  24621. *Release date: 2016-07-11*
  24622. Security
  24623. --------
  24624. - bpo-27278: Fix os.urandom() implementation using getrandom() on Linux.
  24625. Truncate size to INT_MAX and loop until we collected enough random bytes,
  24626. instead of casting a directly Py_ssize_t to int.
  24627. - bpo-22636: Avoid shell injection problems with ctypes.util.find_library().
  24628. Core and Builtins
  24629. -----------------
  24630. - bpo-27473: Fixed possible integer overflow in bytes and bytearray
  24631. concatenations. Patch by Xiang Zhang.
  24632. - bpo-23034: The output of a special Python build with defined COUNT_ALLOCS,
  24633. SHOW_ALLOC_COUNT or SHOW_TRACK_COUNT macros is now off by default. It
  24634. can be re-enabled using the "-X showalloccount" option. It now outputs to
  24635. stderr instead of stdout.
  24636. - bpo-27443: __length_hint__() of bytearray iterators no longer return a
  24637. negative integer for a resized bytearray.
  24638. - bpo-27007: The fromhex() class methods of bytes and bytearray subclasses
  24639. now return an instance of corresponding subclass.
  24640. Library
  24641. -------
  24642. - bpo-26844: Fix error message for imp.find_module() to refer to 'path'
  24643. instead of 'name'. Patch by Lev Maximov.
  24644. - bpo-23804: Fix SSL zero-length recv() calls to not block and not raise an
  24645. error about unclean EOF.
  24646. - bpo-27466: Change time format returned by http.cookie.time2netscape,
  24647. confirming the netscape cookie format and making it consistent with
  24648. documentation.
  24649. - bpo-21708: Deprecated dbm.dumb behavior that differs from common dbm
  24650. behavior: creating a database in 'r' and 'w' modes and modifying a
  24651. database in 'r' mode.
  24652. - bpo-26721: Change the socketserver.StreamRequestHandler.wfile attribute to
  24653. implement BufferedIOBase. In particular, the write() method no longer does
  24654. partial writes.
  24655. - bpo-22115: Added methods trace_add, trace_remove and trace_info in the
  24656. tkinter.Variable class. They replace old methods trace_variable, trace,
  24657. trace_vdelete and trace_vinfo that use obsolete Tcl commands and might not
  24658. work in future versions of Tcl. Fixed old tracing methods:
  24659. trace_vdelete() with wrong mode no longer break tracing, trace_vinfo() now
  24660. always returns a list of pairs of strings, tracing in the "u" mode now
  24661. works.
  24662. - bpo-26243: Only the level argument to zlib.compress() is keyword argument
  24663. now. The first argument is positional-only.
  24664. - bpo-27038: Expose the DirEntry type as os.DirEntry. Code patch by Jelle
  24665. Zijlstra.
  24666. - bpo-27186: Update os.fspath()/PyOS_FSPath() to check the return value of
  24667. __fspath__() to be either str or bytes.
  24668. - bpo-18726: All optional parameters of the dump(), dumps(), load() and
  24669. loads() functions and JSONEncoder and JSONDecoder class constructors in
  24670. the json module are now keyword-only.
  24671. - bpo-27319: Methods selection_set(), selection_add(), selection_remove()
  24672. and selection_toggle() of ttk.TreeView now allow passing multiple items as
  24673. multiple arguments instead of passing them as a tuple. Deprecated
  24674. undocumented ability of calling the selection() method with arguments.
  24675. - bpo-27079: Fixed curses.ascii functions isblank(), iscntrl() and
  24676. ispunct().
  24677. - bpo-27294: Numerical state in the repr for Tkinter event objects is now
  24678. represented as a combination of known flags.
  24679. - bpo-27177: Match objects in the re module now support index-like objects
  24680. as group indices. Based on patches by Jeroen Demeyer and Xiang Zhang.
  24681. - bpo-26754: Some functions (compile() etc) accepted a filename argument
  24682. encoded as an iterable of integers. Now only strings and byte-like objects
  24683. are accepted.
  24684. - bpo-26536: socket.ioctl now supports SIO_LOOPBACK_FAST_PATH. Patch by
  24685. Daniel Stokes.
  24686. - bpo-27048: Prevents distutils failing on Windows when environment
  24687. variables contain non-ASCII characters
  24688. - bpo-27330: Fixed possible leaks in the ctypes module.
  24689. - bpo-27238: Got rid of bare excepts in the turtle module. Original patch
  24690. by Jelle Zijlstra.
  24691. - bpo-27122: When an exception is raised within the context being managed by
  24692. a contextlib.ExitStack() and one of the exit stack generators catches and
  24693. raises it in a chain, do not re-raise the original exception when exiting,
  24694. let the new chained one through. This avoids the :pep:`479` bug described
  24695. in issue25782.
  24696. - bpo-16864: sqlite3.Cursor.lastrowid now supports REPLACE statement.
  24697. Initial patch by Alex LordThorsen.
  24698. - bpo-26386: Fixed ttk.TreeView selection operations with item id's
  24699. containing spaces.
  24700. - bpo-8637: Honor a pager set by the env var MANPAGER (in preference to one
  24701. set by the env var PAGER).
  24702. - bpo-16182: Fix various functions in the "readline" module to use the
  24703. locale encoding, and fix get_begidx() and get_endidx() to return code
  24704. point indexes.
  24705. - bpo-27392: Add loop.connect_accepted_socket(). Patch by Jim Fulton.
  24706. IDLE
  24707. ----
  24708. - bpo-27477: IDLE search dialogs now use ttk widgets.
  24709. - bpo-27173: Add 'IDLE Modern Unix' to the built-in key sets. Make the
  24710. default key set depend on the platform. Add tests for the changes to the
  24711. config module.
  24712. - bpo-27452: make command line "idle-test> python test_help.py" work.
  24713. __file__ is relative when python is started in the file's directory.
  24714. - bpo-27452: add line counter and crc to IDLE configHandler test dump.
  24715. - bpo-27380: IDLE: add query.py with base Query dialog and ttk widgets.
  24716. Module had subclasses SectionName, ModuleName, and HelpSource, which are
  24717. used to get information from users by configdialog and file =>Load Module.
  24718. Each subclass has itw own validity checks. Using ModuleName allows users
  24719. to edit bad module names instead of starting over. Add tests and delete
  24720. the two files combined into the new one.
  24721. - bpo-27372: Test_idle no longer changes the locale.
  24722. - bpo-27365: Allow non-ascii chars in IDLE NEWS.txt, for contributor names.
  24723. - bpo-27245: IDLE: Cleanly delete custom themes and key bindings.
  24724. Previously, when IDLE was started from a console or by import, a cascade
  24725. of warnings was emitted. Patch by Serhiy Storchaka.
  24726. - bpo-24137: Run IDLE, test_idle, and htest with tkinter default root
  24727. disabled. Fix code and tests that fail with this restriction. Fix htests
  24728. to not create a second and redundant root and mainloop.
  24729. - bpo-27310: Fix IDLE.app failure to launch on OS X due to vestigial import.
  24730. C API
  24731. -----
  24732. - bpo-26754: PyUnicode_FSDecoder() accepted a filename argument encoded as
  24733. an iterable of integers. Now only strings and byte-like objects are
  24734. accepted.
  24735. Build
  24736. -----
  24737. - bpo-28066: Fix the logic that searches build directories for generated
  24738. include files when building outside the source tree.
  24739. - bpo-27442: Expose the Android API level that python was built against, in
  24740. sysconfig.get_config_vars() as 'ANDROID_API_LEVEL'.
  24741. - bpo-27434: The interpreter that runs the cross-build, found in PATH, must
  24742. now be of the same feature version (e.g. 3.6) as the source being built.
  24743. - bpo-26930: Update Windows builds to use OpenSSL 1.0.2h.
  24744. - bpo-23968: Rename the platform directory from plat-$(MACHDEP) to
  24745. plat-$(PLATFORM_TRIPLET). Rename the config directory (LIBPL) from
  24746. config-$(LDVERSION) to config-$(LDVERSION)-$(PLATFORM_TRIPLET). Install
  24747. the platform specific _sysconfigdata module into the platform directory
  24748. and rename it to include the ABIFLAGS.
  24749. - Don't use largefile support for GNU/Hurd.
  24750. Tools/Demos
  24751. -----------
  24752. - bpo-27332: Fixed the type of the first argument of module-level functions
  24753. generated by Argument Clinic. Patch by Petr Viktorin.
  24754. - bpo-27418: Fixed Tools/importbench/importbench.py.
  24755. Documentation
  24756. -------------
  24757. - bpo-19489: Moved the search box from the sidebar to the header and footer
  24758. of each page. Patch by Ammar Askar.
  24759. - bpo-27285: Update documentation to reflect the deprecation of ``pyvenv``
  24760. and normalize on the term "virtual environment". Patch by Steve Piercy.
  24761. Tests
  24762. -----
  24763. - bpo-27027: Added test.support.is_android that is True when this is an
  24764. Android build.
  24765. What's New in Python 3.6.0 alpha 2?
  24766. ===================================
  24767. *Release date: 2016-06-13*
  24768. Security
  24769. --------
  24770. - bpo-26556: Update expat to 2.1.1, fixes CVE-2015-1283.
  24771. - Fix TLS stripping vulnerability in smtplib, CVE-2016-0772. Reported by
  24772. Team Oststrom.
  24773. - bpo-26839: On Linux, :func:`os.urandom` now calls ``getrandom()`` with
  24774. ``GRND_NONBLOCK`` to fall back on reading ``/dev/urandom`` if the urandom
  24775. entropy pool is not initialized yet. Patch written by Colm Buckley.
  24776. Core and Builtins
  24777. -----------------
  24778. - bpo-27095: Simplified MAKE_FUNCTION and removed MAKE_CLOSURE opcodes.
  24779. Patch by Demur Rumed.
  24780. - bpo-27190: Raise NotSupportedError if sqlite3 is older than 3.3.1. Patch
  24781. by Dave Sawyer.
  24782. - bpo-27286: Fixed compiling BUILD_MAP_UNPACK_WITH_CALL opcode. Calling
  24783. function with generalized unpacking (PEP 448) and conflicting keyword
  24784. names could cause undefined behavior.
  24785. - bpo-27140: Added BUILD_CONST_KEY_MAP opcode.
  24786. - bpo-27186: Add support for os.PathLike objects to open() (part of
  24787. :pep:`519`).
  24788. - bpo-27066: Fixed SystemError if a custom opener (for open()) returns a
  24789. negative number without setting an exception.
  24790. - bpo-26983: float() now always return an instance of exact float. The
  24791. deprecation warning is emitted if __float__ returns an instance of a
  24792. strict subclass of float. In a future versions of Python this can be an
  24793. error.
  24794. - bpo-27097: Python interpreter is now about 7% faster due to optimized
  24795. instruction decoding. Based on patch by Demur Rumed.
  24796. - bpo-26647: Python interpreter now uses 16-bit wordcode instead of
  24797. bytecode. Patch by Demur Rumed.
  24798. - bpo-23275: Allow assigning to an empty target list in round brackets: () =
  24799. iterable.
  24800. - bpo-27243: Update the __aiter__ protocol: instead of returning an
  24801. awaitable that resolves to an asynchronous iterator, the asynchronous
  24802. iterator should be returned directly. Doing the former will trigger a
  24803. PendingDeprecationWarning.
  24804. Library
  24805. -------
  24806. - Comment out socket (SO_REUSEPORT) and posix (O_SHLOCK, O_EXLOCK) constants
  24807. exposed on the API which are not implemented on GNU/Hurd. They would not
  24808. work at runtime anyway.
  24809. - bpo-27025: Generated names for Tkinter widgets are now more meaningful and
  24810. recognizable.
  24811. - bpo-25455: Fixed crashes in repr of recursive ElementTree.Element and
  24812. functools.partial objects.
  24813. - bpo-27294: Improved repr for Tkinter event objects.
  24814. - bpo-20508: Improve exception message of IPv{4,6}Network.__getitem__. Patch
  24815. by Gareth Rees.
  24816. - bpo-21386: Implement missing IPv4Address.is_global property. It was
  24817. documented since 07a5610bae9d. Initial patch by Roger Luethi.
  24818. - bpo-27029: Removed deprecated support of universal newlines mode from
  24819. ZipFile.open().
  24820. - bpo-27030: Unknown escapes consisting of ``'\'`` and an ASCII letter in
  24821. regular expressions now are errors. The re.LOCALE flag now can be used
  24822. only with bytes patterns.
  24823. - bpo-27186: Add os.PathLike support to DirEntry (part of :pep:`519`).
  24824. Initial patch by Jelle Zijlstra.
  24825. - bpo-20900: distutils register command now decodes HTTP responses
  24826. correctly. Initial patch by ingrid.
  24827. - bpo-27186: Add os.PathLike support to pathlib, removing its provisional
  24828. status (part of PEP 519). Initial patch by Dusty Phillips.
  24829. - bpo-27186: Add support for os.PathLike objects to os.fsencode() and
  24830. os.fsdecode() (part of :pep:`519`).
  24831. - bpo-27186: Introduce os.PathLike and os.fspath() (part of :pep:`519`).
  24832. - A new version of typing.py provides several new classes and features:
  24833. @overload outside stubs, Reversible, DefaultDict, Text, ContextManager,
  24834. Type[], NewType(), TYPE_CHECKING, and numerous bug fixes (note that some
  24835. of the new features are not yet implemented in mypy or other static
  24836. analyzers). Also classes for :pep:`492` (Awaitable, AsyncIterable,
  24837. AsyncIterator) have been added (in fact they made it into 3.5.1 but were
  24838. never mentioned).
  24839. - bpo-25738: Stop http.server.BaseHTTPRequestHandler.send_error() from
  24840. sending a message body for 205 Reset Content. Also, don't send Content
  24841. header fields in responses that don't have a body. Patch by Susumu
  24842. Koshiba.
  24843. - bpo-21313: Fix the "platform" module to tolerate when sys.version contains
  24844. truncated build information.
  24845. - bpo-23883: Added missing APIs to __all__ to match the documented APIs for
  24846. the following modules: cgi, mailbox, mimetypes, plistlib and smtpd.
  24847. Patches by Jacek Kołodziej.
  24848. - bpo-27164: In the zlib module, allow decompressing raw Deflate streams
  24849. with a predefined zdict. Based on patch by Xiang Zhang.
  24850. - bpo-24291: Fix wsgiref.simple_server.WSGIRequestHandler to completely
  24851. write data to the client. Previously it could do partial writes and
  24852. truncate data. Also, wsgiref.handler.ServerHandler can now handle stdout
  24853. doing partial writes, but this is deprecated.
  24854. - bpo-21272: Use _sysconfigdata.py to initialize distutils.sysconfig.
  24855. - bpo-19611: :mod:`inspect` now reports the implicit ``.0`` parameters
  24856. generated by the compiler for comprehension and generator expression
  24857. scopes as if they were positional-only parameters called ``implicit0``.
  24858. Patch by Jelle Zijlstra.
  24859. - bpo-26809: Add ``__all__`` to :mod:`string`. Patch by Emanuel Barry.
  24860. - bpo-26373: subprocess.Popen.communicate now correctly ignores
  24861. BrokenPipeError when the child process dies before .communicate() is
  24862. called in more/all circumstances.
  24863. - signal, socket, and ssl module IntEnum constant name lookups now return a
  24864. consistent name for values having multiple names. Ex: signal.Signals(6)
  24865. now refers to itself as signal.SIGALRM rather than flipping between that
  24866. and signal.SIGIOT based on the interpreter's hash randomization seed.
  24867. - bpo-27167: Clarify the subprocess.CalledProcessError error message text
  24868. when the child process died due to a signal.
  24869. - bpo-25931: Don't define socketserver.Forking* names on platforms such as
  24870. Windows that do not support os.fork().
  24871. - bpo-21776: distutils.upload now correctly handles HTTPError. Initial patch
  24872. by Claudiu Popa.
  24873. - bpo-26526: Replace custom parse tree validation in the parser module with
  24874. a simple DFA validator.
  24875. - bpo-27114: Fix SSLContext._load_windows_store_certs fails with
  24876. PermissionError
  24877. - bpo-18383: Avoid creating duplicate filters when using filterwarnings and
  24878. simplefilter. Based on patch by Alex Shkop.
  24879. - bpo-23026: winreg.QueryValueEx() now return an integer for REG_QWORD type.
  24880. - bpo-26741: subprocess.Popen destructor now emits a ResourceWarning warning
  24881. if the child process is still running.
  24882. - bpo-27056: Optimize pickle.load() and pickle.loads(), up to 10% faster to
  24883. deserialize a lot of small objects.
  24884. - bpo-21271: New keyword only parameters in reset_mock call.
  24885. IDLE
  24886. ----
  24887. - bpo-5124: Paste with text selected now replaces the selection on X11. This
  24888. matches how paste works on Windows, Mac, most modern Linux apps, and ttk
  24889. widgets. Original patch by Serhiy Storchaka.
  24890. - bpo-24750: Switch all scrollbars in IDLE to ttk versions. Where needed,
  24891. minimal tests are added to cover changes.
  24892. - bpo-24759: IDLE requires tk 8.5 and availability ttk widgets. Delete now
  24893. unneeded tk version tests and code for older versions. Add test for IDLE
  24894. syntax colorizer.
  24895. - bpo-27239: idlelib.macosx.isXyzTk functions initialize as needed.
  24896. - bpo-27262: move Aqua unbinding code, which enable context menus, to
  24897. macosx.
  24898. - bpo-24759: Make clear in idlelib.idle_test.__init__ that the directory is
  24899. a private implementation of test.test_idle and tool for maintainers.
  24900. - bpo-27196: Stop 'ThemeChanged' warnings when running IDLE tests. These
  24901. persisted after other warnings were suppressed in #20567. Apply Serhiy
  24902. Storchaka's update_idletasks solution to four test files. Record this
  24903. additional advice in idle_test/README.txt
  24904. - bpo-20567: Revise idle_test/README.txt with advice about avoiding tk
  24905. warning messages from tests. Apply advice to several IDLE tests.
  24906. - bpo-24225: Update idlelib/README.txt with new file names and event
  24907. handlers.
  24908. - bpo-27156: Remove obsolete code not used by IDLE.
  24909. - bpo-27117: Make colorizer htest and turtledemo work with dark themes. Move
  24910. code for configuring text widget colors to a new function.
  24911. - bpo-24225: Rename many ``idlelib/*.py`` and ``idle_test/test_*.py`` files.
  24912. Edit files to replace old names with new names when the old name referred
  24913. to the module rather than the class it contained. See the issue and IDLE
  24914. section in What's New in 3.6 for more.
  24915. - bpo-26673: When tk reports font size as 0, change to size 10. Such fonts
  24916. on Linux prevented the configuration dialog from opening.
  24917. - bpo-21939: Add test for IDLE's percolator. Original patch by Saimadhav
  24918. Heblikar.
  24919. - bpo-21676: Add test for IDLE's replace dialog. Original patch by Saimadhav
  24920. Heblikar.
  24921. - bpo-18410: Add test for IDLE's search dialog. Original patch by Westley
  24922. Martínez.
  24923. - bpo-21703: Add test for undo delegator. Patch mostly by Saimadhav
  24924. Heblikar .
  24925. - bpo-27044: Add ConfigDialog.remove_var_callbacks to stop memory leaks.
  24926. - bpo-23977: Add more asserts to test_delegator.
  24927. Documentation
  24928. -------------
  24929. - bpo-16484: Change the default PYTHONDOCS URL to "https:", and fix the
  24930. resulting links to use lowercase. Patch by Sean Rodman, test by Kaushik
  24931. Nadikuditi.
  24932. - bpo-24136: Document the new :pep:`448` unpacking syntax of 3.5.
  24933. - bpo-22558: Add remaining doc links to source code for Python-coded
  24934. modules. Patch by Yoni Lavi.
  24935. Tests
  24936. -----
  24937. - bpo-25285: regrtest now uses subprocesses when the -j1 command line option
  24938. is used: each test file runs in a fresh child process. Before, the -j1
  24939. option was ignored.
  24940. - bpo-25285: Tools/buildbot/test.bat script now uses -j1 by default to run
  24941. each test file in fresh child process.
  24942. Windows
  24943. -------
  24944. - bpo-27064: The py.exe launcher now defaults to Python 3. The Windows
  24945. launcher ``py.exe`` no longer prefers an installed Python 2 version over
  24946. Python 3 by default when used interactively.
  24947. - bpo-17500: Remove unused and outdated icons. (See also:
  24948. https://github.com/python/pythondotorg/issues/945)
  24949. Build
  24950. -----
  24951. - bpo-27229: Fix the cross-compiling pgen rule for in-tree builds. Patch by
  24952. Xavier de Gaye.
  24953. - bpo-26930: Update OS X 10.5+ 32-bit-only installer to build and link with
  24954. OpenSSL 1.0.2h.
  24955. C API
  24956. -----
  24957. - bpo-27186: Add the PyOS_FSPath() function (part of :pep:`519`).
  24958. - bpo-26282: PyArg_ParseTupleAndKeywords() now supports positional-only
  24959. parameters.
  24960. Tools/Demos
  24961. -----------
  24962. - bpo-26282: Argument Clinic now supports positional-only and keyword
  24963. parameters in the same function.
  24964. What's New in Python 3.6.0 alpha 1?
  24965. ===================================
  24966. *Release date: 2016-05-16*
  24967. Security
  24968. --------
  24969. - bpo-26657: Fix directory traversal vulnerability with http.server on
  24970. Windows. This fixes a regression that was introduced in 3.3.4rc1 and
  24971. 3.4.0rc1. Based on patch by Philipp Hagemeister.
  24972. - bpo-26313: ssl.py _load_windows_store_certs fails if windows cert store is
  24973. empty. Patch by Baji.
  24974. - bpo-25939: On Windows open the cert store readonly in
  24975. ssl.enum_certificates.
  24976. Core and Builtins
  24977. -----------------
  24978. - bpo-20041: Fixed TypeError when frame.f_trace is set to None. Patch by
  24979. Xavier de Gaye.
  24980. - bpo-26168: Fixed possible refleaks in failing Py_BuildValue() with the "N"
  24981. format unit.
  24982. - bpo-26991: Fix possible refleak when creating a function with annotations.
  24983. - bpo-27039: Fixed bytearray.remove() for values greater than 127. Based on
  24984. patch by Joe Jevnik.
  24985. - bpo-23640: int.from_bytes() no longer bypasses constructors for
  24986. subclasses.
  24987. - bpo-27005: Optimized the float.fromhex() class method for exact float. It
  24988. is now 2 times faster.
  24989. - bpo-18531: Single var-keyword argument of dict subtype was passed
  24990. unscathed to the C-defined function. Now it is converted to exact dict.
  24991. - bpo-26811: gc.get_objects() no longer contains a broken tuple with NULL
  24992. pointer.
  24993. - bpo-20120: Use RawConfigParser for .pypirc parsing, removing support for
  24994. interpolation unintentionally added with move to Python 3. Behavior no
  24995. longer does any interpolation in .pypirc files, matching behavior in
  24996. Python 2.7 and Setuptools 19.0.
  24997. - bpo-26249: Memory functions of the :c:func:`PyMem_Malloc` domain
  24998. (:c:macro:`PYMEM_DOMAIN_MEM`) now use the :ref:`pymalloc allocator
  24999. <pymalloc>` rather than system :c:func:`malloc`. Applications calling
  25000. :c:func:`PyMem_Malloc` without holding the GIL can now crash: use
  25001. ``PYTHONMALLOC=debug`` environment variable to validate the usage of
  25002. memory allocators in your application.
  25003. - bpo-26802: Optimize function calls only using unpacking like
  25004. ``func(*tuple)`` (no other positional argument, no keyword): avoid copying
  25005. the tuple. Patch written by Joe Jevnik.
  25006. - bpo-26659: Make the builtin slice type support cycle collection.
  25007. - bpo-26718: super.__init__ no longer leaks memory if called multiple times.
  25008. NOTE: A direct call of super.__init__ is not endorsed!
  25009. - bpo-27138: Fix the doc comment for FileFinder.find_spec().
  25010. - bpo-27147: Mention :pep:`420` in the importlib docs.
  25011. - bpo-25339: PYTHONIOENCODING now has priority over locale in setting the
  25012. error handler for stdin and stdout.
  25013. - bpo-26494: Fixed crash on iterating exhausting iterators. Affected classes
  25014. are generic sequence iterators, iterators of str, bytes, bytearray, list,
  25015. tuple, set, frozenset, dict, OrderedDict, corresponding views and
  25016. os.scandir() iterator.
  25017. - bpo-26574: Optimize ``bytes.replace(b'', b'.')`` and
  25018. ``bytearray.replace(b'', b'.')``. Patch written by Josh Snider.
  25019. - bpo-26581: If coding cookie is specified multiple times on a line in
  25020. Python source code file, only the first one is taken to account.
  25021. - bpo-19711: Add tests for reloading namespace packages.
  25022. - bpo-21099: Switch applicable importlib tests to use :pep:`451` API.
  25023. - bpo-26563: Debug hooks on Python memory allocators now raise a fatal error
  25024. if functions of the :c:func:`PyMem_Malloc` family are called without
  25025. holding the GIL.
  25026. - bpo-26564: On error, the debug hooks on Python memory allocators now use
  25027. the :mod:`tracemalloc` module to get the traceback where a memory block
  25028. was allocated.
  25029. - bpo-26558: The debug hooks on Python memory allocator
  25030. :c:func:`PyObject_Malloc` now detect when functions are called without
  25031. holding the GIL.
  25032. - bpo-26516: Add :envvar:`PYTHONMALLOC` environment variable to set the
  25033. Python memory allocators and/or install debug hooks.
  25034. - bpo-26516: The :c:func:`PyMem_SetupDebugHooks` function can now also be
  25035. used on Python compiled in release mode.
  25036. - bpo-26516: The :envvar:`PYTHONMALLOCSTATS` environment variable can now
  25037. also be used on Python compiled in release mode. It now has no effect if
  25038. set to an empty string.
  25039. - bpo-26516: In debug mode, debug hooks are now also installed on Python
  25040. memory allocators when Python is configured without pymalloc.
  25041. - bpo-26464: Fix str.translate() when string is ASCII and first replacements
  25042. removes character, but next replacement uses a non-ASCII character or a
  25043. string longer than 1 character. Regression introduced in Python 3.5.0.
  25044. - bpo-22836: Ensure exception reports from PyErr_Display() and
  25045. PyErr_WriteUnraisable() are sensible even when formatting them produces
  25046. secondary errors. This affects the reports produced by
  25047. sys.__excepthook__() and when __del__() raises an exception.
  25048. - bpo-26302: Correct behavior to reject comma as a legal character for
  25049. cookie names.
  25050. - bpo-26136: Upgrade the warning when a generator raises StopIteration from
  25051. PendingDeprecationWarning to DeprecationWarning. Patch by Anish Shah.
  25052. - bpo-26204: The compiler now ignores all constant statements: bytes, str,
  25053. int, float, complex, name constants (None, False, True), Ellipsis and
  25054. ast.Constant; not only str and int. For example, ``1.0`` is now ignored in
  25055. ``def f(): 1.0``.
  25056. - bpo-4806: Avoid masking the original TypeError exception when using star
  25057. (``*``) unpacking in function calls. Based on patch by Hagen Fürstenau
  25058. and Daniel Urban.
  25059. - bpo-26146: Add a new kind of AST node: ``ast.Constant``. It can be used by
  25060. external AST optimizers, but the compiler does not emit directly such
  25061. node.
  25062. - bpo-23601: Sped-up allocation of dict key objects by using Python's small
  25063. object allocator. (Contributed by Julian Taylor.)
  25064. - bpo-18018: Import raises ImportError instead of SystemError if a relative
  25065. import is attempted without a known parent package.
  25066. - bpo-25843: When compiling code, don't merge constants if they are equal
  25067. but have a different types. For example, ``f1, f2 = lambda: 1, lambda:
  25068. 1.0`` is now correctly compiled to two different functions: ``f1()``
  25069. returns ``1`` (``int``) and ``f2()`` returns ``1.0`` (``float``), even if
  25070. ``1`` and ``1.0`` are equal.
  25071. - bpo-26107: The format of the ``co_lnotab`` attribute of code objects
  25072. changes to support negative line number delta.
  25073. - bpo-26154: Add a new private _PyThreadState_UncheckedGet() function to get
  25074. the current Python thread state, but don't issue a fatal error if it is
  25075. NULL. This new function must be used instead of accessing directly the
  25076. _PyThreadState_Current variable. The variable is no more exposed since
  25077. Python 3.5.1 to hide the exact implementation of atomic C types, to avoid
  25078. compiler issues.
  25079. - bpo-25791: If __package__ != __spec__.parent or if neither __package__ or
  25080. __spec__ are defined then ImportWarning is raised.
  25081. - bpo-22995: [UPDATE] Comment out the one of the pickleability tests in
  25082. _PyObject_GetState() due to regressions observed in Cython-based projects.
  25083. - bpo-25961: Disallowed null characters in the type name.
  25084. - bpo-25973: Fix segfault when an invalid nonlocal statement binds a name
  25085. starting with two underscores.
  25086. - bpo-22995: Instances of extension types with a state that aren't
  25087. subclasses of list or dict and haven't implemented any pickle-related
  25088. methods (__reduce__, __reduce_ex__, __getnewargs__, __getnewargs_ex__, or
  25089. __getstate__), can no longer be pickled. Including memoryview.
  25090. - bpo-20440: Massive replacing unsafe attribute setting code with special
  25091. macro Py_SETREF.
  25092. - bpo-25766: Special method __bytes__() now works in str subclasses.
  25093. - bpo-25421: __sizeof__ methods of builtin types now use dynamic basic size.
  25094. This allows sys.getsize() to work correctly with their subclasses with
  25095. __slots__ defined.
  25096. - bpo-25709: Fixed problem with in-place string concatenation and utf-8
  25097. cache.
  25098. - bpo-5319: New Py_FinalizeEx() API allowing Python to set an exit status of
  25099. 120 on failure to flush buffered streams.
  25100. - bpo-25485: telnetlib.Telnet is now a context manager.
  25101. - bpo-24097: Fixed crash in object.__reduce__() if slot name is freed inside
  25102. __getattr__.
  25103. - bpo-24731: Fixed crash on converting objects with special methods
  25104. __bytes__, __trunc__, and __float__ returning instances of subclasses of
  25105. bytes, int, and float to subclasses of bytes, int, and float
  25106. correspondingly.
  25107. - bpo-25630: Fix a possible segfault during argument parsing in functions
  25108. that accept filesystem paths.
  25109. - bpo-23564: Fixed a partially broken sanity check in the _posixsubprocess
  25110. internals regarding how fds_to_pass were passed to the child. The bug had
  25111. no actual impact as subprocess.py already avoided it.
  25112. - bpo-25388: Fixed tokenizer crash when processing undecodable source code
  25113. with a null byte.
  25114. - bpo-25462: The hash of the key now is calculated only once in most
  25115. operations in C implementation of OrderedDict.
  25116. - bpo-22995: Default implementation of __reduce__ and __reduce_ex__ now
  25117. rejects builtin types with not defined __new__.
  25118. - bpo-24802: Avoid buffer overreads when int(), float(), compile(), exec()
  25119. and eval() are passed bytes-like objects. These objects are not
  25120. necessarily terminated by a null byte, but the functions assumed they
  25121. were.
  25122. - bpo-25555: Fix parser and AST: fill lineno and col_offset of "arg" node
  25123. when compiling AST from Python objects.
  25124. - bpo-24726: Fixed a crash and leaking NULL in repr() of OrderedDict that
  25125. was mutated by direct calls of dict methods.
  25126. - bpo-25449: Iterating OrderedDict with keys with unstable hash now raises
  25127. KeyError in C implementations as well as in Python implementation.
  25128. - bpo-25395: Fixed crash when highly nested OrderedDict structures were
  25129. garbage collected.
  25130. - bpo-25401: Optimize bytes.fromhex() and bytearray.fromhex(): they are now
  25131. between 2x and 3.5x faster.
  25132. - bpo-25399: Optimize bytearray % args using the new private _PyBytesWriter
  25133. API. Formatting is now between 2.5 and 5 times faster.
  25134. - bpo-25274: sys.setrecursionlimit() now raises a RecursionError if the new
  25135. recursion limit is too low depending at the current recursion depth.
  25136. Modify also the "lower-water mark" formula to make it monotonic. This mark
  25137. is used to decide when the overflowed flag of the thread state is reset.
  25138. - bpo-24402: Fix input() to prompt to the redirected stdout when
  25139. sys.stdout.fileno() fails.
  25140. - bpo-25349: Optimize bytes % args using the new private _PyBytesWriter API.
  25141. Formatting is now up to 2 times faster.
  25142. - bpo-24806: Prevent builtin types that are not allowed to be subclassed
  25143. from being subclassed through multiple inheritance.
  25144. - bpo-25301: The UTF-8 decoder is now up to 15 times as fast for error
  25145. handlers: ``ignore``, ``replace`` and ``surrogateescape``.
  25146. - bpo-24848: Fixed a number of bugs in UTF-7 decoding of misformed data.
  25147. - bpo-25267: The UTF-8 encoder is now up to 75 times as fast for error
  25148. handlers: ``ignore``, ``replace``, ``surrogateescape``, ``surrogatepass``.
  25149. Patch co-written with Serhiy Storchaka.
  25150. - bpo-25280: Import trace messages emitted in verbose (-v) mode are no
  25151. longer formatted twice.
  25152. - bpo-25227: Optimize ASCII and latin1 encoders with the ``surrogateescape``
  25153. error handler: the encoders are now up to 3 times as fast. Initial patch
  25154. written by Serhiy Storchaka.
  25155. - bpo-25003: On Solaris 11.3 or newer, os.urandom() now uses the getrandom()
  25156. function instead of the getentropy() function. The getentropy() function
  25157. is blocking to generate very good quality entropy, os.urandom() doesn't
  25158. need such high-quality entropy.
  25159. - bpo-9232: Modify Python's grammar to allow trailing commas in the argument
  25160. list of a function declaration. For example, "def f(\*, a = 3,): pass" is
  25161. now legal. Patch from Mark Dickinson.
  25162. - bpo-24965: Implement :pep:`498` "Literal String Interpolation". This
  25163. allows you to embed expressions inside f-strings, which are converted to
  25164. normal strings at run time. Given x=3, then f'value={x}' == 'value=3'.
  25165. Patch by Eric V. Smith.
  25166. - bpo-26478: Fix semantic bugs when using binary operators with dictionary
  25167. views and tuples.
  25168. - bpo-26171: Fix possible integer overflow and heap corruption in
  25169. zipimporter.get_data().
  25170. - bpo-25660: Fix TAB key behaviour in REPL with readline.
  25171. - bpo-26288: Optimize PyLong_AsDouble.
  25172. - bpo-26289: Optimize floor and modulo division for single-digit longs.
  25173. Microbenchmarks show 2-2.5x improvement. Built-in 'divmod' function is
  25174. now also ~10% faster. (See also: bpo-26315)
  25175. - bpo-25887: Raise a RuntimeError when a coroutine object is awaited more
  25176. than once.
  25177. Library
  25178. -------
  25179. - bpo-27057: Fix os.set_inheritable() on Android, ioctl() is blocked by
  25180. SELinux and fails with EACCESS. The function now falls back to fcntl().
  25181. Patch written by Michał Bednarski.
  25182. - bpo-27014: Fix infinite recursion using typing.py. Thanks to Kalle Tuure!
  25183. - bpo-27031: Removed dummy methods in Tkinter widget classes: tk_menuBar()
  25184. and tk_bindForTraversal().
  25185. - bpo-14132: Fix urllib.request redirect handling when the target only has a
  25186. query string. Original fix by Ján Janech.
  25187. - bpo-17214: The "urllib.request" module now percent-encodes non-ASCII bytes
  25188. found in redirect target URLs. Some servers send Location header fields
  25189. with non-ASCII bytes, but "http.client" requires the request target to be
  25190. ASCII-encodable, otherwise a UnicodeEncodeError is raised. Based on patch
  25191. by Christian Heimes.
  25192. - bpo-27033: The default value of the decode_data parameter for
  25193. smtpd.SMTPChannel and smtpd.SMTPServer constructors is changed to False.
  25194. - bpo-27034: Removed deprecated class asynchat.fifo.
  25195. - bpo-26870: Added readline.set_auto_history(), which can stop entries being
  25196. automatically added to the history list. Based on patch by Tyler
  25197. Crompton.
  25198. - bpo-26039: zipfile.ZipFile.open() can now be used to write data into a ZIP
  25199. file, as well as for extracting data. Patch by Thomas Kluyver.
  25200. - bpo-26892: Honor debuglevel flag in urllib.request.HTTPHandler. Patch
  25201. contributed by Chi Hsuan Yen.
  25202. - bpo-22274: In the subprocess module, allow stderr to be redirected to
  25203. stdout even when stdout is not redirected. Patch by Akira Li.
  25204. - bpo-26807: mock_open 'files' no longer error on readline at end of file.
  25205. Patch from Yolanda Robla.
  25206. - bpo-25745: Fixed leaking a userptr in curses panel destructor.
  25207. - bpo-26977: Removed unnecessary, and ignored, call to sum of squares helper
  25208. in statistics.pvariance.
  25209. - bpo-26002: Use bisect in statistics.median instead of a linear search.
  25210. Patch by Upendra Kuma.
  25211. - bpo-25974: Make use of new Decimal.as_integer_ratio() method in statistics
  25212. module. Patch by Stefan Krah.
  25213. - bpo-26996: Add secrets module as described in :pep:`506`.
  25214. - bpo-26881: The modulefinder module now supports extended opcode arguments.
  25215. - bpo-23815: Fixed crashes related to directly created instances of types in
  25216. _tkinter and curses.panel modules.
  25217. - bpo-17765: weakref.ref() no longer silently ignores keyword arguments.
  25218. Patch by Georg Brandl.
  25219. - bpo-26873: xmlrpc now raises ResponseError on unsupported type tags
  25220. instead of silently return incorrect result.
  25221. - bpo-26915: The __contains__ methods in the collections ABCs now check for
  25222. identity before checking equality. This better matches the behavior of
  25223. the concrete classes, allows sensible handling of NaNs, and makes it
  25224. easier to reason about container invariants.
  25225. - bpo-26711: Fixed the comparison of plistlib.Data with other types.
  25226. - bpo-24114: Fix an uninitialized variable in ``ctypes.util``. The bug only
  25227. occurs on SunOS when the ctypes implementation searches for the ``crle``
  25228. program. Patch by Xiang Zhang. Tested on SunOS by Kees Bos.
  25229. - bpo-26864: In urllib.request, change the proxy bypass host checking
  25230. against no_proxy to be case-insensitive, and to not match unrelated host
  25231. names that happen to have a bypassed hostname as a suffix. Patch by Xiang
  25232. Zhang.
  25233. - bpo-24902: Print server URL on http.server startup. Initial patch by
  25234. Felix Kaiser.
  25235. - bpo-25788: fileinput.hook_encoded() now supports an "errors" argument for
  25236. passing to open. Original patch by Joseph Hackman.
  25237. - bpo-26634: recursive_repr() now sets __qualname__ of wrapper. Patch by
  25238. Xiang Zhang.
  25239. - bpo-26804: urllib.request will prefer lower_case proxy environment
  25240. variables over UPPER_CASE or Mixed_Case ones. Patch contributed by
  25241. Hans-Peter Jansen.
  25242. - bpo-26837: assertSequenceEqual() now correctly outputs non-stringified
  25243. differing items (like bytes in the -b mode). This affects
  25244. assertListEqual() and assertTupleEqual().
  25245. - bpo-26041: Remove "will be removed in Python 3.7" from deprecation
  25246. messages of platform.dist() and platform.linux_distribution(). Patch by
  25247. Kumaripaba Miyurusara Athukorala.
  25248. - bpo-26822: itemgetter, attrgetter and methodcaller objects no longer
  25249. silently ignore keyword arguments.
  25250. - bpo-26733: Disassembling a class now disassembles class and static
  25251. methods. Patch by Xiang Zhang.
  25252. - bpo-26801: Fix error handling in :func:`shutil.get_terminal_size`, catch
  25253. :exc:`AttributeError` instead of :exc:`NameError`. Patch written by
  25254. Emanuel Barry.
  25255. - bpo-24838: tarfile's ustar and gnu formats now correctly calculate name
  25256. and link field limits for multibyte character encodings like utf-8.
  25257. - bpo-26717: Stop encoding Latin-1-ized WSGI paths with UTF-8. Patch by
  25258. Anthony Sottile.
  25259. - bpo-26782: Add STARTUPINFO to subprocess.__all__ on Windows.
  25260. - bpo-26404: Add context manager to socketserver. Patch by Aviv Palivoda.
  25261. - bpo-26735: Fix :func:`os.urandom` on Solaris 11.3 and newer when reading
  25262. more than 1,024 bytes: call ``getrandom()`` multiple times with a limit of
  25263. 1024 bytes per call.
  25264. - bpo-26585: Eliminate http.server._quote_html() and use
  25265. html.escape(quote=False). Patch by Xiang Zhang.
  25266. - bpo-26685: Raise OSError if closing a socket fails.
  25267. - bpo-16329: Add .webm to mimetypes.types_map. Patch by Giampaolo Rodola'.
  25268. - bpo-13952: Add .csv to mimetypes.types_map. Patch by Geoff Wilson.
  25269. - bpo-26587: the site module now allows .pth files to specify files to be
  25270. added to sys.path (e.g. zip files).
  25271. - bpo-25609: Introduce contextlib.AbstractContextManager and
  25272. typing.ContextManager.
  25273. - bpo-26709: Fixed Y2038 problem in loading binary PLists.
  25274. - bpo-23735: Handle terminal resizing with Readline 6.3+ by installing our
  25275. own SIGWINCH handler. Patch by Eric Price.
  25276. - bpo-25951: Change SSLSocket.sendall() to return None, as explicitly
  25277. documented for plain socket objects. Patch by Aviv Palivoda.
  25278. - bpo-26586: In http.server, respond with "413 Request header fields too
  25279. large" if there are too many header fields to parse, rather than killing
  25280. the connection and raising an unhandled exception. Patch by Xiang Zhang.
  25281. - bpo-26676: Added missing XMLPullParser to ElementTree.__all__.
  25282. - bpo-22854: Change BufferedReader.writable() and BufferedWriter.readable()
  25283. to always return False.
  25284. - bpo-26492: Exhausted iterator of array.array now conforms with the
  25285. behavior of iterators of other mutable sequences: it lefts exhausted even
  25286. if iterated array is extended.
  25287. - bpo-26641: doctest.DocFileTest and doctest.testfile() now support packages
  25288. (module splitted into multiple directories) for the package parameter.
  25289. - bpo-25195: Fix a regression in mock.MagicMock. _Call is a subclass of
  25290. tuple (changeset 3603bae63c13 only works for classes) so we need to
  25291. implement __ne__ ourselves. Patch by Andrew Plummer.
  25292. - bpo-26644: Raise ValueError rather than SystemError when a negative length
  25293. is passed to SSLSocket.recv() or read().
  25294. - bpo-23804: Fix SSL recv(0) and read(0) methods to return zero bytes
  25295. instead of up to 1024.
  25296. - bpo-26616: Fixed a bug in datetime.astimezone() method.
  25297. - bpo-26637: The :mod:`importlib` module now emits an :exc:`ImportError`
  25298. rather than a :exc:`TypeError` if :func:`__import__` is tried during the
  25299. Python shutdown process but :data:`sys.path` is already cleared (set to
  25300. ``None``).
  25301. - bpo-21925: :func:`warnings.formatwarning` now catches exceptions when
  25302. calling :func:`linecache.getline` and
  25303. :func:`tracemalloc.get_object_traceback` to be able to log
  25304. :exc:`ResourceWarning` emitted late during the Python shutdown process.
  25305. - bpo-23848: On Windows, faulthandler.enable() now also installs an
  25306. exception handler to dump the traceback of all Python threads on any
  25307. Windows exception, not only on UNIX signals (SIGSEGV, SIGFPE, SIGABRT).
  25308. - bpo-26530: Add C functions :c:func:`_PyTraceMalloc_Track` and
  25309. :c:func:`_PyTraceMalloc_Untrack` to track memory blocks using the
  25310. :mod:`tracemalloc` module. Add :c:func:`_PyTraceMalloc_GetTraceback` to
  25311. get the traceback of an object.
  25312. - bpo-26588: The _tracemalloc now supports tracing memory allocations of
  25313. multiple address spaces (domains).
  25314. - bpo-24266: Ctrl+C during Readline history search now cancels the search
  25315. mode when compiled with Readline 7.
  25316. - bpo-26590: Implement a safe finalizer for the _socket.socket type. It now
  25317. releases the GIL to close the socket.
  25318. - bpo-18787: spwd.getspnam() now raises a PermissionError if the user
  25319. doesn't have privileges.
  25320. - bpo-26560: Avoid potential ValueError in BaseHandler.start_response.
  25321. Initial patch by Peter Inglesby.
  25322. - bpo-26567: Add a new function :c:func:`PyErr_ResourceWarning` function to
  25323. pass the destroyed object. Add a *source* attribute to
  25324. :class:`warnings.WarningMessage`. Add warnings._showwarnmsg() which uses
  25325. tracemalloc to get the traceback where source object was allocated.
  25326. - bpo-26569: Fix :func:`pyclbr.readmodule` and :func:`pyclbr.readmodule_ex`
  25327. to support importing packages.
  25328. - bpo-26499: Account for remaining Content-Length in HTTPResponse.readline()
  25329. and read1(). Based on patch by Silent Ghost. Also document that
  25330. HTTPResponse now supports these methods.
  25331. - bpo-25320: Handle sockets in directories unittest discovery is scanning.
  25332. Patch from Victor van den Elzen.
  25333. - bpo-16181: cookiejar.http2time() now returns None if year is higher than
  25334. datetime.MAXYEAR.
  25335. - bpo-26513: Fixes platform module detection of Windows Server
  25336. - bpo-23718: Fixed parsing time in week 0 before Jan 1. Original patch by
  25337. Tamás Bence Gedai.
  25338. - bpo-26323: Add Mock.assert_called() and Mock.assert_called_once() methods
  25339. to unittest.mock. Patch written by Amit Saha.
  25340. - bpo-20589: Invoking Path.owner() and Path.group() on Windows now raise
  25341. NotImplementedError instead of ImportError.
  25342. - bpo-26177: Fixed the keys() method for Canvas and Scrollbar widgets.
  25343. - bpo-15068: Got rid of excessive buffering in fileinput. The bufsize
  25344. parameter is now deprecated and ignored.
  25345. - bpo-19475: Added an optional argument timespec to the datetime isoformat()
  25346. method to choose the precision of the time component.
  25347. - bpo-2202: Fix UnboundLocalError in
  25348. AbstractDigestAuthHandler.get_algorithm_impls. Initial patch by Mathieu
  25349. Dupuy.
  25350. - bpo-26167: Minimized overhead in copy.copy() and copy.deepcopy().
  25351. Optimized copying and deepcopying bytearrays, NotImplemented, slices,
  25352. short lists, tuples, dicts, sets.
  25353. - bpo-25718: Fixed pickling and copying the accumulate() iterator with total
  25354. is None.
  25355. - bpo-26475: Fixed debugging output for regular expressions with the (?x)
  25356. flag.
  25357. - bpo-26482: Allowed pickling recursive dequeues.
  25358. - bpo-26335: Make mmap.write() return the number of bytes written like other
  25359. write methods. Patch by Jakub Stasiak.
  25360. - bpo-26457: Fixed the subnets() methods in IP network classes for the case
  25361. when resulting prefix length is equal to maximal prefix length. Based on
  25362. patch by Xiang Zhang.
  25363. - bpo-26385: Remove the file if the internal open() call in
  25364. NamedTemporaryFile() fails. Patch by Silent Ghost.
  25365. - bpo-26402: Fix XML-RPC client to retry when the server shuts down a
  25366. persistent connection. This was a regression related to the new
  25367. http.client.RemoteDisconnected exception in 3.5.0a4.
  25368. - bpo-25913: Leading ``<~`` is optional now in base64.a85decode() with
  25369. adobe=True. Patch by Swati Jaiswal.
  25370. - bpo-26186: Remove an invalid type check in importlib.util.LazyLoader.
  25371. - bpo-26367: importlib.__import__() raises ImportError like
  25372. builtins.__import__() when ``level`` is specified but without an
  25373. accompanying package specified.
  25374. - bpo-26309: In the "socketserver" module, shut down the request (closing
  25375. the connected socket) when verify_request() returns false. Patch by Aviv
  25376. Palivoda.
  25377. - bpo-23430: Change the socketserver module to only catch exceptions raised
  25378. from a request handler that are derived from Exception (instead of
  25379. BaseException). Therefore SystemExit and KeyboardInterrupt no longer
  25380. trigger the handle_error() method, and will now to stop a single-threaded
  25381. server.
  25382. - bpo-25995: os.walk() no longer uses FDs proportional to the tree depth.
  25383. - bpo-25994: Added the close() method and the support of the context manager
  25384. protocol for the os.scandir() iterator.
  25385. - bpo-23992: multiprocessing: make MapResult not fail-fast upon exception.
  25386. - bpo-26243: Support keyword arguments to zlib.compress(). Patch by Aviv
  25387. Palivoda.
  25388. - bpo-26117: The os.scandir() iterator now closes file descriptor not only
  25389. when the iteration is finished, but when it was failed with error.
  25390. - bpo-25949: __dict__ for an OrderedDict instance is now created only when
  25391. needed.
  25392. - bpo-25911: Restored support of bytes paths in os.walk() on Windows.
  25393. - bpo-26045: Add UTF-8 suggestion to error message when posting a
  25394. non-Latin-1 string with http.client.
  25395. - bpo-26039: Added zipfile.ZipInfo.from_file() and zipinfo.ZipInfo.is_dir().
  25396. Patch by Thomas Kluyver.
  25397. - bpo-12923: Reset FancyURLopener's redirect counter even if there is an
  25398. exception. Based on patches by Brian Brazil and Daniel Rocco.
  25399. - bpo-25945: Fixed a crash when unpickle the functools.partial object with
  25400. wrong state. Fixed a leak in failed functools.partial constructor. "args"
  25401. and "keywords" attributes of functools.partial have now always types tuple
  25402. and dict correspondingly.
  25403. - bpo-26202: copy.deepcopy() now correctly copies range() objects with
  25404. non-atomic attributes.
  25405. - bpo-23076: Path.glob() now raises a ValueError if it's called with an
  25406. invalid pattern. Patch by Thomas Nyberg.
  25407. - bpo-19883: Fixed possible integer overflows in zipimport.
  25408. - bpo-26227: On Windows, getnameinfo(), gethostbyaddr() and
  25409. gethostbyname_ex() functions of the socket module now decode the hostname
  25410. from the ANSI code page rather than UTF-8.
  25411. - bpo-26099: The site module now writes an error into stderr if
  25412. sitecustomize module can be imported but executing the module raise an
  25413. ImportError. Same change for usercustomize.
  25414. - bpo-26147: xmlrpc now works with strings not encodable with used non-UTF-8
  25415. encoding.
  25416. - bpo-25935: Garbage collector now breaks reference loops with OrderedDict.
  25417. - bpo-16620: Fixed AttributeError in msilib.Directory.glob().
  25418. - bpo-26013: Added compatibility with broken protocol 2 pickles created in
  25419. old Python 3 versions (3.4.3 and lower).
  25420. - bpo-26129: Deprecated accepting non-integers in grp.getgrgid().
  25421. - bpo-25850: Use cross-compilation by default for 64-bit Windows.
  25422. - bpo-25822: Add docstrings to the fields of urllib.parse results. Patch
  25423. contributed by Swati Jaiswal.
  25424. - bpo-22642: Convert trace module option parsing mechanism to argparse.
  25425. Patch contributed by SilentGhost.
  25426. - bpo-24705: Fix sysconfig._parse_makefile not expanding ${} vars appearing
  25427. before $() vars.
  25428. - bpo-26069: Remove the deprecated apis in the trace module.
  25429. - bpo-22138: Fix mock.patch behavior when patching descriptors. Restore
  25430. original values after patching. Patch contributed by Sean McCully.
  25431. - bpo-25672: In the ssl module, enable the SSL_MODE_RELEASE_BUFFERS mode
  25432. option if it is safe to do so.
  25433. - bpo-26012: Don't traverse into symlinks for ``**`` pattern in
  25434. pathlib.Path.[r]glob().
  25435. - bpo-24120: Ignore PermissionError when traversing a tree with
  25436. pathlib.Path.[r]glob(). Patch by Ulrich Petri.
  25437. - bpo-21815: Accept ] characters in the data portion of imap responses, in
  25438. order to handle the flags with square brackets accepted and produced by
  25439. servers such as gmail.
  25440. - bpo-25447: fileinput now uses sys.stdin as-is if it does not have a buffer
  25441. attribute (restores backward compatibility).
  25442. - bpo-25971: Optimized creating Fractions from floats by 2 times and from
  25443. Decimals by 3 times.
  25444. - bpo-25802: Document as deprecated the remaining implementations of
  25445. importlib.abc.Loader.load_module().
  25446. - bpo-25928: Add Decimal.as_integer_ratio().
  25447. - bpo-25447: Copying the lru_cache() wrapper object now always works,
  25448. independently from the type of the wrapped object (by returning the
  25449. original object unchanged).
  25450. - bpo-25768: Have the functions in compileall return booleans instead of
  25451. ints and add proper documentation and tests for the return values.
  25452. - bpo-24103: Fixed possible use after free in ElementTree.XMLPullParser.
  25453. - bpo-25860: os.fwalk() no longer skips remaining directories when error
  25454. occurs. Original patch by Samson Lee.
  25455. - bpo-25914: Fixed and simplified OrderedDict.__sizeof__.
  25456. - bpo-25869: Optimized deepcopying ElementTree; it is now 20 times faster.
  25457. - bpo-25873: Optimized iterating ElementTree. Iterating elements
  25458. Element.iter() is now 40% faster, iterating text Element.itertext() is now
  25459. up to 2.5 times faster.
  25460. - bpo-25902: Fixed various refcount issues in ElementTree iteration.
  25461. - bpo-22227: The TarFile iterator is reimplemented using generator. This
  25462. implementation is simpler that using class.
  25463. - bpo-25638: Optimized ElementTree.iterparse(); it is now 2x faster.
  25464. Optimized ElementTree parsing; it is now 10% faster.
  25465. - bpo-25761: Improved detecting errors in broken pickle data.
  25466. - bpo-25717: Restore the previous behaviour of tolerating most fstat()
  25467. errors when opening files. This was a regression in 3.5a1, and stopped
  25468. anonymous temporary files from working in special cases.
  25469. - bpo-24903: Fix regression in number of arguments compileall accepts when
  25470. '-d' is specified. The check on the number of arguments has been dropped
  25471. completely as it never worked correctly anyway.
  25472. - bpo-25764: In the subprocess module, preserve any exception caused by
  25473. fork() failure when preexec_fn is used.
  25474. - bpo-25771: Tweak the exception message for importlib.util.resolve_name()
  25475. when 'package' isn't specified but necessary.
  25476. - bpo-6478: _strptime's regexp cache now is reset after changing timezone
  25477. with time.tzset().
  25478. - bpo-14285: When executing a package with the "python -m package" option,
  25479. and package initialization fails, a proper traceback is now reported. The
  25480. "runpy" module now lets exceptions from package initialization pass back
  25481. to the caller, rather than raising ImportError.
  25482. - bpo-19771: Also in runpy and the "-m" option, omit the irrelevant message
  25483. ". . . is a package and cannot be directly executed" if the package could
  25484. not even be initialized (e.g. due to a bad ``*.pyc`` file).
  25485. - bpo-25177: Fixed problem with the mean of very small and very large
  25486. numbers. As a side effect, statistics.mean and statistics.variance should
  25487. be significantly faster.
  25488. - bpo-25718: Fixed copying object with state with boolean value is false.
  25489. - bpo-10131: Fixed deep copying of minidom documents. Based on patch by
  25490. Marian Ganisin.
  25491. - bpo-7990: dir() on ElementTree.Element now lists properties: "tag",
  25492. "text", "tail" and "attrib". Original patch by Santoso Wijaya.
  25493. - bpo-25725: Fixed a reference leak in pickle.loads() when unpickling
  25494. invalid data including tuple instructions.
  25495. - bpo-25663: In the Readline completer, avoid listing duplicate global
  25496. names, and search the global namespace before searching builtins.
  25497. - bpo-25688: Fixed file leak in ElementTree.iterparse() raising an error.
  25498. - bpo-23914: Fixed SystemError raised by unpickler on broken pickle data.
  25499. - bpo-25691: Fixed crash on deleting ElementTree.Element attributes.
  25500. - bpo-25624: ZipFile now always writes a ZIP_STORED header for directory
  25501. entries. Patch by Dingyuan Wang.
  25502. - bpo-25626: Change three zlib functions to accept sizes that fit in
  25503. Py_ssize_t, but internally cap those sizes to UINT_MAX. This resolves a
  25504. regression in 3.5 where GzipFile.read() failed to read chunks larger than
  25505. 2 or 4 GiB. The change affects the zlib.Decompress.decompress()
  25506. max_length parameter, the zlib.decompress() bufsize parameter, and the
  25507. zlib.Decompress.flush() length parameter.
  25508. - bpo-25583: Avoid incorrect errors raised by os.makedirs(exist_ok=True)
  25509. when the OS gives priority to errors such as EACCES over EEXIST.
  25510. - bpo-25593: Change semantics of EventLoop.stop() in asyncio.
  25511. - bpo-6973: When we know a subprocess.Popen process has died, do not allow
  25512. the send_signal(), terminate(), or kill() methods to do anything as they
  25513. could potentially signal a different process.
  25514. - bpo-23883: Added missing APIs to __all__ to match the documented APIs for
  25515. the following modules: calendar, csv, enum, fileinput, ftplib, logging,
  25516. optparse, tarfile, threading and wave. Also added a
  25517. test.support.check__all__() helper. Patches by Jacek Kołodziej, Mauro S.
  25518. M. Rodrigues and Joel Taddei.
  25519. - bpo-25590: In the Readline completer, only call getattr() once per
  25520. attribute. Also complete names of attributes such as properties and slots
  25521. which are listed by dir() but not yet created on an instance.
  25522. - bpo-25498: Fix a crash when garbage-collecting ctypes objects created by
  25523. wrapping a memoryview. This was a regression made in 3.5a1. Based on
  25524. patch by Eryksun.
  25525. - bpo-25584: Added "escape" to the __all__ list in the glob module.
  25526. - bpo-25584: Fixed recursive glob() with patterns starting with ``**``.
  25527. - bpo-25446: Fix regression in smtplib's AUTH LOGIN support.
  25528. - bpo-18010: Fix the pydoc web server's module search function to handle
  25529. exceptions from importing packages.
  25530. - bpo-25554: Got rid of circular references in regular expression parsing.
  25531. - bpo-18973: Command-line interface of the calendar module now uses argparse
  25532. instead of optparse.
  25533. - bpo-25510: fileinput.FileInput.readline() now returns b'' instead of '' at
  25534. the end if the FileInput was opened with binary mode. Patch by Ryosuke
  25535. Ito.
  25536. - bpo-25503: Fixed inspect.getdoc() for inherited docstrings of properties.
  25537. Original patch by John Mark Vandenberg.
  25538. - bpo-25515: Always use os.urandom as a source of randomness in uuid.uuid4.
  25539. - bpo-21827: Fixed textwrap.dedent() for the case when largest common
  25540. whitespace is a substring of smallest leading whitespace. Based on patch
  25541. by Robert Li.
  25542. - bpo-25447: The lru_cache() wrapper objects now can be copied and pickled
  25543. (by returning the original object unchanged).
  25544. - bpo-25390: typing: Don't crash on Union[str, Pattern].
  25545. - bpo-25441: asyncio: Raise error from drain() when socket is closed.
  25546. - bpo-25410: Cleaned up and fixed minor bugs in C implementation of
  25547. OrderedDict.
  25548. - bpo-25411: Improved Unicode support in SMTPHandler through better use of
  25549. the email package. Thanks to user simon04 for the patch.
  25550. - Move the imp module from a PendingDeprecationWarning to
  25551. DeprecationWarning.
  25552. - bpo-25407: Remove mentions of the formatter module being removed in Python
  25553. 3.6.
  25554. - bpo-25406: Fixed a bug in C implementation of OrderedDict.move_to_end()
  25555. that caused segmentation fault or hang in iterating after moving several
  25556. items to the start of ordered dict.
  25557. - bpo-25382: pickletools.dis() now outputs implicit memo index for the
  25558. MEMOIZE opcode.
  25559. - bpo-25357: Add an optional newline parameter to binascii.b2a_base64().
  25560. base64.b64encode() uses it to avoid a memory copy.
  25561. - bpo-24164: Objects that need calling ``__new__`` with keyword arguments,
  25562. can now be pickled using pickle protocols older than protocol version 4.
  25563. - bpo-25364: zipfile now works in threads disabled builds.
  25564. - bpo-25328: smtpd's SMTPChannel now correctly raises a ValueError if both
  25565. decode_data and enable_SMTPUTF8 are set to true.
  25566. - bpo-16099: RobotFileParser now supports Crawl-delay and Request-rate
  25567. extensions. Patch by Nikolay Bogoychev.
  25568. - bpo-25316: distutils raises OSError instead of DistutilsPlatformError when
  25569. MSVC is not installed.
  25570. - bpo-25380: Fixed protocol for the STACK_GLOBAL opcode in
  25571. pickletools.opcodes.
  25572. - bpo-23972: Updates asyncio datagram create method allowing reuseport and
  25573. reuseaddr socket options to be set prior to binding the socket. Mirroring
  25574. the existing asyncio create_server method the reuseaddr option for
  25575. datagram sockets defaults to True if the O/S is 'posix' (except if the
  25576. platform is Cygwin). Patch by Chris Laws.
  25577. - bpo-25304: Add asyncio.run_coroutine_threadsafe(). This lets you submit a
  25578. coroutine to a loop from another thread, returning a
  25579. concurrent.futures.Future. By Vincent Michel.
  25580. - bpo-25232: Fix CGIRequestHandler to split the query from the URL at the
  25581. first question mark (?) rather than the last. Patch from Xiang Zhang.
  25582. - bpo-24657: Prevent CGIRequestHandler from collapsing slashes in the query
  25583. part of the URL as if it were a path. Patch from Xiang Zhang.
  25584. - bpo-25287: Don't add crypt.METHOD_CRYPT to crypt.methods if it's not
  25585. supported. Check if it is supported, it may not be supported on OpenBSD
  25586. for example.
  25587. - bpo-23600: Default implementation of tzinfo.fromutc() was returning wrong
  25588. results in some cases.
  25589. - bpo-25203: Failed readline.set_completer_delims() no longer left the
  25590. module in inconsistent state.
  25591. - bpo-25011: rlcompleter now omits private and special attribute names
  25592. unless the prefix starts with underscores.
  25593. - bpo-25209: rlcompleter now can add a space or a colon after completed
  25594. keyword.
  25595. - bpo-22241: timezone.utc name is now plain 'UTC', not 'UTC-00:00'.
  25596. - bpo-23517: fromtimestamp() and utcfromtimestamp() methods of
  25597. datetime.datetime now round microseconds to nearest with ties going to
  25598. nearest even integer (ROUND_HALF_EVEN), as round(float), instead of
  25599. rounding towards -Infinity (ROUND_FLOOR).
  25600. - bpo-23552: Timeit now warns when there is substantial (4x) variance
  25601. between best and worst times. Patch from Serhiy Storchaka.
  25602. - bpo-24633: site-packages/README -> README.txt.
  25603. - bpo-24879: help() and pydoc can now list named tuple fields in the order
  25604. they were defined rather than alphabetically. The ordering is determined
  25605. by the _fields attribute if present.
  25606. - bpo-24874: Improve speed of itertools.cycle() and make its pickle more
  25607. compact.
  25608. - Fix crash in itertools.cycle.__setstate__() when the first argument wasn't
  25609. a list.
  25610. - bpo-20059: urllib.parse raises ValueError on all invalid ports. Patch by
  25611. Martin Panter.
  25612. - bpo-24360: Improve __repr__ of argparse.Namespace() for invalid
  25613. identifiers. Patch by Matthias Bussonnier.
  25614. - bpo-23426: run_setup was broken in distutils. Patch from Alexander
  25615. Belopolsky.
  25616. - bpo-13938: 2to3 converts StringTypes to a tuple. Patch from Mark Hammond.
  25617. - bpo-2091: open() accepted a 'U' mode string containing '+', but 'U' can
  25618. only be used with 'r'. Patch from Jeff Balogh and John O'Connor.
  25619. - bpo-8585: improved tests for zipimporter2. Patch from Mark Lawrence.
  25620. - bpo-18622: unittest.mock.mock_open().reset_mock would recurse infinitely.
  25621. Patch from Nicola Palumbo and Laurent De Buyst.
  25622. - bpo-24426: Fast searching optimization in regular expressions now works
  25623. for patterns that starts with capturing groups. Fast searching
  25624. optimization now can't be disabled at compile time.
  25625. - bpo-23661: unittest.mock side_effects can now be exceptions again. This
  25626. was a regression vs Python 3.4. Patch from Ignacio Rossi
  25627. - bpo-13248: Remove deprecated inspect.getmoduleinfo function.
  25628. - bpo-25578: Fix (another) memory leak in SSLSocket.getpeercer().
  25629. - bpo-25530: Disable the vulnerable SSLv3 protocol by default when creating
  25630. ssl.SSLContext.
  25631. - bpo-25569: Fix memory leak in SSLSocket.getpeercert().
  25632. - bpo-25471: Sockets returned from accept() shouldn't appear to be
  25633. nonblocking.
  25634. - bpo-25319: When threading.Event is reinitialized, the underlying condition
  25635. should use a regular lock rather than a recursive lock.
  25636. - Skip getaddrinfo if host is already resolved. Patch by A. Jesse Jiryu
  25637. Davis.
  25638. - bpo-26050: Add asyncio.StreamReader.readuntil() method. Patch by Марк
  25639. Коренберг.
  25640. - bpo-25924: Avoid unnecessary serialization of getaddrinfo(3) calls on OS X
  25641. versions 10.5 or higher. Original patch by A. Jesse Jiryu Davis.
  25642. - bpo-26406: Avoid unnecessary serialization of getaddrinfo(3) calls on
  25643. current versions of OpenBSD and NetBSD. Patch by A. Jesse Jiryu Davis.
  25644. - bpo-26848: Fix asyncio/subprocess.communicate() to handle empty input.
  25645. Patch by Jack O'Connor.
  25646. - bpo-27040: Add loop.get_exception_handler method
  25647. - bpo-27041: asyncio: Add loop.create_future method
  25648. IDLE
  25649. ----
  25650. - bpo-20640: Add tests for idlelib.configHelpSourceEdit. Patch by Saimadhav
  25651. Heblikar.
  25652. - In the 'IDLE-console differences' section of the IDLE doc, clarify how
  25653. running with IDLE affects sys.modules and the standard streams.
  25654. - bpo-25507: fix incorrect change in IOBinding that prevented printing.
  25655. Augment IOBinding htest to include all major IOBinding functions.
  25656. - bpo-25905: Revert unwanted conversion of ' to ’ RIGHT SINGLE QUOTATION
  25657. MARK in README.txt and open this and NEWS.txt with 'ascii'. Re-encode
  25658. CREDITS.txt to utf-8 and open it with 'utf-8'.
  25659. - bpo-15348: Stop the debugger engine (normally in a user process) before
  25660. closing the debugger window (running in the IDLE process). This prevents
  25661. the RuntimeErrors that were being caught and ignored.
  25662. - bpo-24455: Prevent IDLE from hanging when a) closing the shell while the
  25663. debugger is active (15347); b) closing the debugger with the [X] button
  25664. (15348); and c) activating the debugger when already active (24455). The
  25665. patch by Mark Roseman does this by making two changes. 1. Suspend and
  25666. resume the gui.interaction method with the tcl vwait mechanism intended
  25667. for this purpose (instead of root.mainloop & .quit). 2. In gui.run, allow
  25668. any existing interaction to terminate first.
  25669. - Change 'The program' to 'Your program' in an IDLE 'kill program?' message
  25670. to make it clearer that the program referred to is the currently running
  25671. user program, not IDLE itself.
  25672. - bpo-24750: Improve the appearance of the IDLE editor window status bar.
  25673. Patch by Mark Roseman.
  25674. - bpo-25313: Change the handling of new built-in text color themes to better
  25675. address the compatibility problem introduced by the addition of IDLE Dark.
  25676. Consistently use the revised idleConf.CurrentTheme everywhere in idlelib.
  25677. - bpo-24782: Extension configuration is now a tab in the IDLE Preferences
  25678. dialog rather than a separate dialog. The former tabs are now a sorted
  25679. list. Patch by Mark Roseman.
  25680. - bpo-22726: Re-activate the config dialog help button with some content
  25681. about the other buttons and the new IDLE Dark theme.
  25682. - bpo-24820: IDLE now has an 'IDLE Dark' built-in text color theme. It is
  25683. more or less IDLE Classic inverted, with a cobalt blue background.
  25684. Strings, comments, keywords, ... are still green, red, orange, ... . To
  25685. use it with IDLEs released before November 2015, hit the 'Save as New
  25686. Custom Theme' button and enter a new name, such as 'Custom Dark'. The
  25687. custom theme will work with any IDLE release, and can be modified.
  25688. - bpo-25224: README.txt is now an idlelib index for IDLE developers and
  25689. curious users. The previous user content is now in the IDLE doc chapter.
  25690. 'IDLE' now means 'Integrated Development and Learning Environment'.
  25691. - bpo-24820: Users can now set breakpoint colors in Settings -> Custom
  25692. Highlighting. Original patch by Mark Roseman.
  25693. - bpo-24972: Inactive selection background now matches active selection
  25694. background, as configured by users, on all systems. Found items are now
  25695. always highlighted on Windows. Initial patch by Mark Roseman.
  25696. - bpo-24570: Idle: make calltip and completion boxes appear on Macs affected
  25697. by a tk regression. Initial patch by Mark Roseman.
  25698. - bpo-24988: Idle ScrolledList context menus (used in debugger) now work on
  25699. Mac Aqua. Patch by Mark Roseman.
  25700. - bpo-24801: Make right-click for context menu work on Mac Aqua. Patch by
  25701. Mark Roseman.
  25702. - bpo-25173: Associate tkinter messageboxes with a specific widget. For Mac
  25703. OSX, make them a 'sheet'. Patch by Mark Roseman.
  25704. - bpo-25198: Enhance the initial html viewer now used for Idle Help.
  25705. Properly indent fixed-pitch text (patch by Mark Roseman). Give code
  25706. snippet a very Sphinx-like light blueish-gray background. Re-use initial
  25707. width and height set by users for shell and editor. When the Table of
  25708. Contents (TOC) menu is used, put the section header at the top of the
  25709. screen.
  25710. - bpo-25225: Condense and rewrite Idle doc section on text colors.
  25711. - bpo-21995: Explain some differences between IDLE and console Python.
  25712. - bpo-22820: Explain need for *print* when running file from Idle editor.
  25713. - bpo-25224: Doc: augment Idle feature list and no-subprocess section.
  25714. - bpo-25219: Update doc for Idle command line options. Some were missing and
  25715. notes were not correct.
  25716. - bpo-24861: Most of idlelib is private and subject to change. Use
  25717. idleib.idle.* to start Idle. See idlelib.__init__.__doc__.
  25718. - bpo-25199: Idle: add synchronization comments for future maintainers.
  25719. - bpo-16893: Replace help.txt with help.html for Idle doc display. The new
  25720. idlelib/help.html is rstripped Doc/build/html/library/idle.html. It looks
  25721. better than help.txt and will better document Idle as released. The
  25722. tkinter html viewer that works for this file was written by Rose Roseman.
  25723. The now unused EditorWindow.HelpDialog class and helt.txt file are
  25724. deprecated.
  25725. - bpo-24199: Deprecate unused idlelib.idlever with possible removal in 3.6.
  25726. - bpo-24790: Remove extraneous code (which also create 2 & 3 conflicts).
  25727. Documentation
  25728. -------------
  25729. - bpo-26736: Used HTTPS for external links in the documentation if possible.
  25730. - bpo-6953: Rework the Readline module documentation to group related
  25731. functions together, and add more details such as what underlying Readline
  25732. functions and variables are accessed.
  25733. - bpo-23606: Adds note to ctypes documentation regarding cdll.msvcrt.
  25734. - bpo-24952: Clarify the default size argument of stack_size() in the
  25735. "threading" and "_thread" modules. Patch from Mattip.
  25736. - bpo-26014: Update 3.x packaging documentation: * "See also" links to the
  25737. new docs are now provided in the legacy pages * links to setuptools
  25738. documentation have been updated
  25739. Tests
  25740. -----
  25741. - bpo-21916: Added tests for the turtle module. Patch by ingrid, Gregory
  25742. Loyse and Jelle Zijlstra.
  25743. - bpo-26295: When using "python3 -m test --testdir=TESTDIR", regrtest
  25744. doesn't add "test." prefix to test module names.
  25745. - bpo-26523: The multiprocessing thread pool (multiprocessing.dummy.Pool)
  25746. was untested.
  25747. - bpo-26015: Added new tests for pickling iterators of mutable sequences.
  25748. - bpo-26325: Added test.support.check_no_resource_warning() to check that no
  25749. ResourceWarning is emitted.
  25750. - bpo-25940: Changed test_ssl to use its internal local server more. This
  25751. avoids relying on svn.python.org, which recently changed root certificate.
  25752. - bpo-25616: Tests for OrderedDict are extracted from test_collections into
  25753. separate file test_ordered_dict.
  25754. - bpo-25449: Added tests for OrderedDict subclasses.
  25755. - bpo-25188: Add -P/--pgo to test.regrtest to suppress error output when
  25756. running the test suite for the purposes of a PGO build. Initial patch by
  25757. Alecsandru Patrascu.
  25758. - bpo-22806: Add ``python -m test --list-tests`` command to list tests.
  25759. - bpo-18174: ``python -m test --huntrleaks ...`` now also checks for leak of
  25760. file descriptors. Patch written by Richard Oudkerk.
  25761. - bpo-25260: Fix ``python -m test --coverage`` on Windows. Remove the list
  25762. of ignored directories.
  25763. - ``PCbuild\rt.bat`` now accepts an unlimited number of arguments to pass
  25764. along to regrtest.py. Previously there was a limit of 9.
  25765. - bpo-26583: Skip test_timestamp_overflow in test_import if bytecode files
  25766. cannot be written.
  25767. Build
  25768. -----
  25769. - bpo-21277: Don't try to link _ctypes with a ffi_convenience library.
  25770. - bpo-26884: Fix linking extension modules for cross builds. Patch by Xavier
  25771. de Gaye.
  25772. - bpo-26932: Fixed support of RTLD_* constants defined as enum values, not
  25773. via macros (in particular on Android). Patch by Chi Hsuan Yen.
  25774. - bpo-22359: Disable the rules for running _freeze_importlib and pgen when
  25775. cross-compiling. The output of these programs is normally saved with the
  25776. source code anyway, and is still regenerated when doing a native build.
  25777. Patch by Xavier de Gaye.
  25778. - bpo-21668: Link audioop, _datetime, _ctypes_test modules to libm, except
  25779. on Mac OS X. Patch written by Chi Hsuan Yen.
  25780. - bpo-25702: A --with-lto configure option has been added that will enable
  25781. link time optimizations at build time during a make profile-opt. Some
  25782. compilers and toolchains are known to not produce stable code when using
  25783. LTO, be sure to test things thoroughly before relying on it. It can
  25784. provide a few % speed up over profile-opt alone.
  25785. - bpo-26624: Adds validation of ucrtbase[d].dll version with warning for old
  25786. versions.
  25787. - bpo-17603: Avoid error about nonexistent fileblocks.o file by using a
  25788. lower-level check for st_blocks in struct stat.
  25789. - bpo-26079: Fixing the build output folder for tix-8.4.3.6. Patch by Bjoern
  25790. Thiel.
  25791. - bpo-26465: Update Windows builds to use OpenSSL 1.0.2g.
  25792. - bpo-25348: Added ``--pgo`` and ``--pgo-job`` arguments to
  25793. ``PCbuild\build.bat`` for building with Profile-Guided Optimization. The
  25794. old ``PCbuild\build_pgo.bat`` script is removed.
  25795. - bpo-25827: Add support for building with ICC to ``configure``, including a
  25796. new ``--with-icc`` flag.
  25797. - bpo-25696: Fix installation of Python on UNIX with make -j9.
  25798. - bpo-24986: It is now possible to build Python on Windows without errors
  25799. when external libraries are not available.
  25800. - bpo-24421: Compile Modules/_math.c once, before building extensions.
  25801. Previously it could fail to compile properly if the math and cmath builds
  25802. were concurrent.
  25803. - bpo-26465: Update OS X 10.5+ 32-bit-only installer to build and link with
  25804. OpenSSL 1.0.2g.
  25805. - bpo-26268: Update Windows builds to use OpenSSL 1.0.2f.
  25806. - bpo-25136: Support Apple Xcode 7's new textual SDK stub libraries.
  25807. - bpo-24324: Do not enable unreachable code warnings when using gcc as the
  25808. option does not work correctly in older versions of gcc and has been
  25809. silently removed as of gcc-4.5.
  25810. Windows
  25811. -------
  25812. - bpo-27053: Updates make_zip.py to correctly generate library ZIP file.
  25813. - bpo-26268: Update the prepare_ssl.py script to handle OpenSSL releases
  25814. that don't include the contents of the include directory (that is, 1.0.2e
  25815. and later).
  25816. - bpo-26071: bdist_wininst created binaries fail to start and find 32bit
  25817. Python
  25818. - bpo-26073: Update the list of magic numbers in launcher
  25819. - bpo-26065: Excludes venv from library when generating embeddable distro.
  25820. - bpo-25022: Removed very outdated PC/example_nt/ directory.
  25821. Tools/Demos
  25822. -----------
  25823. - bpo-26799: Fix python-gdb.py: don't get C types once when the Python code
  25824. is loaded, but get C types on demand. The C types can change if
  25825. python-gdb.py is loaded before the Python executable. Patch written by
  25826. Thomas Ilsche.
  25827. - bpo-26271: Fix the Freeze tool to properly use flags passed through
  25828. configure. Patch by Daniel Shaulov.
  25829. - bpo-26489: Add dictionary unpacking support to Tools/parser/unparse.py.
  25830. Patch by Guo Ci Teo.
  25831. - bpo-26316: Fix variable name typo in Argument Clinic.
  25832. - bpo-25440: Fix output of python-config --extension-suffix.
  25833. - bpo-25154: The pyvenv script has been deprecated in favour of ``python3 -m
  25834. venv``.
  25835. C API
  25836. -----
  25837. - bpo-26312: SystemError is now raised in all programming bugs with using
  25838. PyArg_ParseTupleAndKeywords(). RuntimeError did raised before in some
  25839. programming bugs.
  25840. - bpo-26198: ValueError is now raised instead of TypeError on buffer
  25841. overflow in parsing "es#" and "et#" format units. SystemError is now
  25842. raised instead of TypeError on programmatical error in parsing format
  25843. string.
  25844. What's New in Python 3.5.5 final?
  25845. =================================
  25846. *Release date: 2018-02-04*
  25847. There were no new changes in version 3.5.5.
  25848. What's New in Python 3.5.5 release candidate 1?
  25849. ===============================================
  25850. *Release date: 2018-01-23*
  25851. Security
  25852. --------
  25853. - bpo-32551: The ``sys.path[0]`` initialization change for bpo-29139 caused
  25854. a regression by revealing an inconsistency in how sys.path is initialized
  25855. when executing ``__main__`` from a zipfile, directory, or other import
  25856. location. This is considered a potential security issue, as it may lead to
  25857. privileged processes unexpectedly loading code from user controlled
  25858. directories in situations where that was not previously the case. The
  25859. interpreter now consistently avoids ever adding the import location's
  25860. parent directory to ``sys.path``, and ensures no other ``sys.path``
  25861. entries are inadvertently modified when inserting the import location
  25862. named on the command line. (Originally reported as bpo-29723 against
  25863. Python 3.6rc1, but it was missed at the time that the then upcoming Python
  25864. 3.5.4 release would also be affected)
  25865. - bpo-30657: Fixed possible integer overflow in PyBytes_DecodeEscape,
  25866. CVE-2017-1000158. Original patch by Jay Bosamiya; rebased to Python 3 by
  25867. Miro Hrončok.
  25868. - bpo-30947: Upgrade libexpat embedded copy from version 2.2.1 to 2.2.3 to
  25869. get security fixes.
  25870. Core and Builtins
  25871. -----------------
  25872. - bpo-31095: Fix potential crash during GC caused by ``tp_dealloc`` which
  25873. doesn't call ``PyObject_GC_UnTrack()``.
  25874. Library
  25875. -------
  25876. - bpo-32072: Fixed issues with binary plists: Fixed saving bytearrays.
  25877. Identical objects will be saved only once. Equal references will be load
  25878. as identical objects. Added support for saving and loading recursive data
  25879. structures.
  25880. - bpo-31170: expat: Update libexpat from 2.2.3 to 2.2.4. Fix copying of
  25881. partial characters for UTF-8 input (libexpat bug 115):
  25882. https://github.com/libexpat/libexpat/issues/115
  25883. What's New in Python 3.5.4 final?
  25884. =================================
  25885. *Release date: 2017-08-07*
  25886. Library
  25887. -------
  25888. - bpo-30119: ftplib.FTP.putline() now throws ValueError on commands that
  25889. contains CR or LF. Patch by Donghee Na.
  25890. What's New in Python 3.5.4 release candidate 1?
  25891. ===============================================
  25892. *Release date: 2017-07-23*
  25893. Security
  25894. --------
  25895. - bpo-30730: Prevent environment variables injection in subprocess on
  25896. Windows. Prevent passing other environment variables and command
  25897. arguments.
  25898. - bpo-30694: Upgrade expat copy from 2.2.0 to 2.2.1 to get fixes of multiple
  25899. security vulnerabilities including: CVE-2017-9233 (External entity
  25900. infinite loop DoS), CVE-2016-9063 (Integer overflow, re-fix),
  25901. CVE-2016-0718 (Fix regression bugs from 2.2.0's fix to CVE-2016-0718) and
  25902. CVE-2012-0876 (Counter hash flooding with SipHash). Note: the
  25903. CVE-2016-5300 (Use os-specific entropy sources like getrandom) doesn't
  25904. impact Python, since Python already gets entropy from the OS to set the
  25905. expat secret using ``XML_SetHashSalt()``.
  25906. - bpo-30500: Fix urllib.parse.splithost() to correctly parse fragments. For
  25907. example, ``splithost('//127.0.0.1#@evil.com/')`` now correctly returns the
  25908. ``127.0.0.1`` host, instead of treating ``@evil.com`` as the host in an
  25909. authentication (``login@host``).
  25910. - bpo-29591: Update expat copy from 2.1.1 to 2.2.0 to get fixes of
  25911. CVE-2016-0718 and CVE-2016-4472. See
  25912. https://sourceforge.net/p/expat/bugs/537/ for more information.
  25913. Core and Builtins
  25914. -----------------
  25915. - bpo-30876: Relative import from unloaded package now reimports the package
  25916. instead of failing with SystemError. Relative import from non-package now
  25917. fails with ImportError rather than SystemError.
  25918. - bpo-30765: Avoid blocking in pthread_mutex_lock() when
  25919. PyThread_acquire_lock() is asked not to block.
  25920. - bpo-27945: Fixed various segfaults with dict when input collections are
  25921. mutated during searching, inserting or comparing. Based on patches by
  25922. Duane Griffin and Tim Mitchell.
  25923. - bpo-25794: Fixed type.__setattr__() and type.__delattr__() for
  25924. non-interned attribute names. Based on patch by Eryk Sun.
  25925. - bpo-29935: Fixed error messages in the index() method of tuple, list and
  25926. deque when pass indices of wrong type.
  25927. - bpo-28876: ``bool(range)`` works even if ``len(range)`` raises
  25928. :exc:`OverflowError`.
  25929. - bpo-29600: Fix wrapping coroutine return values in StopIteration.
  25930. - bpo-29537: Restore runtime compatibility with bytecode files generated by
  25931. CPython 3.5.0 to 3.5.2, and adjust the eval loop to avoid the problems
  25932. that could be caused by the malformed variant of the
  25933. BUILD_MAP_UNPACK_WITH_CALL opcode that they may contain. Patch by Petr
  25934. Viktorin, Serhiy Storchaka, and Nick Coghlan.
  25935. - bpo-28598: Support __rmod__ for subclasses of str being called before
  25936. str.__mod__. Patch by Martijn Pieters.
  25937. - bpo-29602: Fix incorrect handling of signed zeros in complex constructor
  25938. for complex subclasses and for inputs having a __complex__ method. Patch
  25939. by Serhiy Storchaka.
  25940. - bpo-29347: Fixed possibly dereferencing undefined pointers when creating
  25941. weakref objects.
  25942. - bpo-29438: Fixed use-after-free problem in key sharing dict.
  25943. - bpo-29319: Prevent RunMainFromImporter overwriting sys.path[0].
  25944. - bpo-29337: Fixed possible BytesWarning when compare the code objects.
  25945. Warnings could be emitted at compile time.
  25946. - bpo-29478: If max_line_length=None is specified while using the Compat32
  25947. policy, it is no longer ignored. Patch by Mircea Cosbuc.
  25948. Library
  25949. -------
  25950. - bpo-29403: Fix ``unittest.mock``'s autospec to not fail on method-bound
  25951. builtin functions. Patch by Aaron Gallagher.
  25952. - bpo-30961: Fix decrementing a borrowed reference in tracemalloc.
  25953. - bpo-30886: Fix multiprocessing.Queue.join_thread(): it now waits until the
  25954. thread completes, even if the thread was started by the same process which
  25955. created the queue.
  25956. - bpo-29854: Fix segfault in readline when using readline's history-size
  25957. option. Patch by Nir Soffer.
  25958. - bpo-30807: signal.setitimer() may disable the timer when passed a tiny
  25959. value. Tiny values (such as 1e-6) are valid non-zero values for
  25960. setitimer(), which is specified as taking microsecond-resolution
  25961. intervals. However, on some platform, our conversion routine could convert
  25962. 1e-6 into a zero interval, therefore disabling the timer instead of
  25963. (re-)scheduling it.
  25964. - bpo-30441: Fix bug when modifying os.environ while iterating over it
  25965. - bpo-30532: Fix email header value parser dropping folding white space in
  25966. certain cases.
  25967. - bpo-29169: Update zlib to 1.2.11.
  25968. - bpo-30879: os.listdir() and os.scandir() now emit bytes names when called
  25969. with bytes-like argument.
  25970. - bpo-30746: Prohibited the '=' character in environment variable names in
  25971. ``os.putenv()`` and ``os.spawn*()``.
  25972. - bpo-29755: Fixed the lgettext() family of functions in the gettext module.
  25973. They now always return bytes.
  25974. - bpo-30645: Fix path calculation in imp.load_package(), fixing it for cases
  25975. when a package is only shipped with bytecodes. Patch by Alexandru
  25976. Ardelean.
  25977. - bpo-23890: unittest.TestCase.assertRaises() now manually breaks a
  25978. reference cycle to not keep objects alive longer than expected.
  25979. - bpo-30149: inspect.signature() now supports callables with
  25980. variable-argument parameters wrapped with partialmethod. Patch by Donghee
  25981. Na.
  25982. - bpo-29931: Fixed comparison check for ipaddress.ip_interface objects.
  25983. Patch by Sanjay Sundaresan.
  25984. - bpo-24484: Avoid race condition in multiprocessing cleanup.
  25985. - bpo-28994: The traceback no longer displayed for SystemExit raised in a
  25986. callback registered by atexit.
  25987. - bpo-30508: Don't log exceptions if Task/Future "cancel()" method was
  25988. called.
  25989. - bpo-28556: Updates to typing module: Add generic AsyncContextManager, add
  25990. support for ContextManager on all versions. Original PRs by Jelle Zijlstra
  25991. and Ivan Levkivskyi
  25992. - bpo-29870: Fix ssl sockets leaks when connection is aborted in asyncio/ssl
  25993. implementation. Patch by Michaël Sghaïer.
  25994. - bpo-29743: Closing transport during handshake process leaks open socket.
  25995. Patch by Nikolay Kim
  25996. - bpo-27585: Fix waiter cancellation in asyncio.Lock. Patch by Mathieu
  25997. Sornay.
  25998. - bpo-30418: On Windows, subprocess.Popen.communicate() now also ignore
  25999. EINVAL on stdin.write() if the child process is still running but closed
  26000. the pipe.
  26001. - bpo-30378: Fix the problem that logging.handlers.SysLogHandler cannot
  26002. handle IPv6 addresses.
  26003. - bpo-29960: Preserve generator state when _random.Random.setstate() raises
  26004. an exception. Patch by Bryan Olson.
  26005. - bpo-30414: multiprocessing.Queue._feed background running thread do not
  26006. break from main loop on exception.
  26007. - bpo-30003: Fix handling escape characters in HZ codec. Based on patch by
  26008. Ma Lin.
  26009. - bpo-30301: Fix AttributeError when using SimpleQueue.empty() under *spawn*
  26010. and *forkserver* start methods.
  26011. - bpo-30329: imaplib and poplib now catch the Windows socket WSAEINVAL error
  26012. (code 10022) on shutdown(SHUT_RDWR): An invalid operation was attempted.
  26013. This error occurs sometimes on SSL connections.
  26014. - bpo-30375: Warnings emitted when compile a regular expression now always
  26015. point to the line in the user code. Previously they could point into
  26016. inners of the re module if emitted from inside of groups or conditionals.
  26017. - bpo-30048: Fixed ``Task.cancel()`` can be ignored when the task is running
  26018. coroutine and the coroutine returned without any more ``await``.
  26019. - bpo-29990: Fix range checking in GB18030 decoder. Original patch by Ma
  26020. Lin.
  26021. - bpo-26293: Change resulted because of zipfile breakage. (See also:
  26022. bpo-29094)
  26023. - bpo-30243: Removed the __init__ methods of _json's scanner and encoder.
  26024. Misusing them could cause memory leaks or crashes. Now scanner and
  26025. encoder objects are completely initialized in the __new__ methods.
  26026. - bpo-30185: Avoid KeyboardInterrupt tracebacks in forkserver helper process
  26027. when Ctrl-C is received.
  26028. - bpo-28556: Various updates to typing module: add typing.NoReturn type, use
  26029. WrapperDescriptorType, minor bug-fixes. Original PRs by Jim
  26030. Fasarakis-Hilliard and Ivan Levkivskyi.
  26031. - bpo-30205: Fix getsockname() for unbound AF_UNIX sockets on Linux.
  26032. - bpo-30070: Fixed leaks and crashes in errors handling in the parser
  26033. module.
  26034. - bpo-30061: Fixed crashes in IOBase methods __next__() and readlines() when
  26035. readline() or __next__() respectively return non-sizeable object. Fixed
  26036. possible other errors caused by not checking results of PyObject_Size(),
  26037. PySequence_Size(), or PyMapping_Size().
  26038. - bpo-30068: _io._IOBase.readlines will check if it's closed first when hint
  26039. is present.
  26040. - bpo-29694: Fixed race condition in pathlib mkdir with flags parents=True.
  26041. Patch by Armin Rigo.
  26042. - bpo-29692: Fixed arbitrary unchaining of RuntimeError exceptions in
  26043. contextlib.contextmanager. Patch by Siddharth Velankar.
  26044. - bpo-29998: Pickling and copying ImportError now preserves name and path
  26045. attributes.
  26046. - bpo-29942: Fix a crash in itertools.chain.from_iterable when encountering
  26047. long runs of empty iterables.
  26048. - bpo-27863: Fixed multiple crashes in ElementTree caused by race conditions
  26049. and wrong types.
  26050. - bpo-28699: Fixed a bug in pools in multiprocessing.pool that raising an
  26051. exception at the very first of an iterable may swallow the exception or
  26052. make the program hang. Patch by Davin Potts and Xiang Zhang.
  26053. - bpo-25803: Avoid incorrect errors raised by Path.mkdir(exist_ok=True) when
  26054. the OS gives priority to errors such as EACCES over EEXIST.
  26055. - bpo-29861: Release references to tasks, their arguments and their results
  26056. as soon as they are finished in multiprocessing.Pool.
  26057. - bpo-29884: faulthandler: Restore the old sigaltstack during teardown.
  26058. Patch by Christophe Zeitouny.
  26059. - bpo-25455: Fixed crashes in repr of recursive buffered file-like objects.
  26060. - bpo-29800: Fix crashes in partial.__repr__ if the keys of partial.keywords
  26061. are not strings. Patch by Michael Seifert.
  26062. - bpo-29742: get_extra_info() raises exception if get called on closed ssl
  26063. transport. Patch by Nikolay Kim.
  26064. - bpo-8256: Fixed possible failing or crashing input() if attributes
  26065. "encoding" or "errors" of sys.stdin or sys.stdout are not set or are not
  26066. strings.
  26067. - bpo-28298: Fix a bug that prevented array 'Q', 'L' and 'I' from accepting
  26068. big intables (objects that have __int__) as elements. Patch by Oren
  26069. Milman.
  26070. - bpo-29615: SimpleXMLRPCDispatcher no longer chains KeyError (or any other
  26071. exception) to exception(s) raised in the dispatched methods. Patch by Petr
  26072. Motejlek.
  26073. - bpo-29704: asyncio.subprocess.SubprocessStreamProtocol no longer closes
  26074. before all pipes are closed.
  26075. - bpo-29703: Fix asyncio to support instantiation of new event loops in
  26076. child processes.
  26077. - bpo-29376: Fix assertion error in threading._DummyThread.is_alive().
  26078. - bpo-29110: Fix file object leak in aifc.open() when file is given as a
  26079. filesystem path and is not in valid AIFF format. Patch by Anthony Zhang.
  26080. - bpo-28961: Fix unittest.mock._Call helper: don't ignore the name parameter
  26081. anymore. Patch written by Jiajun Huang.
  26082. - bpo-29532: Altering a kwarg dictionary passed to functools.partial() no
  26083. longer affects a partial object after creation.
  26084. - bpo-28556: Various updates to typing module: typing.Counter,
  26085. typing.ChainMap, improved ABC caching, etc. Original PRs by Jelle
  26086. Zijlstra, Ivan Levkivskyi, Manuel Krebber, and Łukasz Langa.
  26087. - bpo-29100: Fix datetime.fromtimestamp() regression introduced in Python
  26088. 3.6.0: check minimum and maximum years.
  26089. - bpo-29519: Fix weakref spewing exceptions during interpreter shutdown when
  26090. used with a rare combination of multiprocessing and custom codecs.
  26091. - bpo-29416: Prevent infinite loop in pathlib.Path.mkdir
  26092. - bpo-29444: Fixed out-of-bounds buffer access in the group() method of the
  26093. match object. Based on patch by WGH.
  26094. - bpo-29335: Fix subprocess.Popen.wait() when the child process has exited
  26095. to a stopped instead of terminated state (ex: when under ptrace).
  26096. - bpo-29290: Fix a regression in argparse that help messages would wrap at
  26097. non-breaking spaces.
  26098. - bpo-28735: Fixed the comparison of mock.MagickMock with mock.ANY.
  26099. - bpo-29011: Fix an important omission by adding Deque to the typing module.
  26100. - bpo-29219: Fixed infinite recursion in the repr of uninitialized
  26101. ctypes.CDLL instances.
  26102. - bpo-28969: Fixed race condition in C implementation of
  26103. functools.lru_cache. KeyError could be raised when cached function with
  26104. full cache was simultaneously called from different threads with the same
  26105. uncached arguments.
  26106. - bpo-29142: In urllib.request, suffixes in no_proxy environment variable
  26107. with leading dots could match related hostnames again (e.g. .b.c matches
  26108. a.b.c). Patch by Milan Oberkirch.
  26109. Documentation
  26110. -------------
  26111. - bpo-30176: Add missing attribute related constants in curses
  26112. documentation.
  26113. - bpo-26985: Add missing info of code object in inspect documentation.
  26114. - bpo-28929: Link the documentation to its source file on GitHub.
  26115. - bpo-25008: Document smtpd.py as effectively deprecated and add a pointer
  26116. to aiosmtpd, a third-party asyncio-based replacement.
  26117. - bpo-26355: Add canonical header link on each page to corresponding major
  26118. version of the documentation. Patch by Matthias Bussonnier.
  26119. - bpo-29349: Fix Python 2 syntax in code for building the documentation.
  26120. Tests
  26121. -----
  26122. - bpo-30822: Fix regrtest command line parser to allow passing -u
  26123. extralargefile to run test_zipfile64.
  26124. - bpo-30383: regrtest: Enhance regrtest and backport features from the
  26125. master branch. Add options: --coverage, --testdir, --list-tests (list test
  26126. files, don't run them), --list-cases (list test identifiers, don't run
  26127. them, :issue:`30523`), --matchfile (load a list of test filters from a
  26128. text file, :issue:`30540`), --slowest (alias to --slow). Enhance output:
  26129. add timestamp, test result, currently running tests, "Tests result: xxx"
  26130. summary with total duration, etc. Fix reference leak hunting in regrtest,
  26131. --huntrleaks: regrtest now warms up caches, create explicitly all internal
  26132. singletons which are created on demand to prevent false positives when
  26133. checking for reference leaks. (:issue:`30675`).
  26134. - bpo-30357: test_thread: setUp() now uses support.threading_setup() and
  26135. support.threading_cleanup() to wait until threads complete to avoid random
  26136. side effects on following tests. Initial patch written by Grzegorz
  26137. Grzywacz.
  26138. - bpo-28087: Skip test_asyncore and test_eintr poll failures on macOS. Skip
  26139. some tests of select.poll when running on macOS due to unresolved issues
  26140. with the underlying system poll function on some macOS versions.
  26141. - bpo-30197: Enhanced functions swap_attr() and swap_item() in the
  26142. test.support module. They now work when delete replaced attribute or item
  26143. inside the with statement. The old value of the attribute or item (or
  26144. None if it doesn't exist) now will be assigned to the target of the "as"
  26145. clause, if there is one.
  26146. - bpo-29571: to match the behaviour of the ``re.LOCALE`` flag,
  26147. test_re.test_locale_flag now uses ``locale.getpreferredencoding(False)``
  26148. to determine the candidate encoding for the test regex (allowing it to
  26149. correctly skip the test when the default locale encoding is a multi-byte
  26150. encoding)
  26151. Build
  26152. -----
  26153. - bpo-29243: Prevent unnecessary rebuilding of Python during ``make test``,
  26154. ``make install`` and some other make targets when configured with
  26155. ``--enable-optimizations``.
  26156. - bpo-23404: Don't regenerate generated files based on file modification
  26157. time anymore: the action is now explicit. Replace ``make touch`` with
  26158. ``make regen-all``.
  26159. - bpo-29643: Fix ``--enable-optimization`` didn't work.
  26160. Windows
  26161. -------
  26162. - bpo-30687: Locate msbuild.exe on Windows when building rather than
  26163. vcvarsall.bat
  26164. - bpo-29392: Prevent crash when passing invalid arguments into msvcrt
  26165. module.
  26166. C API
  26167. -----
  26168. - bpo-27867: Function PySlice_GetIndicesEx() is replaced with a macro if
  26169. Py_LIMITED_API is set to the value between 0x03050400 and 0x03060000 (not
  26170. including) or 0x03060100 or higher.
  26171. - bpo-29083: Fixed the declaration of some public API functions.
  26172. PyArg_VaParse() and PyArg_VaParseTupleAndKeywords() were not available in
  26173. limited API. PyArg_ValidateKeywordArguments(), PyArg_UnpackTuple() and
  26174. Py_BuildValue() were not available in limited API of version < 3.3 when
  26175. PY_SSIZE_T_CLEAN is defined.
  26176. What's New in Python 3.5.3 final?
  26177. =================================
  26178. *Release date: 2017-01-17*
  26179. There were no code changes between 3.5.3rc1 and 3.5.3 final.
  26180. What's New in Python 3.5.3 release candidate 1?
  26181. ===============================================
  26182. *Release date: 2017-01-02*
  26183. Security
  26184. --------
  26185. - bpo-27278: Fix os.urandom() implementation using getrandom() on Linux.
  26186. Truncate size to INT_MAX and loop until we collected enough random bytes,
  26187. instead of casting a directly Py_ssize_t to int.
  26188. - bpo-22636: Avoid shell injection problems with ctypes.util.find_library().
  26189. Core and Builtins
  26190. -----------------
  26191. - bpo-29073: bytearray formatting no longer truncates on first null byte.
  26192. - bpo-28932: Do not include <sys/random.h> if it does not exist.
  26193. - bpo-28147: Fix a memory leak in split-table dictionaries: setattr() must
  26194. not convert combined table into split table.
  26195. - bpo-25677: Correct the positioning of the syntax error caret for indented
  26196. blocks. Based on patch by Michael Layzell.
  26197. - bpo-29000: Fixed bytes formatting of octals with zero padding in alternate
  26198. form.
  26199. - bpo-28512: Fixed setting the offset attribute of SyntaxError by
  26200. PyErr_SyntaxLocationEx() and PyErr_SyntaxLocationObject().
  26201. - bpo-28991: functools.lru_cache() was susceptible to an obscure reentrancy
  26202. bug caused by a monkey-patched len() function.
  26203. - bpo-28648: Fixed crash in Py_DecodeLocale() in debug build on Mac OS X
  26204. when decode astral characters. Patch by Xiang Zhang.
  26205. - bpo-19398: Extra slash no longer added to sys.path components in case of
  26206. empty compile-time PYTHONPATH components.
  26207. - bpo-28426: Fixed potential crash in PyUnicode_AsDecodedObject() in debug
  26208. build.
  26209. - bpo-23782: Fixed possible memory leak in _PyTraceback_Add() and exception
  26210. loss in PyTraceBack_Here().
  26211. - bpo-28379: Added sanity checks and tests for PyUnicode_CopyCharacters().
  26212. Patch by Xiang Zhang.
  26213. - bpo-28376: The type of long range iterator is now registered as Iterator.
  26214. Patch by Oren Milman.
  26215. - bpo-28376: The constructor of range_iterator now checks that step is not
  26216. 0. Patch by Oren Milman.
  26217. - bpo-26906: Resolving special methods of uninitialized type now causes
  26218. implicit initialization of the type instead of a fail.
  26219. - bpo-18287: PyType_Ready() now checks that tp_name is not NULL. Original
  26220. patch by Niklas Koep.
  26221. - bpo-24098: Fixed possible crash when AST is changed in process of
  26222. compiling it.
  26223. - bpo-28350: String constants with null character no longer interned.
  26224. - bpo-26617: Fix crash when GC runs during weakref callbacks.
  26225. - bpo-27942: String constants now interned recursively in tuples and
  26226. frozensets.
  26227. - bpo-21578: Fixed misleading error message when ImportError called with
  26228. invalid keyword args.
  26229. - bpo-28203: Fix incorrect type in error message from ``complex(1.0,
  26230. {2:3})``. Patch by Soumya Sharma.
  26231. - bpo-27955: Fallback on reading /dev/urandom device when the getrandom()
  26232. syscall fails with EPERM, for example when blocked by SECCOMP.
  26233. - bpo-28131: Fix a regression in zipimport's compile_source(). zipimport
  26234. should use the same optimization level as the interpreter.
  26235. - bpo-25221: Fix corrupted result from PyLong_FromLong(0) when Python is
  26236. compiled with NSMALLPOSINTS = 0.
  26237. - bpo-25758: Prevents zipimport from unnecessarily encoding a filename
  26238. (patch by Eryk Sun)
  26239. - bpo-28189: dictitems_contains no longer swallows compare errors. (Patch by
  26240. Xiang Zhang)
  26241. - bpo-27812: Properly clear out a generator's frame's backreference to the
  26242. generator to prevent crashes in frame.clear().
  26243. - bpo-27811: Fix a crash when a coroutine that has not been awaited is
  26244. finalized with warnings-as-errors enabled.
  26245. - bpo-27587: Fix another issue found by PVS-Studio: Null pointer check after
  26246. use of 'def' in _PyState_AddModule(). Initial patch by Christian Heimes.
  26247. - bpo-26020: set literal evaluation order did not match documented
  26248. behaviour.
  26249. - bpo-27782: Multi-phase extension module import now correctly allows the
  26250. ``m_methods`` field to be used to add module level functions to instances
  26251. of non-module types returned from ``Py_create_mod``. Patch by Xiang Zhang.
  26252. - bpo-27936: The round() function accepted a second None argument for some
  26253. types but not for others. Fixed the inconsistency by accepting None for
  26254. all numeric types.
  26255. - bpo-27487: Warn if a submodule argument to "python -m" or
  26256. runpy.run_module() is found in sys.modules after parent packages are
  26257. imported, but before the submodule is executed.
  26258. - bpo-27558: Fix a SystemError in the implementation of "raise" statement.
  26259. In a brand new thread, raise a RuntimeError since there is no active
  26260. exception to reraise. Patch written by Xiang Zhang.
  26261. - bpo-27419: Standard __import__() no longer look up "__import__" in globals
  26262. or builtins for importing submodules or "from import". Fixed handling an
  26263. error of non-string package name.
  26264. - bpo-27083: Respect the PYTHONCASEOK environment variable under Windows.
  26265. - bpo-27514: Make having too many statically nested blocks a SyntaxError
  26266. instead of SystemError.
  26267. - bpo-27473: Fixed possible integer overflow in bytes and bytearray
  26268. concatenations. Patch by Xiang Zhang.
  26269. - bpo-27507: Add integer overflow check in bytearray.extend(). Patch by
  26270. Xiang Zhang.
  26271. - bpo-27581: Don't rely on wrapping for overflow check in
  26272. PySequence_Tuple(). Patch by Xiang Zhang.
  26273. - bpo-27443: __length_hint__() of bytearray iterators no longer return a
  26274. negative integer for a resized bytearray.
  26275. - bpo-27942: Fix memory leak in codeobject.c
  26276. Library
  26277. -------
  26278. - bpo-15812: inspect.getframeinfo() now correctly shows the first line of a
  26279. context. Patch by Sam Breese.
  26280. - bpo-29094: Offsets in a ZIP file created with extern file object and modes
  26281. "w" and "x" now are relative to the start of the file.
  26282. - bpo-13051: Fixed recursion errors in large or resized
  26283. curses.textpad.Textbox. Based on patch by Tycho Andersen.
  26284. - bpo-29119: Fix weakrefs in the pure python version of
  26285. collections.OrderedDict move_to_end() method. Contributed by Andra
  26286. Bogildea.
  26287. - bpo-9770: curses.ascii predicates now work correctly with negative
  26288. integers.
  26289. - bpo-28427: old keys should not remove new values from WeakValueDictionary
  26290. when collecting from another thread.
  26291. - bpo-28923: Remove editor artifacts from Tix.py.
  26292. - bpo-28871: Fixed a crash when deallocate deep ElementTree.
  26293. - bpo-19542: Fix bugs in WeakValueDictionary.setdefault() and
  26294. WeakValueDictionary.pop() when a GC collection happens in another thread.
  26295. - bpo-20191: Fixed a crash in resource.prlimit() when pass a sequence that
  26296. doesn't own its elements as limits.
  26297. - bpo-28779: multiprocessing.set_forkserver_preload() would crash the
  26298. forkserver process if a preloaded module instantiated some multiprocessing
  26299. objects such as locks.
  26300. - bpo-28847: dbm.dumb now supports reading read-only files and no longer
  26301. writes the index file when it is not changed.
  26302. - bpo-25659: In ctypes, prevent a crash calling the from_buffer() and
  26303. from_buffer_copy() methods on abstract classes like Array.
  26304. - bpo-28732: Fix crash in os.spawnv() with no elements in args
  26305. - bpo-28485: Always raise ValueError for negative
  26306. compileall.compile_dir(workers=...) parameter, even when multithreading is
  26307. unavailable.
  26308. - bpo-28387: Fixed possible crash in _io.TextIOWrapper deallocator when the
  26309. garbage collector is invoked in other thread. Based on patch by Sebastian
  26310. Cufre.
  26311. - bpo-27517: LZMA compressor and decompressor no longer raise exceptions if
  26312. given empty data twice. Patch by Benjamin Fogle.
  26313. - bpo-28549: Fixed segfault in curses's addch() with ncurses6.
  26314. - bpo-28449: tarfile.open() with mode "r" or "r:" now tries to open a tar
  26315. file with compression before trying to open it without compression.
  26316. Otherwise it had 50% chance failed with ignore_zeros=True.
  26317. - bpo-23262: The webbrowser module now supports Firefox 36+ and derived
  26318. browsers. Based on patch by Oleg Broytman.
  26319. - bpo-27939: Fixed bugs in tkinter.ttk.LabeledScale and tkinter.Scale caused
  26320. by representing the scale as float value internally in Tk. tkinter.IntVar
  26321. now works if float value is set to underlying Tk variable.
  26322. - bpo-28255: calendar.TextCalendar().prmonth() no longer prints a space at
  26323. the start of new line after printing a month's calendar. Patch by Xiang
  26324. Zhang.
  26325. - bpo-20491: The textwrap.TextWrapper class now honors non-breaking spaces.
  26326. Based on patch by Kaarle Ritvanen.
  26327. - bpo-28353: os.fwalk() no longer fails on broken links.
  26328. - bpo-25464: Fixed HList.header_exists() in tkinter.tix module by addin a
  26329. workaround to Tix library bug.
  26330. - bpo-28488: shutil.make_archive() no longer add entry "./" to ZIP archive.
  26331. - bpo-24452: Make webbrowser support Chrome on Mac OS X.
  26332. - bpo-20766: Fix references leaked by pdb in the handling of SIGINT
  26333. handlers.
  26334. - bpo-26293: Fixed writing ZIP files that starts not from the start of the
  26335. file. Offsets in ZIP file now are relative to the start of the archive in
  26336. conforming to the specification.
  26337. - bpo-28321: Fixed writing non-BMP characters with binary format in
  26338. plistlib.
  26339. - bpo-28322: Fixed possible crashes when unpickle itertools objects from
  26340. incorrect pickle data. Based on patch by John Leitch.
  26341. - Fix possible integer overflows and crashes in the mmap module with unusual
  26342. usage patterns.
  26343. - bpo-1703178: Fix the ability to pass the --link-objects option to the
  26344. distutils build_ext command.
  26345. - bpo-28253: Fixed calendar functions for extreme months: 0001-01 and
  26346. 9999-12. Methods itermonthdays() and itermonthdays2() are reimplemented so
  26347. that they don't call itermonthdates() which can cause datetime.date
  26348. under/overflow.
  26349. - bpo-28275: Fixed possible use after free in the decompress() methods of
  26350. the LZMADecompressor and BZ2Decompressor classes. Original patch by John
  26351. Leitch.
  26352. - bpo-27897: Fixed possible crash in sqlite3.Connection.create_collation()
  26353. if pass invalid string-like object as a name. Patch by Xiang Zhang.
  26354. - bpo-18893: Fix invalid exception handling in Lib/ctypes/macholib/dyld.py.
  26355. Patch by Madison May.
  26356. - bpo-27611: Fixed support of default root window in the tkinter.tix module.
  26357. - bpo-27348: In the traceback module, restore the formatting of exception
  26358. messages like "Exception: None". This fixes a regression introduced in
  26359. 3.5a2.
  26360. - bpo-25651: Allow false values to be used for msg parameter of subTest().
  26361. - bpo-27932: Prevent memory leak in win32_ver().
  26362. - Fix UnboundLocalError in socket._sendfile_use_sendfile.
  26363. - bpo-28075: Check for ERROR_ACCESS_DENIED in Windows implementation of
  26364. os.stat(). Patch by Eryk Sun.
  26365. - bpo-25270: Prevent codecs.escape_encode() from raising SystemError when an
  26366. empty bytestring is passed.
  26367. - bpo-28181: Get antigravity over HTTPS. Patch by Kaartic Sivaraam.
  26368. - bpo-25895: Enable WebSocket URL schemes in urllib.parse.urljoin. Patch by
  26369. Gergely Imreh and Markus Holtermann.
  26370. - bpo-27599: Fixed buffer overrun in binascii.b2a_qp() and
  26371. binascii.a2b_qp().
  26372. - bpo-19003: m email.generator now replaces only ``\r`` and/or ``\n`` line
  26373. endings, per the RFC, instead of all unicode line endings.
  26374. - bpo-28019: itertools.count() no longer rounds non-integer step in range
  26375. between 1.0 and 2.0 to 1.
  26376. - bpo-25969: Update the lib2to3 grammar to handle the unpacking
  26377. generalizations added in 3.5.
  26378. - bpo-14977: mailcap now respects the order of the lines in the mailcap
  26379. files ("first match"), as required by RFC 1542. Patch by Michael Lazar.
  26380. - bpo-24594: Validates persist parameter when opening MSI database
  26381. - bpo-17582: xml.etree.ElementTree nows preserves whitespaces in attributes
  26382. (Patch by Duane Griffin. Reviewed and approved by Stefan Behnel.)
  26383. - bpo-28047: Fixed calculation of line length used for the base64 CTE in the
  26384. new email policies.
  26385. - bpo-27445: Don't pass str(_charset) to MIMEText.set_payload(). Patch by
  26386. Claude Paroz.
  26387. - bpo-22450: urllib now includes an ``Accept: */*`` header among the default
  26388. headers. This makes the results of REST API requests more consistent and
  26389. predictable especially when proxy servers are involved.
  26390. - lib2to3.pgen3.driver.load_grammar() now creates a stable cache file
  26391. between runs given the same Grammar.txt input regardless of the hash
  26392. randomization setting.
  26393. - bpo-27570: Avoid zero-length memcpy() etc calls with null source pointers
  26394. in the "ctypes" and "array" modules.
  26395. - bpo-22233: Break email header lines *only* on the RFC specified CR and LF
  26396. characters, not on arbitrary unicode line breaks. This also fixes a bug
  26397. in HTTP header parsing.
  26398. - bpo-27988: Fix email iter_attachments incorrect mutation of payload list.
  26399. - bpo-27691: Fix ssl module's parsing of GEN_RID subject alternative name
  26400. fields in X.509 certs.
  26401. - bpo-27850: Remove 3DES from ssl module's default cipher list to counter
  26402. measure sweet32 attack (CVE-2016-2183).
  26403. - bpo-27766: Add ChaCha20 Poly1305 to ssl module's default cipher list.
  26404. (Required OpenSSL 1.1.0 or LibreSSL).
  26405. - bpo-26470: Port ssl and hashlib module to OpenSSL 1.1.0.
  26406. - Remove support for passing a file descriptor to os.access. It never worked
  26407. but previously didn't raise.
  26408. - bpo-12885: Fix error when distutils encounters symlink.
  26409. - bpo-27881: Fixed possible bugs when setting
  26410. sqlite3.Connection.isolation_level. Based on patch by Xiang Zhang.
  26411. - bpo-27861: Fixed a crash in sqlite3.Connection.cursor() when a factory
  26412. creates not a cursor. Patch by Xiang Zhang.
  26413. - bpo-19884: Avoid spurious output on OS X with Gnu Readline.
  26414. - bpo-27706: Restore deterministic behavior of random.Random().seed() for
  26415. string seeds using seeding version 1. Allows sequences of calls to
  26416. random() to exactly match those obtained in Python 2. Patch by Nofar
  26417. Schnider.
  26418. - bpo-10513: Fix a regression in Connection.commit(). Statements should not
  26419. be reset after a commit.
  26420. - A new version of typing.py from https://github.com/python/typing:
  26421. Collection (only for 3.6) (Issue #27598). Add FrozenSet to __all__
  26422. (upstream #261). Fix crash in _get_type_vars() (upstream #259). Remove the
  26423. dict constraint in ForwardRef._eval_type (upstream #252).
  26424. - bpo-27539: Fix unnormalised ``Fraction.__pow__`` result in the case of
  26425. negative exponent and negative base.
  26426. - bpo-21718: cursor.description is now available for queries using CTEs.
  26427. - bpo-2466: posixpath.ismount now correctly recognizes mount points which
  26428. the user does not have permission to access.
  26429. - bpo-27773: Correct some memory management errors server_hostname in
  26430. _ssl.wrap_socket().
  26431. - bpo-26750: unittest.mock.create_autospec() now works properly for
  26432. subclasses of property() and other data descriptors.
  26433. - In the curses module, raise an error if window.getstr() or window.instr()
  26434. is passed a negative value.
  26435. - bpo-27783: Fix possible usage of uninitialized memory in
  26436. operator.methodcaller.
  26437. - bpo-27774: Fix possible Py_DECREF on unowned object in _sre.
  26438. - bpo-27760: Fix possible integer overflow in binascii.b2a_qp.
  26439. - bpo-27758: Fix possible integer overflow in the _csv module for large
  26440. record lengths.
  26441. - bpo-27568: Prevent HTTPoxy attack (CVE-2016-1000110). Ignore the
  26442. HTTP_PROXY variable when REQUEST_METHOD environment is set, which
  26443. indicates that the script is in CGI mode.
  26444. - bpo-27656: Do not assume sched.h defines any SCHED_* constants.
  26445. - bpo-27130: In the "zlib" module, fix handling of large buffers (typically
  26446. 4 GiB) when compressing and decompressing. Previously, inputs were
  26447. limited to 4 GiB, and compression and decompression operations did not
  26448. properly handle results of 4 GiB.
  26449. - bpo-27533: Release GIL in nt._isdir
  26450. - bpo-17711: Fixed unpickling by the persistent ID with protocol 0. Original
  26451. patch by Alexandre Vassalotti.
  26452. - bpo-27522: Avoid an unintentional reference cycle in email.feedparser.
  26453. - bpo-26844: Fix error message for imp.find_module() to refer to 'path'
  26454. instead of 'name'. Patch by Lev Maximov.
  26455. - bpo-23804: Fix SSL zero-length recv() calls to not block and not raise an
  26456. error about unclean EOF.
  26457. - bpo-27466: Change time format returned by http.cookie.time2netscape,
  26458. confirming the netscape cookie format and making it consistent with
  26459. documentation.
  26460. - bpo-26664: Fix activate.fish by removing mis-use of ``$``.
  26461. - bpo-22115: Fixed tracing Tkinter variables: trace_vdelete() with wrong
  26462. mode no longer break tracing, trace_vinfo() now always returns a list of
  26463. pairs of strings, tracing in the "u" mode now works.
  26464. - Fix a scoping issue in importlib.util.LazyLoader which triggered an
  26465. UnboundLocalError when lazy-loading a module that was already put into
  26466. sys.modules.
  26467. - bpo-27079: Fixed curses.ascii functions isblank(), iscntrl() and
  26468. ispunct().
  26469. - bpo-26754: Some functions (compile() etc) accepted a filename argument
  26470. encoded as an iterable of integers. Now only strings and byte-like objects
  26471. are accepted.
  26472. - bpo-27048: Prevents distutils failing on Windows when environment
  26473. variables contain non-ASCII characters
  26474. - bpo-27330: Fixed possible leaks in the ctypes module.
  26475. - bpo-27238: Got rid of bare excepts in the turtle module. Original patch
  26476. by Jelle Zijlstra.
  26477. - bpo-27122: When an exception is raised within the context being managed by
  26478. a contextlib.ExitStack() and one of the exit stack generators catches and
  26479. raises it in a chain, do not re-raise the original exception when exiting,
  26480. let the new chained one through. This avoids the :pep:`479` bug described
  26481. in issue25782.
  26482. - bpo-26386: Fixed ttk.TreeView selection operations with item id's
  26483. containing spaces.
  26484. - bpo-16182: Fix various functions in the "readline" module to use the
  26485. locale encoding, and fix get_begidx() and get_endidx() to return code
  26486. point indexes.
  26487. - bpo-27392: Add loop.connect_accepted_socket(). Patch by Jim Fulton.
  26488. - bpo-27930: Improved behaviour of logging.handlers.QueueListener. Thanks to
  26489. Paulo Andrade and Petr Viktorin for the analysis and patch.
  26490. - bpo-21201: Improves readability of multiprocessing error message. Thanks
  26491. to Wojciech Walczak for patch.
  26492. - bpo-27456: asyncio: Set TCP_NODELAY by default.
  26493. - bpo-27906: Fix socket accept exhaustion during high TCP traffic. Patch by
  26494. Kevin Conway.
  26495. - bpo-28174: Handle when SO_REUSEPORT isn't properly supported. Patch by
  26496. Seth Michael Larson.
  26497. - bpo-26654: Inspect functools.partial in asyncio.Handle.__repr__. Patch by
  26498. iceboy.
  26499. - bpo-26909: Fix slow pipes IO in asyncio. Patch by INADA Naoki.
  26500. - bpo-28176: Fix callbacks race in asyncio.SelectorLoop.sock_connect.
  26501. - bpo-27759: Fix selectors incorrectly retain invalid file descriptors.
  26502. Patch by Mark Williams.
  26503. - bpo-28368: Refuse monitoring processes if the child watcher has no loop
  26504. attached. Patch by Vincent Michel.
  26505. - bpo-28369: Raise RuntimeError when transport's FD is used with add_reader,
  26506. add_writer, etc.
  26507. - bpo-28370: Speedup asyncio.StreamReader.readexactly. Patch by Коренберг
  26508. Марк.
  26509. - bpo-28371: Deprecate passing asyncio.Handles to run_in_executor.
  26510. - bpo-28372: Fix asyncio to support formatting of non-python coroutines.
  26511. - bpo-28399: Remove UNIX socket from FS before binding. Patch by Коренберг
  26512. Марк.
  26513. - bpo-27972: Prohibit Tasks to await on themselves.
  26514. - bpo-26923: Fix asyncio.Gather to refuse being cancelled once all children
  26515. are done. Patch by Johannes Ebke.
  26516. - bpo-26796: Don't configure the number of workers for default threadpool
  26517. executor. Initial patch by Hans Lawrenz.
  26518. - bpo-28600: Optimize loop.call_soon().
  26519. - bpo-28613: Fix get_event_loop() return the current loop if called from
  26520. coroutines/callbacks.
  26521. - bpo-28639: Fix inspect.isawaitable to always return bool Patch by Justin
  26522. Mayfield.
  26523. - bpo-28652: Make loop methods reject socket kinds they do not support.
  26524. - bpo-28653: Fix a refleak in functools.lru_cache.
  26525. - bpo-28703: Fix asyncio.iscoroutinefunction to handle Mock objects.
  26526. - bpo-24142: Reading a corrupt config file left the parser in an invalid
  26527. state. Original patch by Florian Höch.
  26528. - bpo-28990: Fix SSL hanging if connection is closed before handshake
  26529. completed. (Patch by HoHo-Ho)
  26530. IDLE
  26531. ----
  26532. - bpo-15308: Add 'interrupt execution' (^C) to Shell menu. Patch by Roger
  26533. Serwy, updated by Bayard Randel.
  26534. - bpo-27922: Stop IDLE tests from 'flashing' gui widgets on the screen.
  26535. - Add version to title of IDLE help window.
  26536. - bpo-25564: In section on IDLE -- console differences, mention that using
  26537. exec means that __builtins__ is defined for each statement.
  26538. - bpo-27714: text_textview and test_autocomplete now pass when re-run in the
  26539. same process. This occurs when test_idle fails when run with the -w
  26540. option but without -jn. Fix warning from test_config.
  26541. - bpo-25507: IDLE no longer runs buggy code because of its tkinter imports.
  26542. Users must include the same imports required to run directly in Python.
  26543. - bpo-27452: add line counter and crc to IDLE configHandler test dump.
  26544. - bpo-27365: Allow non-ascii chars in IDLE NEWS.txt, for contributor names.
  26545. - bpo-27245: IDLE: Cleanly delete custom themes and key bindings.
  26546. Previously, when IDLE was started from a console or by import, a cascade
  26547. of warnings was emitted. Patch by Serhiy Storchaka.
  26548. C API
  26549. -----
  26550. - bpo-28808: PyUnicode_CompareWithASCIIString() now never raises exceptions.
  26551. - bpo-26754: PyUnicode_FSDecoder() accepted a filename argument encoded as
  26552. an iterable of integers. Now only strings and bytes-like objects are
  26553. accepted.
  26554. Documentation
  26555. -------------
  26556. - bpo-28513: Documented command-line interface of zipfile.
  26557. Tests
  26558. -----
  26559. - bpo-28950: Disallow -j0 to be combined with -T/-l/-M in regrtest command
  26560. line arguments.
  26561. - bpo-28666: Now test.support.rmtree is able to remove unwritable or
  26562. unreadable directories.
  26563. - bpo-23839: Various caches now are cleared before running every test file.
  26564. - bpo-28409: regrtest: fix the parser of command line arguments.
  26565. - bpo-27787: Call gc.collect() before checking each test for "dangling
  26566. threads", since the dangling threads are weak references.
  26567. - bpo-27369: In test_pyexpat, avoid testing an error message detail that
  26568. changed in Expat 2.2.0.
  26569. Tools/Demos
  26570. -----------
  26571. - bpo-27952: Get Tools/scripts/fixcid.py working with Python 3 and the
  26572. current "re" module, avoid invalid Python backslash escapes, and fix a bug
  26573. parsing escaped C quote signs.
  26574. - bpo-27332: Fixed the type of the first argument of module-level functions
  26575. generated by Argument Clinic. Patch by Petr Viktorin.
  26576. - bpo-27418: Fixed Tools/importbench/importbench.py.
  26577. Windows
  26578. -------
  26579. - bpo-28251: Improvements to help manuals on Windows.
  26580. - bpo-28110: launcher.msi has different product codes between 32-bit and
  26581. 64-bit
  26582. - bpo-25144: Ensures TargetDir is set before continuing with custom install.
  26583. - bpo-27469: Adds a shell extension to the launcher so that drag and drop
  26584. works correctly.
  26585. - bpo-27309: Enabled proper Windows styles in python[w].exe manifest.
  26586. Build
  26587. -----
  26588. - bpo-29080: Removes hard dependency on hg.exe from PCBuild/build.bat
  26589. - bpo-23903: Added missed names to PC/python3.def.
  26590. - bpo-10656: Fix out-of-tree building on AIX. Patch by Tristan Carel and
  26591. Michael Haubenwallner.
  26592. - bpo-26359: Rename --with-optimiations to --enable-optimizations.
  26593. - bpo-28444: Fix missing extensions modules when cross compiling.
  26594. - bpo-28248: Update Windows build and OS X installers to use OpenSSL 1.0.2j.
  26595. - bpo-28258: Fixed build with Estonian locale (python-config and distclean
  26596. targets in Makefile). Patch by Arfrever Frehtes Taifersar Arahesis.
  26597. - bpo-26661: setup.py now detects system libffi with multiarch wrapper.
  26598. - bpo-28066: Fix the logic that searches build directories for generated
  26599. include files when building outside the source tree.
  26600. - bpo-15819: Remove redundant include search directory option for building
  26601. outside the source tree.
  26602. - bpo-27566: Fix clean target in freeze makefile (patch by Lisa Roach)
  26603. - bpo-27705: Update message in validate_ucrtbase.py
  26604. - bpo-27983: Cause lack of llvm-profdata tool when using clang as required
  26605. for PGO linking to be a configure time error rather than make time when
  26606. --with-optimizations is enabled. Also improve our ability to find the
  26607. llvm-profdata tool on MacOS and some Linuxes.
  26608. - bpo-26307: The profile-opt build now applies PGO to the built-in modules.
  26609. - bpo-26359: Add the --with-optimizations configure flag.
  26610. - bpo-27713: Suppress spurious build warnings when updating importlib's
  26611. bootstrap files. Patch by Xiang Zhang
  26612. - bpo-25825: Correct the references to Modules/python.exp and ld_so_aix,
  26613. which are required on AIX. This updates references to an installation
  26614. path that was changed in 3.2a4, and undoes changed references to the build
  26615. tree that were made in 3.5.0a1.
  26616. - bpo-27453: CPP invocation in configure must use CPPFLAGS. Patch by Chi
  26617. Hsuan Yen.
  26618. - bpo-27641: The configure script now inserts comments into the makefile to
  26619. prevent the pgen and _freeze_importlib executables from being
  26620. cross-compiled.
  26621. - bpo-26662: Set PYTHON_FOR_GEN in configure as the Python program to be
  26622. used for file generation during the build.
  26623. - bpo-10910: Avoid C++ compilation errors on FreeBSD and OS X. Also update
  26624. FreedBSD version checks for the original ctype UTF-8 workaround.
  26625. - bpo-28676: Prevent missing 'getentropy' declaration warning on macOS.
  26626. Patch by Gareth Rees.
  26627. What's New in Python 3.5.2 final?
  26628. =================================
  26629. *Release date: 2016-06-26*
  26630. Core and Builtins
  26631. -----------------
  26632. - bpo-26930: Update Windows builds to use OpenSSL 1.0.2h.
  26633. Tests
  26634. -----
  26635. - bpo-26867: Ubuntu's openssl OP_NO_SSLv3 is forced on by default; fix test.
  26636. IDLE
  26637. ----
  26638. - bpo-27365: Allow non-ascii in idlelib/NEWS.txt - minimal part for 3.5.2.
  26639. What's New in Python 3.5.2 release candidate 1?
  26640. ===============================================
  26641. *Release date: 2016-06-12*
  26642. Security
  26643. --------
  26644. - bpo-26556: Update expat to 2.1.1, fixes CVE-2015-1283.
  26645. - Fix TLS stripping vulnerability in smtplib, CVE-2016-0772. Reported by
  26646. Team Oststrom
  26647. - bpo-26839: On Linux, :func:`os.urandom` now calls ``getrandom()`` with
  26648. ``GRND_NONBLOCK`` to fall back on reading ``/dev/urandom`` if the urandom
  26649. entropy pool is not initialized yet. Patch written by Colm Buckley.
  26650. - bpo-26657: Fix directory traversal vulnerability with http.server on
  26651. Windows. This fixes a regression that was introduced in 3.3.4rc1 and
  26652. 3.4.0rc1. Based on patch by Philipp Hagemeister.
  26653. - bpo-26313: ssl.py _load_windows_store_certs fails if windows cert store is
  26654. empty. Patch by Baji.
  26655. - bpo-25939: On Windows open the cert store readonly in
  26656. ssl.enum_certificates.
  26657. Core and Builtins
  26658. -----------------
  26659. - bpo-27066: Fixed SystemError if a custom opener (for open()) returns a
  26660. negative number without setting an exception.
  26661. - bpo-20041: Fixed TypeError when frame.f_trace is set to None. Patch by
  26662. Xavier de Gaye.
  26663. - bpo-26168: Fixed possible refleaks in failing Py_BuildValue() with the "N"
  26664. format unit.
  26665. - bpo-26991: Fix possible refleak when creating a function with annotations.
  26666. - bpo-27039: Fixed bytearray.remove() for values greater than 127. Patch by
  26667. Joe Jevnik.
  26668. - bpo-23640: int.from_bytes() no longer bypasses constructors for
  26669. subclasses.
  26670. - bpo-26811: gc.get_objects() no longer contains a broken tuple with NULL
  26671. pointer.
  26672. - bpo-20120: Use RawConfigParser for .pypirc parsing, removing support for
  26673. interpolation unintentionally added with move to Python 3. Behavior no
  26674. longer does any interpolation in .pypirc files, matching behavior in
  26675. Python 2.7 and Setuptools 19.0.
  26676. - bpo-26659: Make the builtin slice type support cycle collection.
  26677. - bpo-26718: super.__init__ no longer leaks memory if called multiple times.
  26678. NOTE: A direct call of super.__init__ is not endorsed!
  26679. - bpo-25339: PYTHONIOENCODING now has priority over locale in setting the
  26680. error handler for stdin and stdout.
  26681. - bpo-26494: Fixed crash on iterating exhausting iterators. Affected classes
  26682. are generic sequence iterators, iterators of str, bytes, bytearray, list,
  26683. tuple, set, frozenset, dict, OrderedDict, corresponding views and
  26684. os.scandir() iterator.
  26685. - bpo-26581: If coding cookie is specified multiple times on a line in
  26686. Python source code file, only the first one is taken to account.
  26687. - bpo-26464: Fix str.translate() when string is ASCII and first replacements
  26688. removes character, but next replacement uses a non-ASCII character or a
  26689. string longer than 1 character. Regression introduced in Python 3.5.0.
  26690. - bpo-22836: Ensure exception reports from PyErr_Display() and
  26691. PyErr_WriteUnraisable() are sensible even when formatting them produces
  26692. secondary errors. This affects the reports produced by
  26693. sys.__excepthook__() and when __del__() raises an exception.
  26694. - bpo-26302: Correct behavior to reject comma as a legal character for
  26695. cookie names.
  26696. - bpo-4806: Avoid masking the original TypeError exception when using star
  26697. (``*``) unpacking in function calls. Based on patch by Hagen Fürstenau
  26698. and Daniel Urban.
  26699. - bpo-27138: Fix the doc comment for FileFinder.find_spec().
  26700. - bpo-26154: Add a new private _PyThreadState_UncheckedGet() function to get
  26701. the current Python thread state, but don't issue a fatal error if it is
  26702. NULL. This new function must be used instead of accessing directly the
  26703. _PyThreadState_Current variable. The variable is no more exposed since
  26704. Python 3.5.1 to hide the exact implementation of atomic C types, to avoid
  26705. compiler issues.
  26706. - bpo-26194: Deque.insert() gave odd results for bounded deques that had
  26707. reached their maximum size. Now an IndexError will be raised when
  26708. attempting to insert into a full deque.
  26709. - bpo-25843: When compiling code, don't merge constants if they are equal
  26710. but have a different types. For example, ``f1, f2 = lambda: 1, lambda:
  26711. 1.0`` is now correctly compiled to two different functions: ``f1()``
  26712. returns ``1`` (``int``) and ``f2()`` returns ``1.0`` (``int``), even if
  26713. ``1`` and ``1.0`` are equal.
  26714. - bpo-22995: [UPDATE] Comment out the one of the pickleability tests in
  26715. _PyObject_GetState() due to regressions observed in Cython-based projects.
  26716. - bpo-25961: Disallowed null characters in the type name.
  26717. - bpo-25973: Fix segfault when an invalid nonlocal statement binds a name
  26718. starting with two underscores.
  26719. - bpo-22995: Instances of extension types with a state that aren't
  26720. subclasses of list or dict and haven't implemented any pickle-related
  26721. methods (__reduce__, __reduce_ex__, __getnewargs__, __getnewargs_ex__, or
  26722. __getstate__), can no longer be pickled. Including memoryview.
  26723. - bpo-20440: Massive replacing unsafe attribute setting code with special
  26724. macro Py_SETREF.
  26725. - bpo-25766: Special method __bytes__() now works in str subclasses.
  26726. - bpo-25421: __sizeof__ methods of builtin types now use dynamic basic size.
  26727. This allows sys.getsize() to work correctly with their subclasses with
  26728. __slots__ defined.
  26729. - bpo-25709: Fixed problem with in-place string concatenation and utf-8
  26730. cache.
  26731. - bpo-27147: Mention :pep:`420` in the importlib docs.
  26732. - bpo-24097: Fixed crash in object.__reduce__() if slot name is freed inside
  26733. __getattr__.
  26734. - bpo-24731: Fixed crash on converting objects with special methods
  26735. __bytes__, __trunc__, and __float__ returning instances of subclasses of
  26736. bytes, int, and float to subclasses of bytes, int, and float
  26737. correspondingly.
  26738. - bpo-26478: Fix semantic bugs when using binary operators with dictionary
  26739. views and tuples.
  26740. - bpo-26171: Fix possible integer overflow and heap corruption in
  26741. zipimporter.get_data().
  26742. - bpo-25660: Fix TAB key behaviour in REPL with readline.
  26743. - bpo-25887: Raise a RuntimeError when a coroutine object is awaited more
  26744. than once.
  26745. - bpo-27243: Update the __aiter__ protocol: instead of returning an
  26746. awaitable that resolves to an asynchronous iterator, the asynchronous
  26747. iterator should be returned directly. Doing the former will trigger a
  26748. PendingDeprecationWarning.
  26749. Library
  26750. -------
  26751. - bpo-21386: Implement missing IPv4Address.is_global property. It was
  26752. documented since 07a5610bae9d. Initial patch by Roger Luethi.
  26753. - bpo-20900: distutils register command now decodes HTTP responses
  26754. correctly. Initial patch by ingrid.
  26755. - A new version of typing.py provides several new classes and features:
  26756. @overload outside stubs, Reversible, DefaultDict, Text, ContextManager,
  26757. Type[], NewType(), TYPE_CHECKING, and numerous bug fixes (note that some
  26758. of the new features are not yet implemented in mypy or other static
  26759. analyzers). Also classes for :pep:`492` (Awaitable, AsyncIterable,
  26760. AsyncIterator) have been added (in fact they made it into 3.5.1 but were
  26761. never mentioned).
  26762. - bpo-25738: Stop http.server.BaseHTTPRequestHandler.send_error() from
  26763. sending a message body for 205 Reset Content. Also, don't send Content
  26764. header fields in responses that don't have a body. Patch by Susumu
  26765. Koshiba.
  26766. - bpo-21313: Fix the "platform" module to tolerate when sys.version contains
  26767. truncated build information.
  26768. - bpo-27164: In the zlib module, allow decompressing raw Deflate streams
  26769. with a predefined zdict. Based on patch by Xiang Zhang.
  26770. - bpo-24291: Fix wsgiref.simple_server.WSGIRequestHandler to completely
  26771. write data to the client. Previously it could do partial writes and
  26772. truncate data. Also, wsgiref.handler.ServerHandler can now handle stdout
  26773. doing partial writes, but this is deprecated.
  26774. - bpo-26809: Add ``__all__`` to :mod:`string`. Patch by Emanuel Barry.
  26775. - bpo-26373: subprocess.Popen.communicate now correctly ignores
  26776. BrokenPipeError when the child process dies before .communicate() is
  26777. called in more/all circumstances.
  26778. - bpo-21776: distutils.upload now correctly handles HTTPError. Initial patch
  26779. by Claudiu Popa.
  26780. - bpo-27114: Fix SSLContext._load_windows_store_certs fails with
  26781. PermissionError
  26782. - bpo-18383: Avoid creating duplicate filters when using filterwarnings and
  26783. simplefilter. Based on patch by Alex Shkop.
  26784. - bpo-27057: Fix os.set_inheritable() on Android, ioctl() is blocked by
  26785. SELinux and fails with EACCESS. The function now falls back to fcntl().
  26786. Patch written by Michał Bednarski.
  26787. - bpo-27014: Fix infinite recursion using typing.py. Thanks to Kalle Tuure!
  26788. - bpo-14132: Fix urllib.request redirect handling when the target only has a
  26789. query string. Original fix by Ján Janech.
  26790. - bpo-17214: The "urllib.request" module now percent-encodes non-ASCII bytes
  26791. found in redirect target URLs. Some servers send Location header fields
  26792. with non-ASCII bytes, but "http.client" requires the request target to be
  26793. ASCII-encodable, otherwise a UnicodeEncodeError is raised. Based on patch
  26794. by Christian Heimes.
  26795. - bpo-26892: Honor debuglevel flag in urllib.request.HTTPHandler. Patch
  26796. contributed by Chi Hsuan Yen.
  26797. - bpo-22274: In the subprocess module, allow stderr to be redirected to
  26798. stdout even when stdout is not redirected. Patch by Akira Li.
  26799. - bpo-26807: mock_open 'files' no longer error on readline at end of file.
  26800. Patch from Yolanda Robla.
  26801. - bpo-25745: Fixed leaking a userptr in curses panel destructor.
  26802. - bpo-26977: Removed unnecessary, and ignored, call to sum of squares helper
  26803. in statistics.pvariance.
  26804. - bpo-26881: The modulefinder module now supports extended opcode arguments.
  26805. - bpo-23815: Fixed crashes related to directly created instances of types in
  26806. _tkinter and curses.panel modules.
  26807. - bpo-17765: weakref.ref() no longer silently ignores keyword arguments.
  26808. Patch by Georg Brandl.
  26809. - bpo-26873: xmlrpc now raises ResponseError on unsupported type tags
  26810. instead of silently return incorrect result.
  26811. - bpo-26711: Fixed the comparison of plistlib.Data with other types.
  26812. - bpo-24114: Fix an uninitialized variable in ``ctypes.util``. The bug only
  26813. occurs on SunOS when the ctypes implementation searches for the ``crle``
  26814. program. Patch by Xiang Zhang. Tested on SunOS by Kees Bos.
  26815. - bpo-26864: In urllib.request, change the proxy bypass host checking
  26816. against no_proxy to be case-insensitive, and to not match unrelated host
  26817. names that happen to have a bypassed hostname as a suffix. Patch by Xiang
  26818. Zhang.
  26819. - bpo-26634: recursive_repr() now sets __qualname__ of wrapper. Patch by
  26820. Xiang Zhang.
  26821. - bpo-26804: urllib.request will prefer lower_case proxy environment
  26822. variables over UPPER_CASE or Mixed_Case ones. Patch contributed by
  26823. Hans-Peter Jansen.
  26824. - bpo-26837: assertSequenceEqual() now correctly outputs non-stringified
  26825. differing items (like bytes in the -b mode). This affects
  26826. assertListEqual() and assertTupleEqual().
  26827. - bpo-26041: Remove "will be removed in Python 3.7" from deprecation
  26828. messages of platform.dist() and platform.linux_distribution(). Patch by
  26829. Kumaripaba Miyurusara Athukorala.
  26830. - bpo-26822: itemgetter, attrgetter and methodcaller objects no longer
  26831. silently ignore keyword arguments.
  26832. - bpo-26733: Disassembling a class now disassembles class and static
  26833. methods. Patch by Xiang Zhang.
  26834. - bpo-26801: Fix error handling in :func:`shutil.get_terminal_size`, catch
  26835. :exc:`AttributeError` instead of :exc:`NameError`. Patch written by
  26836. Emanuel Barry.
  26837. - bpo-24838: tarfile's ustar and gnu formats now correctly calculate name
  26838. and link field limits for multibyte character encodings like utf-8.
  26839. - bpo-26717: Stop encoding Latin-1-ized WSGI paths with UTF-8. Patch by
  26840. Anthony Sottile.
  26841. - bpo-26735: Fix :func:`os.urandom` on Solaris 11.3 and newer when reading
  26842. more than 1,024 bytes: call ``getrandom()`` multiple times with a limit of
  26843. 1024 bytes per call.
  26844. - bpo-16329: Add .webm to mimetypes.types_map. Patch by Giampaolo Rodola'.
  26845. - bpo-13952: Add .csv to mimetypes.types_map. Patch by Geoff Wilson.
  26846. - bpo-26709: Fixed Y2038 problem in loading binary PLists.
  26847. - bpo-23735: Handle terminal resizing with Readline 6.3+ by installing our
  26848. own SIGWINCH handler. Patch by Eric Price.
  26849. - bpo-26586: In http.server, respond with "413 Request header fields too
  26850. large" if there are too many header fields to parse, rather than killing
  26851. the connection and raising an unhandled exception. Patch by Xiang Zhang.
  26852. - bpo-22854: Change BufferedReader.writable() and BufferedWriter.readable()
  26853. to always return False.
  26854. - bpo-25195: Fix a regression in mock.MagicMock. _Call is a subclass of
  26855. tuple (changeset 3603bae63c13 only works for classes) so we need to
  26856. implement __ne__ ourselves. Patch by Andrew Plummer.
  26857. - bpo-26644: Raise ValueError rather than SystemError when a negative length
  26858. is passed to SSLSocket.recv() or read().
  26859. - bpo-23804: Fix SSL recv(0) and read(0) methods to return zero bytes
  26860. instead of up to 1024.
  26861. - bpo-26616: Fixed a bug in datetime.astimezone() method.
  26862. - bpo-21925: :func:`warnings.formatwarning` now catches exceptions on
  26863. ``linecache.getline(...)`` to be able to log :exc:`ResourceWarning`
  26864. emitted late during the Python shutdown process.
  26865. - bpo-24266: Ctrl+C during Readline history search now cancels the search
  26866. mode when compiled with Readline 7.
  26867. - bpo-26560: Avoid potential ValueError in BaseHandler.start_response.
  26868. Initial patch by Peter Inglesby.
  26869. - bpo-26569: Fix :func:`pyclbr.readmodule` and :func:`pyclbr.readmodule_ex`
  26870. to support importing packages.
  26871. - bpo-26499: Account for remaining Content-Length in HTTPResponse.readline()
  26872. and read1(). Based on patch by Silent Ghost. Also document that
  26873. HTTPResponse now supports these methods.
  26874. - bpo-25320: Handle sockets in directories unittest discovery is scanning.
  26875. Patch from Victor van den Elzen.
  26876. - bpo-16181: cookiejar.http2time() now returns None if year is higher than
  26877. datetime.MAXYEAR.
  26878. - bpo-26513: Fixes platform module detection of Windows Server
  26879. - bpo-23718: Fixed parsing time in week 0 before Jan 1. Original patch by
  26880. Tamás Bence Gedai.
  26881. - bpo-20589: Invoking Path.owner() and Path.group() on Windows now raise
  26882. NotImplementedError instead of ImportError.
  26883. - bpo-26177: Fixed the keys() method for Canvas and Scrollbar widgets.
  26884. - bpo-15068: Got rid of excessive buffering in the fileinput module. The
  26885. bufsize parameter is no longer used.
  26886. - bpo-2202: Fix UnboundLocalError in
  26887. AbstractDigestAuthHandler.get_algorithm_impls. Initial patch by Mathieu
  26888. Dupuy.
  26889. - bpo-25718: Fixed pickling and copying the accumulate() iterator with total
  26890. is None.
  26891. - bpo-26475: Fixed debugging output for regular expressions with the (?x)
  26892. flag.
  26893. - bpo-26457: Fixed the subnets() methods in IP network classes for the case
  26894. when resulting prefix length is equal to maximal prefix length. Based on
  26895. patch by Xiang Zhang.
  26896. - bpo-26385: Remove the file if the internal open() call in
  26897. NamedTemporaryFile() fails. Patch by Silent Ghost.
  26898. - bpo-26402: Fix XML-RPC client to retry when the server shuts down a
  26899. persistent connection. This was a regression related to the new
  26900. http.client.RemoteDisconnected exception in 3.5.0a4.
  26901. - bpo-25913: Leading ``<~`` is optional now in base64.a85decode() with
  26902. adobe=True. Patch by Swati Jaiswal.
  26903. - bpo-26186: Remove an invalid type check in importlib.util.LazyLoader.
  26904. - bpo-26367: importlib.__import__() raises SystemError like
  26905. builtins.__import__() when ``level`` is specified but without an
  26906. accompanying package specified.
  26907. - bpo-26309: In the "socketserver" module, shut down the request (closing
  26908. the connected socket) when verify_request() returns false. Patch by Aviv
  26909. Palivoda.
  26910. - bpo-25995: os.walk() no longer uses FDs proportional to the tree depth.
  26911. - bpo-26117: The os.scandir() iterator now closes file descriptor not only
  26912. when the iteration is finished, but when it was failed with error.
  26913. - bpo-25911: Restored support of bytes paths in os.walk() on Windows.
  26914. - bpo-26045: Add UTF-8 suggestion to error message when posting a
  26915. non-Latin-1 string with http.client.
  26916. - bpo-12923: Reset FancyURLopener's redirect counter even if there is an
  26917. exception. Based on patches by Brian Brazil and Daniel Rocco.
  26918. - bpo-25945: Fixed a crash when unpickle the functools.partial object with
  26919. wrong state. Fixed a leak in failed functools.partial constructor. "args"
  26920. and "keywords" attributes of functools.partial have now always types tuple
  26921. and dict correspondingly.
  26922. - bpo-26202: copy.deepcopy() now correctly copies range() objects with
  26923. non-atomic attributes.
  26924. - bpo-23076: Path.glob() now raises a ValueError if it's called with an
  26925. invalid pattern. Patch by Thomas Nyberg.
  26926. - bpo-19883: Fixed possible integer overflows in zipimport.
  26927. - bpo-26227: On Windows, getnameinfo(), gethostbyaddr() and
  26928. gethostbyname_ex() functions of the socket module now decode the hostname
  26929. from the ANSI code page rather than UTF-8.
  26930. - bpo-26147: xmlrpc now works with strings not encodable with used non-UTF-8
  26931. encoding.
  26932. - bpo-25935: Garbage collector now breaks reference loops with OrderedDict.
  26933. - bpo-16620: Fixed AttributeError in msilib.Directory.glob().
  26934. - bpo-26013: Added compatibility with broken protocol 2 pickles created in
  26935. old Python 3 versions (3.4.3 and lower).
  26936. - bpo-25850: Use cross-compilation by default for 64-bit Windows.
  26937. - bpo-17633: Improve zipimport's support for namespace packages.
  26938. - bpo-24705: Fix sysconfig._parse_makefile not expanding ${} vars appearing
  26939. before $() vars.
  26940. - bpo-22138: Fix mock.patch behavior when patching descriptors. Restore
  26941. original values after patching. Patch contributed by Sean McCully.
  26942. - bpo-25672: In the ssl module, enable the SSL_MODE_RELEASE_BUFFERS mode
  26943. option if it is safe to do so.
  26944. - bpo-26012: Don't traverse into symlinks for ``**`` pattern in
  26945. pathlib.Path.[r]glob().
  26946. - bpo-24120: Ignore PermissionError when traversing a tree with
  26947. pathlib.Path.[r]glob(). Patch by Ulrich Petri.
  26948. - bpo-25447: fileinput now uses sys.stdin as-is if it does not have a buffer
  26949. attribute (restores backward compatibility).
  26950. - bpo-25447: Copying the lru_cache() wrapper object now always works,
  26951. independently from the type of the wrapped object (by returning the
  26952. original object unchanged).
  26953. - bpo-24103: Fixed possible use after free in ElementTree.XMLPullParser.
  26954. - bpo-25860: os.fwalk() no longer skips remaining directories when error
  26955. occurs. Original patch by Samson Lee.
  26956. - bpo-25914: Fixed and simplified OrderedDict.__sizeof__.
  26957. - bpo-25902: Fixed various refcount issues in ElementTree iteration.
  26958. - bpo-25717: Restore the previous behaviour of tolerating most fstat()
  26959. errors when opening files. This was a regression in 3.5a1, and stopped
  26960. anonymous temporary files from working in special cases.
  26961. - bpo-24903: Fix regression in number of arguments compileall accepts when
  26962. '-d' is specified. The check on the number of arguments has been dropped
  26963. completely as it never worked correctly anyway.
  26964. - bpo-25764: In the subprocess module, preserve any exception caused by
  26965. fork() failure when preexec_fn is used.
  26966. - bpo-6478: _strptime's regexp cache now is reset after changing timezone
  26967. with time.tzset().
  26968. - bpo-14285: When executing a package with the "python -m package" option,
  26969. and package initialization fails, a proper traceback is now reported. The
  26970. "runpy" module now lets exceptions from package initialization pass back
  26971. to the caller, rather than raising ImportError.
  26972. - bpo-19771: Also in runpy and the "-m" option, omit the irrelevant message
  26973. ". . . is a package and cannot be directly executed" if the package could
  26974. not even be initialized (e.g. due to a bad ``*.pyc`` file).
  26975. - bpo-25177: Fixed problem with the mean of very small and very large
  26976. numbers. As a side effect, statistics.mean and statistics.variance should
  26977. be significantly faster.
  26978. - bpo-25718: Fixed copying object with state with boolean value is false.
  26979. - bpo-10131: Fixed deep copying of minidom documents. Based on patch by
  26980. Marian Ganisin.
  26981. - bpo-25725: Fixed a reference leak in pickle.loads() when unpickling
  26982. invalid data including tuple instructions.
  26983. - bpo-25663: In the Readline completer, avoid listing duplicate global
  26984. names, and search the global namespace before searching builtins.
  26985. - bpo-25688: Fixed file leak in ElementTree.iterparse() raising an error.
  26986. - bpo-23914: Fixed SystemError raised by unpickler on broken pickle data.
  26987. - bpo-25691: Fixed crash on deleting ElementTree.Element attributes.
  26988. - bpo-25624: ZipFile now always writes a ZIP_STORED header for directory
  26989. entries. Patch by Dingyuan Wang.
  26990. - Skip getaddrinfo if host is already resolved. Patch by A. Jesse Jiryu
  26991. Davis.
  26992. - bpo-26050: Add asyncio.StreamReader.readuntil() method. Patch by Марк
  26993. Коренберг.
  26994. - bpo-25924: Avoid unnecessary serialization of getaddrinfo(3) calls on OS X
  26995. versions 10.5 or higher. Original patch by A. Jesse Jiryu Davis.
  26996. - bpo-26406: Avoid unnecessary serialization of getaddrinfo(3) calls on
  26997. current versions of OpenBSD and NetBSD. Patch by A. Jesse Jiryu Davis.
  26998. - bpo-26848: Fix asyncio/subprocess.communicate() to handle empty input.
  26999. Patch by Jack O'Connor.
  27000. - bpo-27040: Add loop.get_exception_handler method
  27001. - bpo-27041: asyncio: Add loop.create_future method
  27002. - bpo-27223: asyncio: Fix _read_ready and _write_ready to respect
  27003. _conn_lost. Patch by Łukasz Langa.
  27004. - bpo-22970: asyncio: Fix inconsistency cancelling Condition.wait. Patch by
  27005. David Coles.
  27006. IDLE
  27007. ----
  27008. - bpo-5124: Paste with text selected now replaces the selection on X11. This
  27009. matches how paste works on Windows, Mac, most modern Linux apps, and ttk
  27010. widgets. Original patch by Serhiy Storchaka.
  27011. - bpo-24759: Make clear in idlelib.idle_test.__init__ that the directory is
  27012. a private implementation of test.test_idle and tool for maintainers.
  27013. - bpo-27196: Stop 'ThemeChanged' warnings when running IDLE tests. These
  27014. persisted after other warnings were suppressed in #20567. Apply Serhiy
  27015. Storchaka's update_idletasks solution to four test files. Record this
  27016. additional advice in idle_test/README.txt
  27017. - bpo-20567: Revise idle_test/README.txt with advice about avoiding tk
  27018. warning messages from tests. Apply advice to several IDLE tests.
  27019. - bpo-27117: Make colorizer htest and turtledemo work with dark themes. Move
  27020. code for configuring text widget colors to a new function.
  27021. - bpo-26673: When tk reports font size as 0, change to size 10. Such fonts
  27022. on Linux prevented the configuration dialog from opening.
  27023. - bpo-21939: Add test for IDLE's percolator. Original patch by Saimadhav
  27024. Heblikar.
  27025. - bpo-21676: Add test for IDLE's replace dialog. Original patch by Saimadhav
  27026. Heblikar.
  27027. - bpo-18410: Add test for IDLE's search dialog. Original patch by Westley
  27028. Martínez.
  27029. - bpo-21703: Add test for IDLE's undo delegator. Original patch by Saimadhav
  27030. Heblikar .
  27031. - bpo-27044: Add ConfigDialog.remove_var_callbacks to stop memory leaks.
  27032. - bpo-23977: Add more asserts to test_delegator.
  27033. - bpo-20640: Add tests for idlelib.configHelpSourceEdit. Patch by Saimadhav
  27034. Heblikar.
  27035. - In the 'IDLE-console differences' section of the IDLE doc, clarify how
  27036. running with IDLE affects sys.modules and the standard streams.
  27037. - bpo-25507: fix incorrect change in IOBinding that prevented printing.
  27038. Augment IOBinding htest to include all major IOBinding functions.
  27039. - bpo-25905: Revert unwanted conversion of ' to ’ RIGHT SINGLE QUOTATION
  27040. MARK in README.txt and open this and NEWS.txt with 'ascii'. Re-encode
  27041. CREDITS.txt to utf-8 and open it with 'utf-8'.
  27042. Documentation
  27043. -------------
  27044. - bpo-19489: Moved the search box from the sidebar to the header and footer
  27045. of each page. Patch by Ammar Askar.
  27046. - bpo-24136: Document the new :pep:`448` unpacking syntax of 3.5.
  27047. - bpo-26736: Used HTTPS for external links in the documentation if possible.
  27048. - bpo-6953: Rework the Readline module documentation to group related
  27049. functions together, and add more details such as what underlying Readline
  27050. functions and variables are accessed.
  27051. - bpo-23606: Adds note to ctypes documentation regarding cdll.msvcrt.
  27052. - bpo-25500: Fix documentation to not claim that __import__ is searched for
  27053. in the global scope.
  27054. - bpo-26014: Update 3.x packaging documentation: * "See also" links to the
  27055. new docs are now provided in the legacy pages * links to setuptools
  27056. documentation have been updated
  27057. Tests
  27058. -----
  27059. - bpo-21916: Added tests for the turtle module. Patch by ingrid, Gregory
  27060. Loyse and Jelle Zijlstra.
  27061. - bpo-26523: The multiprocessing thread pool (multiprocessing.dummy.Pool)
  27062. was untested.
  27063. - bpo-26015: Added new tests for pickling iterators of mutable sequences.
  27064. - bpo-26325: Added test.support.check_no_resource_warning() to check that no
  27065. ResourceWarning is emitted.
  27066. - bpo-25940: Changed test_ssl to use self-signed.pythontest.net. This
  27067. avoids relying on svn.python.org, which recently changed root certificate.
  27068. - bpo-25616: Tests for OrderedDict are extracted from test_collections into
  27069. separate file test_ordered_dict.
  27070. - bpo-26583: Skip test_timestamp_overflow in test_import if bytecode files
  27071. cannot be written.
  27072. Build
  27073. -----
  27074. - bpo-26884: Fix linking extension modules for cross builds. Patch by Xavier
  27075. de Gaye.
  27076. - bpo-22359: Disable the rules for running _freeze_importlib and pgen when
  27077. cross-compiling. The output of these programs is normally saved with the
  27078. source code anyway, and is still regenerated when doing a native build.
  27079. Patch by Xavier de Gaye.
  27080. - bpo-27229: Fix the cross-compiling pgen rule for in-tree builds. Patch by
  27081. Xavier de Gaye.
  27082. - bpo-21668: Link audioop, _datetime, _ctypes_test modules to libm, except
  27083. on Mac OS X. Patch written by Xavier de Gaye.
  27084. - bpo-25702: A --with-lto configure option has been added that will enable
  27085. link time optimizations at build time during a make profile-opt. Some
  27086. compilers and toolchains are known to not produce stable code when using
  27087. LTO, be sure to test things thoroughly before relying on it. It can
  27088. provide a few % speed up over profile-opt alone.
  27089. - bpo-26624: Adds validation of ucrtbase[d].dll version with warning for old
  27090. versions.
  27091. - bpo-17603: Avoid error about nonexistent fileblocks.o file by using a
  27092. lower-level check for st_blocks in struct stat.
  27093. - bpo-26079: Fixing the build output folder for tix-8.4.3.6. Patch by Bjoern
  27094. Thiel.
  27095. - bpo-26465: Update Windows builds to use OpenSSL 1.0.2g.
  27096. - bpo-24421: Compile Modules/_math.c once, before building extensions.
  27097. Previously it could fail to compile properly if the math and cmath builds
  27098. were concurrent.
  27099. - bpo-25348: Added ``--pgo`` and ``--pgo-job`` arguments to
  27100. ``PCbuild\build.bat`` for building with Profile-Guided Optimization. The
  27101. old ``PCbuild\build_pgo.bat`` script is now deprecated, and simply calls
  27102. ``PCbuild\build.bat --pgo %*``.
  27103. - bpo-25827: Add support for building with ICC to ``configure``, including a
  27104. new ``--with-icc`` flag.
  27105. - bpo-25696: Fix installation of Python on UNIX with make -j9.
  27106. - bpo-26930: Update OS X 10.5+ 32-bit-only installer to build and link with
  27107. OpenSSL 1.0.2h.
  27108. - bpo-26268: Update Windows builds to use OpenSSL 1.0.2f.
  27109. - bpo-25136: Support Apple Xcode 7's new textual SDK stub libraries.
  27110. - bpo-24324: Do not enable unreachable code warnings when using gcc as the
  27111. option does not work correctly in older versions of gcc and has been
  27112. silently removed as of gcc-4.5.
  27113. Windows
  27114. -------
  27115. - bpo-27053: Updates make_zip.py to correctly generate library ZIP file.
  27116. - bpo-26268: Update the prepare_ssl.py script to handle OpenSSL releases
  27117. that don't include the contents of the include directory (that is, 1.0.2e
  27118. and later).
  27119. - bpo-26071: bdist_wininst created binaries fail to start and find 32bit
  27120. Python
  27121. - bpo-26073: Update the list of magic numbers in launcher
  27122. - bpo-26065: Excludes venv from library when generating embeddable distro.
  27123. - bpo-17500: Remove unused and outdated icons. (See also:
  27124. https://github.com/python/pythondotorg/issues/945)
  27125. Tools/Demos
  27126. -----------
  27127. - bpo-26799: Fix python-gdb.py: don't get C types once when the Python code
  27128. is loaded, but get C types on demand. The C types can change if
  27129. python-gdb.py is loaded before the Python executable. Patch written by
  27130. Thomas Ilsche.
  27131. - bpo-26271: Fix the Freeze tool to properly use flags passed through
  27132. configure. Patch by Daniel Shaulov.
  27133. - bpo-26489: Add dictionary unpacking support to Tools/parser/unparse.py.
  27134. Patch by Guo Ci Teo.
  27135. - bpo-26316: Fix variable name typo in Argument Clinic.
  27136. What's New in Python 3.5.1 final?
  27137. =================================
  27138. *Release date: 2015-12-06*
  27139. Core and Builtins
  27140. -----------------
  27141. - bpo-25709: Fixed problem with in-place string concatenation and utf-8
  27142. cache.
  27143. Windows
  27144. -------
  27145. - bpo-25715: Python 3.5.1 installer shows wrong upgrade path and incorrect
  27146. logic for launcher detection.
  27147. What's New in Python 3.5.1 release candidate 1?
  27148. ===============================================
  27149. *Release date: 2015-11-22*
  27150. Core and Builtins
  27151. -----------------
  27152. - bpo-25630: Fix a possible segfault during argument parsing in functions
  27153. that accept filesystem paths.
  27154. - bpo-23564: Fixed a partially broken sanity check in the _posixsubprocess
  27155. internals regarding how fds_to_pass were passed to the child. The bug had
  27156. no actual impact as subprocess.py already avoided it.
  27157. - bpo-25388: Fixed tokenizer crash when processing undecodable source code
  27158. with a null byte.
  27159. - bpo-25462: The hash of the key now is calculated only once in most
  27160. operations in C implementation of OrderedDict.
  27161. - bpo-22995: Default implementation of __reduce__ and __reduce_ex__ now
  27162. rejects builtin types with not defined __new__.
  27163. - bpo-25555: Fix parser and AST: fill lineno and col_offset of "arg" node
  27164. when compiling AST from Python objects.
  27165. - bpo-24802: Avoid buffer overreads when int(), float(), compile(), exec()
  27166. and eval() are passed bytes-like objects. These objects are not
  27167. necessarily terminated by a null byte, but the functions assumed they
  27168. were.
  27169. - bpo-24726: Fixed a crash and leaking NULL in repr() of OrderedDict that
  27170. was mutated by direct calls of dict methods.
  27171. - bpo-25449: Iterating OrderedDict with keys with unstable hash now raises
  27172. KeyError in C implementations as well as in Python implementation.
  27173. - bpo-25395: Fixed crash when highly nested OrderedDict structures were
  27174. garbage collected.
  27175. - bpo-25274: sys.setrecursionlimit() now raises a RecursionError if the new
  27176. recursion limit is too low depending at the current recursion depth.
  27177. Modify also the "lower-water mark" formula to make it monotonic. This mark
  27178. is used to decide when the overflowed flag of the thread state is reset.
  27179. - bpo-24402: Fix input() to prompt to the redirected stdout when
  27180. sys.stdout.fileno() fails.
  27181. - bpo-24806: Prevent builtin types that are not allowed to be subclassed
  27182. from being subclassed through multiple inheritance.
  27183. - bpo-24848: Fixed a number of bugs in UTF-7 decoding of misformed data.
  27184. - bpo-25280: Import trace messages emitted in verbose (-v) mode are no
  27185. longer formatted twice.
  27186. - bpo-25003: On Solaris 11.3 or newer, os.urandom() now uses the getrandom()
  27187. function instead of the getentropy() function. The getentropy() function
  27188. is blocking to generate very good quality entropy, os.urandom() doesn't
  27189. need such high-quality entropy.
  27190. - bpo-25182: The stdprinter (used as sys.stderr before the io module is
  27191. imported at startup) now uses the backslashreplace error handler.
  27192. - bpo-25131: Make the line number and column offset of set/dict literals and
  27193. comprehensions correspond to the opening brace.
  27194. - bpo-25150: Hide the private :samp:`_Py_atomic_{xxx}` symbols from the
  27195. public Python.h header to fix a compilation error with OpenMP.
  27196. PyThreadState_GET() becomes an alias to PyThreadState_Get() to avoid ABI
  27197. incompatibilities.
  27198. Library
  27199. -------
  27200. - bpo-25626: Change three zlib functions to accept sizes that fit in
  27201. Py_ssize_t, but internally cap those sizes to UINT_MAX. This resolves a
  27202. regression in 3.5 where GzipFile.read() failed to read chunks larger than
  27203. 2 or 4 GiB. The change affects the zlib.Decompress.decompress()
  27204. max_length parameter, the zlib.decompress() bufsize parameter, and the
  27205. zlib.Decompress.flush() length parameter.
  27206. - bpo-25583: Avoid incorrect errors raised by os.makedirs(exist_ok=True)
  27207. when the OS gives priority to errors such as EACCES over EEXIST.
  27208. - bpo-25593: Change semantics of EventLoop.stop() in asyncio.
  27209. - bpo-6973: When we know a subprocess.Popen process has died, do not allow
  27210. the send_signal(), terminate(), or kill() methods to do anything as they
  27211. could potentially signal a different process.
  27212. - bpo-25590: In the Readline completer, only call getattr() once per
  27213. attribute.
  27214. - bpo-25498: Fix a crash when garbage-collecting ctypes objects created by
  27215. wrapping a memoryview. This was a regression made in 3.5a1. Based on
  27216. patch by Eryksun.
  27217. - bpo-25584: Added "escape" to the __all__ list in the glob module.
  27218. - bpo-25584: Fixed recursive glob() with patterns starting with ``**``.
  27219. - bpo-25446: Fix regression in smtplib's AUTH LOGIN support.
  27220. - bpo-18010: Fix the pydoc web server's module search function to handle
  27221. exceptions from importing packages.
  27222. - bpo-25554: Got rid of circular references in regular expression parsing.
  27223. - bpo-25510: fileinput.FileInput.readline() now returns b'' instead of '' at
  27224. the end if the FileInput was opened with binary mode. Patch by Ryosuke
  27225. Ito.
  27226. - bpo-25503: Fixed inspect.getdoc() for inherited docstrings of properties.
  27227. Original patch by John Mark Vandenberg.
  27228. - bpo-25515: Always use os.urandom as a source of randomness in uuid.uuid4.
  27229. - bpo-21827: Fixed textwrap.dedent() for the case when largest common
  27230. whitespace is a substring of smallest leading whitespace. Based on patch
  27231. by Robert Li.
  27232. - bpo-25447: The lru_cache() wrapper objects now can be copied and pickled
  27233. (by returning the original object unchanged).
  27234. - bpo-25390: typing: Don't crash on Union[str, Pattern].
  27235. - bpo-25441: asyncio: Raise error from drain() when socket is closed.
  27236. - bpo-25410: Cleaned up and fixed minor bugs in C implementation of
  27237. OrderedDict.
  27238. - bpo-25411: Improved Unicode support in SMTPHandler through better use of
  27239. the email package. Thanks to user simon04 for the patch.
  27240. - bpo-25407: Remove mentions of the formatter module being removed in Python
  27241. 3.6.
  27242. - bpo-25406: Fixed a bug in C implementation of OrderedDict.move_to_end()
  27243. that caused segmentation fault or hang in iterating after moving several
  27244. items to the start of ordered dict.
  27245. - bpo-25364: zipfile now works in threads disabled builds.
  27246. - bpo-25328: smtpd's SMTPChannel now correctly raises a ValueError if both
  27247. decode_data and enable_SMTPUTF8 are set to true.
  27248. - bpo-25316: distutils raises OSError instead of DistutilsPlatformError when
  27249. MSVC is not installed.
  27250. - bpo-25380: Fixed protocol for the STACK_GLOBAL opcode in
  27251. pickletools.opcodes.
  27252. - bpo-23972: Updates asyncio datagram create method allowing reuseport and
  27253. reuseaddr socket options to be set prior to binding the socket. Mirroring
  27254. the existing asyncio create_server method the reuseaddr option for
  27255. datagram sockets defaults to True if the O/S is 'posix' (except if the
  27256. platform is Cygwin). Patch by Chris Laws.
  27257. - bpo-25304: Add asyncio.run_coroutine_threadsafe(). This lets you submit a
  27258. coroutine to a loop from another thread, returning a
  27259. concurrent.futures.Future. By Vincent Michel.
  27260. - bpo-25232: Fix CGIRequestHandler to split the query from the URL at the
  27261. first question mark (?) rather than the last. Patch from Xiang Zhang.
  27262. - bpo-24657: Prevent CGIRequestHandler from collapsing slashes in the query
  27263. part of the URL as if it were a path. Patch from Xiang Zhang.
  27264. - bpo-24483: C implementation of functools.lru_cache() now calculates key's
  27265. hash only once.
  27266. - bpo-22958: Constructor and update method of weakref.WeakValueDictionary
  27267. now accept the self and the dict keyword arguments.
  27268. - bpo-22609: Constructor of collections.UserDict now accepts the self
  27269. keyword argument.
  27270. - bpo-25111: Fixed comparison of traceback.FrameSummary.
  27271. - bpo-25262: Added support for BINBYTES8 opcode in Python implementation of
  27272. unpickler. Highest 32 bits of 64-bit size for BINUNICODE8 and BINBYTES8
  27273. opcodes no longer silently ignored on 32-bit platforms in C
  27274. implementation.
  27275. - bpo-25034: Fix string.Formatter problem with auto-numbering and nested
  27276. format_specs. Patch by Anthon van der Neut.
  27277. - bpo-25233: Rewrite the guts of asyncio.Queue and asyncio.Semaphore to be
  27278. more understandable and correct.
  27279. - bpo-25203: Failed readline.set_completer_delims() no longer left the
  27280. module in inconsistent state.
  27281. - bpo-23600: Default implementation of tzinfo.fromutc() was returning wrong
  27282. results in some cases.
  27283. - bpo-23329: Allow the ssl module to be built with older versions of
  27284. LibreSSL.
  27285. - Prevent overflow in _Unpickler_Read.
  27286. - bpo-25047: The XML encoding declaration written by Element Tree now
  27287. respects the letter case given by the user. This restores the ability to
  27288. write encoding names in uppercase like "UTF-8", which worked in Python 2.
  27289. - bpo-25135: Make deque_clear() safer by emptying the deque before clearing.
  27290. This helps avoid possible reentrancy issues.
  27291. - bpo-19143: platform module now reads Windows version from kernel32.dll to
  27292. avoid compatibility shims.
  27293. - bpo-25092: Fix datetime.strftime() failure when errno was already set to
  27294. EINVAL.
  27295. - bpo-23517: Fix rounding in fromtimestamp() and utcfromtimestamp() methods
  27296. of datetime.datetime: microseconds are now rounded to nearest with ties
  27297. going to nearest even integer (ROUND_HALF_EVEN), instead of being rounding
  27298. towards minus infinity (ROUND_FLOOR). It's important that these methods
  27299. use the same rounding mode than datetime.timedelta to keep the property:
  27300. (datetime(1970,1,1) + timedelta(seconds=t)) ==
  27301. datetime.utcfromtimestamp(t). It also the rounding mode used by
  27302. round(float) for example.
  27303. - bpo-25155: Fix datetime.datetime.now() and datetime.datetime.utcnow() on
  27304. Windows to support date after year 2038. It was a regression introduced in
  27305. Python 3.5.0.
  27306. - bpo-25108: Omitted internal frames in traceback functions print_stack(),
  27307. format_stack(), and extract_stack() called without arguments.
  27308. - bpo-25118: Fix a regression of Python 3.5.0 in os.waitpid() on Windows.
  27309. - bpo-24684: socket.socket.getaddrinfo() now calls
  27310. PyUnicode_AsEncodedString() instead of calling the encode() method of the
  27311. host, to handle correctly custom string with an encode() method which
  27312. doesn't return a byte string. The encoder of the IDNA codec is now called
  27313. directly instead of calling the encode() method of the string.
  27314. - bpo-25060: Correctly compute stack usage of the BUILD_MAP opcode.
  27315. - bpo-24857: Comparing call_args to a long sequence now correctly returns a
  27316. boolean result instead of raising an exception. Patch by A Kaptur.
  27317. - bpo-23144: Make sure that HTMLParser.feed() returns all the data, even
  27318. when convert_charrefs is True.
  27319. - bpo-24982: shutil.make_archive() with the "zip" format now adds entries
  27320. for directories (including empty directories) in ZIP file.
  27321. - bpo-25019: Fixed a crash caused by setting non-string key of expat parser.
  27322. Based on patch by John Leitch.
  27323. - bpo-16180: Exit pdb if file has syntax error, instead of trapping user in
  27324. an infinite loop. Patch by Xavier de Gaye.
  27325. - bpo-24891: Fix a race condition at Python startup if the file descriptor
  27326. of stdin (0), stdout (1) or stderr (2) is closed while Python is creating
  27327. sys.stdin, sys.stdout and sys.stderr objects. These attributes are now set
  27328. to None if the creation of the object failed, instead of raising an
  27329. OSError exception. Initial patch written by Marco Paolini.
  27330. - bpo-24992: Fix error handling and a race condition (related to garbage
  27331. collection) in collections.OrderedDict constructor.
  27332. - bpo-24881: Fixed setting binary mode in Python implementation of FileIO on
  27333. Windows and Cygwin. Patch from Akira Li.
  27334. - bpo-25578: Fix (another) memory leak in SSLSocket.getpeercer().
  27335. - bpo-25530: Disable the vulnerable SSLv3 protocol by default when creating
  27336. ssl.SSLContext.
  27337. - bpo-25569: Fix memory leak in SSLSocket.getpeercert().
  27338. - bpo-25471: Sockets returned from accept() shouldn't appear to be
  27339. nonblocking.
  27340. - bpo-25319: When threading.Event is reinitialized, the underlying condition
  27341. should use a regular lock rather than a recursive lock.
  27342. - bpo-21112: Fix regression in unittest.expectedFailure on subclasses. Patch
  27343. from Berker Peksag.
  27344. - bpo-24764: cgi.FieldStorage.read_multi() now ignores the Content-Length
  27345. header in part headers. Patch written by Peter Landry and reviewed by
  27346. Pierre Quentel.
  27347. - bpo-24913: Fix overrun error in deque.index(). Found by John Leitch and
  27348. Bryce Darling.
  27349. - bpo-24774: Fix docstring in http.server.test. Patch from Chiu-Hsiang Hsu.
  27350. - bpo-21159: Improve message in
  27351. configparser.InterpolationMissingOptionError. Patch from Łukasz Langa.
  27352. - bpo-20362: Honour TestCase.longMessage correctly in assertRegex. Patch
  27353. from Ilia Kurenkov.
  27354. - bpo-23572: Fixed functools.singledispatch on classes with false
  27355. metaclasses. Patch by Ethan Furman.
  27356. - asyncio: ensure_future() now accepts awaitable objects.
  27357. IDLE
  27358. ----
  27359. - bpo-15348: Stop the debugger engine (normally in a user process) before
  27360. closing the debugger window (running in the IDLE process). This prevents
  27361. the RuntimeErrors that were being caught and ignored.
  27362. - bpo-24455: Prevent IDLE from hanging when a) closing the shell while the
  27363. debugger is active (15347); b) closing the debugger with the [X] button
  27364. (15348); and c) activating the debugger when already active (24455). The
  27365. patch by Mark Roseman does this by making two changes. 1. Suspend and
  27366. resume the gui.interaction method with the tcl vwait mechanism intended
  27367. for this purpose (instead of root.mainloop & .quit). 2. In gui.run, allow
  27368. any existing interaction to terminate first.
  27369. - Change 'The program' to 'Your program' in an IDLE 'kill program?' message
  27370. to make it clearer that the program referred to is the currently running
  27371. user program, not IDLE itself.
  27372. - bpo-24750: Improve the appearance of the IDLE editor window status bar.
  27373. Patch by Mark Roseman.
  27374. - bpo-25313: Change the handling of new built-in text color themes to better
  27375. address the compatibility problem introduced by the addition of IDLE Dark.
  27376. Consistently use the revised idleConf.CurrentTheme everywhere in idlelib.
  27377. - bpo-24782: Extension configuration is now a tab in the IDLE Preferences
  27378. dialog rather than a separate dialog. The former tabs are now a sorted
  27379. list. Patch by Mark Roseman.
  27380. - bpo-22726: Re-activate the config dialog help button with some content
  27381. about the other buttons and the new IDLE Dark theme.
  27382. - bpo-24820: IDLE now has an 'IDLE Dark' built-in text color theme. It is
  27383. more or less IDLE Classic inverted, with a cobalt blue background.
  27384. Strings, comments, keywords, ... are still green, red, orange, ... . To
  27385. use it with IDLEs released before November 2015, hit the 'Save as New
  27386. Custom Theme' button and enter a new name, such as 'Custom Dark'. The
  27387. custom theme will work with any IDLE release, and can be modified.
  27388. - bpo-25224: README.txt is now an idlelib index for IDLE developers and
  27389. curious users. The previous user content is now in the IDLE doc chapter.
  27390. 'IDLE' now means 'Integrated Development and Learning Environment'.
  27391. - bpo-24820: Users can now set breakpoint colors in Settings -> Custom
  27392. Highlighting. Original patch by Mark Roseman.
  27393. - bpo-24972: Inactive selection background now matches active selection
  27394. background, as configured by users, on all systems. Found items are now
  27395. always highlighted on Windows. Initial patch by Mark Roseman.
  27396. - bpo-24570: Idle: make calltip and completion boxes appear on Macs affected
  27397. by a tk regression. Initial patch by Mark Roseman.
  27398. - bpo-24988: Idle ScrolledList context menus (used in debugger) now work on
  27399. Mac Aqua. Patch by Mark Roseman.
  27400. - bpo-24801: Make right-click for context menu work on Mac Aqua. Patch by
  27401. Mark Roseman.
  27402. - bpo-25173: Associate tkinter messageboxes with a specific widget. For Mac
  27403. OSX, make them a 'sheet'. Patch by Mark Roseman.
  27404. - bpo-25198: Enhance the initial html viewer now used for Idle Help.
  27405. Properly indent fixed-pitch text (patch by Mark Roseman). Give code
  27406. snippet a very Sphinx-like light blueish-gray background. Re-use initial
  27407. width and height set by users for shell and editor. When the Table of
  27408. Contents (TOC) menu is used, put the section header at the top of the
  27409. screen.
  27410. - bpo-25225: Condense and rewrite Idle doc section on text colors.
  27411. - bpo-21995: Explain some differences between IDLE and console Python.
  27412. - bpo-22820: Explain need for *print* when running file from Idle editor.
  27413. - bpo-25224: Doc: augment Idle feature list and no-subprocess section.
  27414. - bpo-25219: Update doc for Idle command line options. Some were missing and
  27415. notes were not correct.
  27416. - bpo-24861: Most of idlelib is private and subject to change. Use
  27417. idleib.idle.* to start Idle. See idlelib.__init__.__doc__.
  27418. - bpo-25199: Idle: add synchronization comments for future maintainers.
  27419. - bpo-16893: Replace help.txt with help.html for Idle doc display. The new
  27420. idlelib/help.html is rstripped Doc/build/html/library/idle.html. It looks
  27421. better than help.txt and will better document Idle as released. The
  27422. tkinter html viewer that works for this file was written by Mark Roseman.
  27423. The now unused EditorWindow.HelpDialog class and helt.txt file are
  27424. deprecated.
  27425. - bpo-24199: Deprecate unused idlelib.idlever with possible removal in 3.6.
  27426. - bpo-24790: Remove extraneous code (which also create 2 & 3 conflicts).
  27427. Documentation
  27428. -------------
  27429. - bpo-22558: Add remaining doc links to source code for Python-coded
  27430. modules. Patch by Yoni Lavi.
  27431. - bpo-12067: Rewrite Comparisons section in the Expressions chapter of the
  27432. language reference. Some of the details of comparing mixed types were
  27433. incorrect or ambiguous. NotImplemented is only relevant at a lower level
  27434. than the Expressions chapter. Added details of comparing range() objects,
  27435. and default behaviour and consistency suggestions for user-defined
  27436. classes. Patch from Andy Maier.
  27437. - bpo-24952: Clarify the default size argument of stack_size() in the
  27438. "threading" and "_thread" modules. Patch from Mattip.
  27439. - bpo-23725: Overhaul tempfile docs. Note deprecated status of mktemp. Patch
  27440. from Zbigniew Jędrzejewski-Szmek.
  27441. - bpo-24808: Update the types of some PyTypeObject fields. Patch by Joseph
  27442. Weston.
  27443. - bpo-22812: Fix unittest discovery examples. Patch from Pam McA'Nulty.
  27444. Tests
  27445. -----
  27446. - bpo-25449: Added tests for OrderedDict subclasses.
  27447. - bpo-25099: Make test_compileall not fail when an entry on sys.path cannot
  27448. be written to (commonly seen in administrative installs on Windows).
  27449. - bpo-23919: Prevents assert dialogs appearing in the test suite.
  27450. - ``PCbuild\rt.bat`` now accepts an unlimited number of arguments to pass
  27451. along to regrtest.py. Previously there was a limit of 9.
  27452. Build
  27453. -----
  27454. - bpo-24915: Add LLVM support for PGO builds and use the test suite to
  27455. generate the profile data. Initial patch by Alecsandru Patrascu of Intel.
  27456. - bpo-24910: Windows MSIs now have unique display names.
  27457. - bpo-24986: It is now possible to build Python on Windows without errors
  27458. when external libraries are not available.
  27459. Windows
  27460. -------
  27461. - bpo-25450: Updates shortcuts to start Python in installation directory.
  27462. - bpo-25164: Changes default all-users install directory to match per-user
  27463. directory.
  27464. - bpo-25143: Improves installer error messages for unsupported platforms.
  27465. - bpo-25163: Display correct directory in installer when using non-default
  27466. settings.
  27467. - bpo-25361: Disables use of SSE2 instructions in Windows 32-bit build
  27468. - bpo-25089: Adds logging to installer for case where launcher is not
  27469. selected on upgrade.
  27470. - bpo-25165: Windows uninstallation should not remove launcher if other
  27471. versions remain
  27472. - bpo-25112: py.exe launcher is missing icons
  27473. - bpo-25102: Windows installer does not precompile for -O or -OO.
  27474. - bpo-25081: Makes Back button in installer go back to upgrade page when
  27475. upgrading.
  27476. - bpo-25091: Increases font size of the installer.
  27477. - bpo-25126: Clarifies that the non-web installer will download some
  27478. components.
  27479. - bpo-25213: Restores requestedExecutionLevel to manifest to disable UAC
  27480. virtualization.
  27481. - bpo-25022: Removed very outdated PC/example_nt/ directory.
  27482. Tools/Demos
  27483. -----------
  27484. - bpo-25440: Fix output of python-config --extension-suffix.
  27485. What's New in Python 3.5.0 final?
  27486. =================================
  27487. *Release date: 2015-09-13*
  27488. Build
  27489. -----
  27490. - bpo-25071: Windows installer should not require TargetDir parameter when
  27491. installing quietly.
  27492. What's New in Python 3.5.0 release candidate 4?
  27493. ===============================================
  27494. *Release date: 2015-09-09*
  27495. Library
  27496. -------
  27497. - bpo-25029: Fixes MemoryError in test_strptime.
  27498. Build
  27499. -----
  27500. - bpo-25027: Reverts partial-static build options and adds vcruntime140.dll
  27501. to Windows installation.
  27502. What's New in Python 3.5.0 release candidate 3?
  27503. ===============================================
  27504. *Release date: 2015-09-07*
  27505. Core and Builtins
  27506. -----------------
  27507. - bpo-24305: Prevent import subsystem stack frames from being counted by the
  27508. warnings.warn(stacklevel=) parameter.
  27509. - bpo-24912: Prevent __class__ assignment to immutable built-in objects.
  27510. - bpo-24975: Fix AST compilation for :pep:`448` syntax.
  27511. Library
  27512. -------
  27513. - bpo-24917: time_strftime() buffer over-read.
  27514. - bpo-24748: To resolve a compatibility problem found with py2exe and
  27515. pywin32, imp.load_dynamic() once again ignores previously loaded modules
  27516. to support Python modules replacing themselves with extension modules.
  27517. Patch by Petr Viktorin.
  27518. - bpo-24635: Fixed a bug in typing.py where isinstance([], typing.Iterable)
  27519. would return True once, then False on subsequent calls.
  27520. - bpo-24989: Fixed buffer overread in BytesIO.readline() if a position is
  27521. set beyond size. Based on patch by John Leitch.
  27522. - bpo-24913: Fix overrun error in deque.index(). Found by John Leitch and
  27523. Bryce Darling.
  27524. What's New in Python 3.5.0 release candidate 2?
  27525. ===============================================
  27526. *Release date: 2015-08-25*
  27527. Core and Builtins
  27528. -----------------
  27529. - bpo-24769: Interpreter now starts properly when dynamic loading is
  27530. disabled. Patch by Petr Viktorin.
  27531. - bpo-21167: NAN operations are now handled correctly when python is
  27532. compiled with ICC even if -fp-model strict is not specified.
  27533. - bpo-24492: A "package" lacking a __name__ attribute when trying to perform
  27534. a ``from .. import ...`` statement will trigger an ImportError instead of
  27535. an AttributeError.
  27536. Library
  27537. -------
  27538. - bpo-24847: Removes vcruntime140.dll dependency from Tcl/Tk.
  27539. - bpo-24839: platform._syscmd_ver raises DeprecationWarning
  27540. - bpo-24867: Fix Task.get_stack() for 'async def' coroutines
  27541. What's New in Python 3.5.0 release candidate 1?
  27542. ===============================================
  27543. *Release date: 2015-08-09*
  27544. Core and Builtins
  27545. -----------------
  27546. - bpo-24667: Resize odict in all cases that the underlying dict resizes.
  27547. Library
  27548. -------
  27549. - bpo-24824: Signatures of codecs.encode() and codecs.decode() now are
  27550. compatible with pydoc.
  27551. - bpo-24634: Importing uuid should not try to load libc on Windows
  27552. - bpo-24798: _msvccompiler.py doesn't properly support manifests
  27553. - bpo-4395: Better testing and documentation of binary operators. Patch by
  27554. Martin Panter.
  27555. - bpo-23973: Update typing.py from GitHub repo.
  27556. - bpo-23004: mock_open() now reads binary data correctly when the type of
  27557. read_data is bytes. Initial patch by Aaron Hill.
  27558. - bpo-23888: Handle fractional time in cookie expiry. Patch by ssh.
  27559. - bpo-23652: Make it possible to compile the select module against the libc
  27560. headers from the Linux Standard Base, which do not include some EPOLL
  27561. macros. Patch by Matt Frank.
  27562. - bpo-22932: Fix timezones in email.utils.formatdate. Patch from Dmitry
  27563. Shachnev.
  27564. - bpo-23779: imaplib raises TypeError if authenticator tries to abort. Patch
  27565. from Craig Holmquist.
  27566. - bpo-23319: Fix ctypes.BigEndianStructure, swap correctly bytes. Patch
  27567. written by Matthieu Gautier.
  27568. - bpo-23254: Document how to close the TCPServer listening socket. Patch
  27569. from Martin Panter.
  27570. - bpo-19450: Update Windows and OS X installer builds to use SQLite 3.8.11.
  27571. - bpo-17527: Add PATCH to wsgiref.validator. Patch from Luca Sbardella.
  27572. - bpo-24791: Fix grammar regression for call syntax: 'g(\*a or b)'.
  27573. IDLE
  27574. ----
  27575. - bpo-23672: Allow Idle to edit and run files with astral chars in name.
  27576. Patch by Mohd Sanad Zaki Rizvi.
  27577. - bpo-24745: Idle editor default font. Switch from Courier to
  27578. platform-sensitive TkFixedFont. This should not affect current customized
  27579. font selections. If there is a problem, edit
  27580. $HOME/.idlerc/config-main.cfg and remove ':samp:`font{xxx}`' entries from
  27581. [Editor Window]. Patch by Mark Roseman.
  27582. - bpo-21192: Idle editor. When a file is run, put its name in the restart
  27583. bar. Do not print false prompts. Original patch by Adnan Umer.
  27584. - bpo-13884: Idle menus. Remove tearoff lines. Patch by Roger Serwy.
  27585. Documentation
  27586. -------------
  27587. - bpo-24129: Clarify the reference documentation for name resolution. This
  27588. includes removing the assumption that readers will be familiar with the
  27589. name resolution scheme Python used prior to the introduction of lexical
  27590. scoping for function namespaces. Patch by Ivan Levkivskyi.
  27591. - bpo-20769: Improve reload() docs. Patch by Dorian Pula.
  27592. - bpo-23589: Remove duplicate sentence from the FAQ. Patch by Yongzhi Pan.
  27593. - bpo-24729: Correct IO tutorial to match implementation regarding encoding
  27594. parameter to open function.
  27595. Tests
  27596. -----
  27597. - bpo-24751: When running regrtest with the ``-w`` command line option, a
  27598. test run is no longer marked as a failure if all tests succeed when
  27599. re-run.
  27600. What's New in Python 3.5.0 beta 4?
  27601. ==================================
  27602. *Release date: 2015-07-26*
  27603. Core and Builtins
  27604. -----------------
  27605. - bpo-23573: Restored optimization of bytes.rfind() and bytearray.rfind()
  27606. for single-byte argument on Linux.
  27607. - bpo-24569: Make :pep:`448` dictionary evaluation more consistent.
  27608. - bpo-24583: Fix crash when set is mutated while being updated.
  27609. - bpo-24407: Fix crash when dict is mutated while being updated.
  27610. - bpo-24619: New approach for tokenizing async/await. As a consequence, it
  27611. is now possible to have one-line 'async def foo(): await ..' functions.
  27612. - bpo-24687: Plug refleak on SyntaxError in function parameters annotations.
  27613. - bpo-15944: memoryview: Allow arbitrary formats when casting to bytes.
  27614. Patch by Martin Panter.
  27615. Library
  27616. -------
  27617. - bpo-23441: rcompleter now prints a tab character instead of displaying
  27618. possible completions for an empty word. Initial patch by Martin Sekera.
  27619. - bpo-24683: Fixed crashes in _json functions called with arguments of
  27620. inappropriate type.
  27621. - bpo-21697: shutil.copytree() now correctly handles symbolic links that
  27622. point to directories. Patch by Eduardo Seabra and Thomas Kluyver.
  27623. - bpo-14373: Fixed segmentation fault when gc.collect() is called during
  27624. constructing lru_cache (C implementation).
  27625. - bpo-24695: Fix a regression in traceback.print_exception(). If
  27626. exc_traceback is None we shouldn't print a traceback header like described
  27627. in the documentation.
  27628. - bpo-24620: Random.setstate() now validates the value of state last
  27629. element.
  27630. - bpo-22485: Fixed an issue that caused ``inspect.getsource`` to return
  27631. incorrect results on nested functions.
  27632. - bpo-22153: Improve unittest docs. Patch from Martin Panter and evilzero.
  27633. - bpo-24580: Symbolic group references to open group in re patterns now are
  27634. explicitly forbidden as well as numeric group references.
  27635. - bpo-24206: Fixed __eq__ and __ne__ methods of inspect classes.
  27636. - bpo-24631: Fixed regression in the timeit module with multiline setup.
  27637. - bpo-18622: unittest.mock.mock_open().reset_mock would recurse infinitely.
  27638. Patch from Nicola Palumbo and Laurent De Buyst.
  27639. - bpo-23661: unittest.mock side_effects can now be exceptions again. This
  27640. was a regression vs Python 3.4. Patch from Ignacio Rossi
  27641. - bpo-24608: chunk.Chunk.read() now always returns bytes, not str.
  27642. - bpo-18684: Fixed reading out of the buffer in the re module.
  27643. - bpo-24259: tarfile now raises a ReadError if an archive is truncated
  27644. inside a data segment.
  27645. - bpo-15014: SMTP.auth() and SMTP.login() now support RFC 4954's optional
  27646. initial-response argument to the SMTP AUTH command.
  27647. - bpo-24669: Fix inspect.getsource() for 'async def' functions. Patch by Kai
  27648. Groner.
  27649. - bpo-24688: ast.get_docstring() for 'async def' functions.
  27650. Build
  27651. -----
  27652. - bpo-24603: Update Windows builds and OS X 10.5 installer to use OpenSSL
  27653. 1.0.2d.
  27654. What's New in Python 3.5.0 beta 3?
  27655. ==================================
  27656. *Release date: 2015-07-05*
  27657. Core and Builtins
  27658. -----------------
  27659. - bpo-24467: Fixed possible buffer over-read in bytearray. The bytearray
  27660. object now always allocates place for trailing null byte and it's buffer
  27661. now is always null-terminated.
  27662. - Upgrade to Unicode 8.0.0.
  27663. - bpo-24345: Add Py_tp_finalize slot for the stable ABI.
  27664. - bpo-24400: Introduce a distinct type for :pep:`492` coroutines; add
  27665. types.CoroutineType, inspect.getcoroutinestate,
  27666. inspect.getcoroutinelocals; coroutines no longer use CO_GENERATOR flag;
  27667. sys.set_coroutine_wrapper works only for 'async def' coroutines;
  27668. inspect.iscoroutine no longer uses collections.abc.Coroutine, it's
  27669. intended to test for pure 'async def' coroutines only; add new opcode:
  27670. GET_YIELD_FROM_ITER; fix generators wrapper used in types.coroutine to be
  27671. instance of collections.abc.Generator; collections.abc.Awaitable and
  27672. collections.abc.Coroutine can no longer be used to detect generator-based
  27673. coroutines--use inspect.isawaitable instead.
  27674. - bpo-24450: Add gi_yieldfrom to generators and cr_await to coroutines.
  27675. Contributed by Benno Leslie and Yury Selivanov.
  27676. - bpo-19235: Add new RecursionError exception. Patch by Georg Brandl.
  27677. Library
  27678. -------
  27679. - bpo-21750: mock_open.read_data can now be read from each instance, as it
  27680. could in Python 3.3.
  27681. - bpo-24552: Fix use after free in an error case of the _pickle module.
  27682. - bpo-24514: tarfile now tolerates number fields consisting of only
  27683. whitespace.
  27684. - bpo-19176: Fixed doctype() related bugs in C implementation of
  27685. ElementTree. A deprecation warning no longer issued by XMLParser subclass
  27686. with default doctype() method. Direct call of doctype() now issues a
  27687. warning. Parser's doctype() now is not called if target's doctype() is
  27688. called. Based on patch by Martin Panter.
  27689. - bpo-20387: Restore semantic round-trip correctness in tokenize/untokenize
  27690. for tab-indented blocks.
  27691. - bpo-24456: Fixed possible buffer over-read in adpcm2lin() and lin2adpcm()
  27692. functions of the audioop module.
  27693. - bpo-24336: The contextmanager decorator now works with functions with
  27694. keyword arguments called "func" and "self". Patch by Martin Panter.
  27695. - bpo-24522: Fix possible integer overflow in json accelerator module.
  27696. - bpo-24489: ensure a previously set C errno doesn't disturb cmath.polar().
  27697. - bpo-24408: Fixed AttributeError in measure() and metrics() methods of
  27698. tkinter.Font.
  27699. - bpo-14373: C implementation of functools.lru_cache() now can be used with
  27700. methods.
  27701. - bpo-24347: Set KeyError if PyDict_GetItemWithError returns NULL.
  27702. - bpo-24348: Drop superfluous incref/decref.
  27703. - bpo-24359: Check for changed OrderedDict size during iteration.
  27704. - bpo-24368: Support keyword arguments in OrderedDict methods.
  27705. - bpo-24362: Simplify the C OrderedDict fast nodes resize logic.
  27706. - bpo-24377: Fix a ref leak in OrderedDict.__repr__.
  27707. - bpo-24369: Defend against key-changes during iteration.
  27708. Tests
  27709. -----
  27710. - bpo-24373: _testmultiphase and xxlimited now use tp_traverse and
  27711. tp_finalize to avoid reference leaks encountered when combining tp_dealloc
  27712. with PyType_FromSpec (see issue #16690 for details)
  27713. Documentation
  27714. -------------
  27715. - bpo-24458: Update documentation to cover multi-phase initialization for
  27716. extension modules (PEP 489). Patch by Petr Viktorin.
  27717. - bpo-24351: Clarify what is meant by "identifier" in the context of
  27718. string.Template instances.
  27719. Build
  27720. -----
  27721. - bpo-24432: Update Windows builds and OS X 10.5 installer to use OpenSSL
  27722. 1.0.2c.
  27723. What's New in Python 3.5.0 beta 2?
  27724. ==================================
  27725. *Release date: 2015-05-31*
  27726. Core and Builtins
  27727. -----------------
  27728. - bpo-24284: The startswith and endswith methods of the str class no longer
  27729. return True when finding the empty string and the indexes are completely
  27730. out of range.
  27731. - bpo-24115: Update uses of PyObject_IsTrue(), PyObject_Not(),
  27732. PyObject_IsInstance(), PyObject_RichCompareBool() and _PyDict_Contains()
  27733. to check for and handle errors correctly.
  27734. - bpo-24328: Fix importing one character extension modules.
  27735. - bpo-11205: In dictionary displays, evaluate the key before the value.
  27736. - bpo-24285: Fixed regression that prevented importing extension modules
  27737. from inside packages. Patch by Petr Viktorin.
  27738. Library
  27739. -------
  27740. - bpo-23247: Fix a crash in the StreamWriter.reset() of CJK codecs.
  27741. - bpo-24270: Add math.isclose() and cmath.isclose() functions as per
  27742. :pep:`485`. Contributed by Chris Barker and Tal Einat.
  27743. - bpo-5633: Fixed timeit when the statement is a string and the setup is
  27744. not.
  27745. - bpo-24326: Fixed audioop.ratecv() with non-default weightB argument.
  27746. Original patch by David Moore.
  27747. - bpo-16991: Add a C implementation of OrderedDict.
  27748. - bpo-23934: Fix inspect.signature to fail correctly for builtin types
  27749. lacking signature information. Initial patch by James Powell.
  27750. What's New in Python 3.5.0 beta 1?
  27751. ==================================
  27752. *Release date: 2015-05-24*
  27753. Core and Builtins
  27754. -----------------
  27755. - bpo-24276: Fixed optimization of property descriptor getter.
  27756. - bpo-24268: PEP 489: Multi-phase extension module initialization. Patch by
  27757. Petr Viktorin.
  27758. - bpo-23955: Add pyvenv.cfg option to suppress registry/environment lookup
  27759. for generating sys.path on Windows.
  27760. - bpo-24257: Fixed system error in the comparison of faked
  27761. types.SimpleNamespace.
  27762. - bpo-22939: Fixed integer overflow in iterator object. Patch by Clement
  27763. Rouault.
  27764. - bpo-23985: Fix a possible buffer overrun when deleting a slice from the
  27765. front of a bytearray and then appending some other bytes data.
  27766. - bpo-24102: Fixed exception type checking in standard error handlers.
  27767. - bpo-15027: The UTF-32 encoder is now 3x to 7x faster.
  27768. - bpo-23290: Optimize set_merge() for cases where the target is empty.
  27769. (Contributed by Serhiy Storchaka.)
  27770. - bpo-2292: PEP 448: Additional Unpacking Generalizations.
  27771. - bpo-24096: Make warnings.warn_explicit more robust against mutation of the
  27772. warnings.filters list.
  27773. - bpo-23996: Avoid a crash when a delegated generator raises an unnormalized
  27774. StopIteration exception. Patch by Stefan Behnel.
  27775. - bpo-23910: Optimize property() getter calls. Patch by Joe Jevnik.
  27776. - bpo-23911: Move path-based importlib bootstrap code to a separate frozen
  27777. module.
  27778. - bpo-24192: Fix namespace package imports.
  27779. - bpo-24022: Fix tokenizer crash when processing undecodable source code.
  27780. - bpo-9951: Added a hex() method to bytes, bytearray, and memoryview.
  27781. - bpo-22906: PEP 479: Change StopIteration handling inside generators.
  27782. - bpo-24017: PEP 492: Coroutines with async and await syntax.
  27783. Library
  27784. -------
  27785. - bpo-14373: Added C implementation of functools.lru_cache(). Based on
  27786. patches by Matt Joiner and Alexey Kachayev.
  27787. - bpo-24230: The tempfile module now accepts bytes for prefix, suffix and
  27788. dir parameters and returns bytes in such situations (matching the os
  27789. module APIs).
  27790. - bpo-22189: collections.UserString now supports __getnewargs__(),
  27791. __rmod__(), casefold(), format_map(), isprintable(), and maketrans().
  27792. Patch by Joe Jevnik.
  27793. - bpo-24244: Prevents termination when an invalid format string is
  27794. encountered on Windows in strftime.
  27795. - bpo-23973: PEP 484: Add the typing module.
  27796. - bpo-23086: The collections.abc.Sequence() abstract base class added
  27797. *start* and *stop* parameters to the index() mixin. Patch by Devin
  27798. Jeanpierre.
  27799. - bpo-20035: Replaced the ``tkinter._fix`` module used for setting up the
  27800. Tcl/Tk environment on Windows with a private function in the ``_tkinter``
  27801. module that makes no permanent changes to the environment.
  27802. - bpo-24257: Fixed segmentation fault in sqlite3.Row constructor with faked
  27803. cursor type.
  27804. - bpo-15836: assertRaises(), assertRaisesRegex(), assertWarns() and
  27805. assertWarnsRegex() assertments now check the type of the first argument to
  27806. prevent possible user error. Based on patch by Daniel Wagner-Hall.
  27807. - bpo-9858: Add missing method stubs to _io.RawIOBase. Patch by Laura
  27808. Rupprecht.
  27809. - bpo-22955: attrgetter, itemgetter and methodcaller objects in the operator
  27810. module now support pickling. Added readable and evaluable repr for these
  27811. objects. Based on patch by Josh Rosenberg.
  27812. - bpo-22107: tempfile.gettempdir() and tempfile.mkdtemp() now try again when
  27813. a directory with the chosen name already exists on Windows as well as on
  27814. Unix. tempfile.mkstemp() now fails early if parent directory is not valid
  27815. (not exists or is a file) on Windows.
  27816. - bpo-23780: Improved error message in os.path.join() with single argument.
  27817. - bpo-6598: Increased time precision and random number range in
  27818. email.utils.make_msgid() to strengthen the uniqueness of the message ID.
  27819. - bpo-24091: Fixed various crashes in corner cases in C implementation of
  27820. ElementTree.
  27821. - bpo-21931: msilib.FCICreate() now raises TypeError in the case of a bad
  27822. argument instead of a ValueError with a bogus FCI error number. Patch by
  27823. Jeffrey Armstrong.
  27824. - bpo-13866: *quote_via* argument added to urllib.parse.urlencode.
  27825. - bpo-20098: New mangle_from policy option for email, default True for
  27826. compat32, but False for all other policies.
  27827. - bpo-24211: The email library now supports RFC 6532: it can generate
  27828. headers using utf-8 instead of encoded words.
  27829. - bpo-16314: Added support for the LZMA compression in distutils.
  27830. - bpo-21804: poplib now supports RFC 6856 (UTF8).
  27831. - bpo-18682: Optimized pprint functions for builtin scalar types.
  27832. - bpo-22027: smtplib now supports RFC 6531 (SMTPUTF8).
  27833. - bpo-23488: Random generator objects now consume 2x less memory on 64-bit.
  27834. - bpo-1322: platform.dist() and platform.linux_distribution() functions are
  27835. now deprecated. Initial patch by Vajrasky Kok.
  27836. - bpo-22486: Added the math.gcd() function. The fractions.gcd() function
  27837. now is deprecated. Based on patch by Mark Dickinson.
  27838. - bpo-24064: Property() docstrings are now writeable. (Patch by Berker
  27839. Peksag.)
  27840. - bpo-22681: Added support for the koi8_t encoding.
  27841. - bpo-22682: Added support for the kz1048 encoding.
  27842. - bpo-23796: peek and read1 methods of BufferedReader now raise ValueError
  27843. if they called on a closed object. Patch by John Hergenroeder.
  27844. - bpo-21795: smtpd now supports the 8BITMIME extension whenever the new
  27845. *decode_data* constructor argument is set to False.
  27846. - bpo-24155: optimize heapq.heapify() for better cache performance when
  27847. heapifying large lists.
  27848. - bpo-21800: imaplib now supports RFC 5161 (enable), RFC 6855
  27849. (utf8/internationalized email) and automatically encodes non-ASCII
  27850. usernames and passwords to UTF8.
  27851. - bpo-20274: When calling a _sqlite.Connection, it now complains if passed
  27852. any keyword arguments. Previously it silently ignored them.
  27853. - bpo-20274: Remove ignored and erroneous "kwargs" parameters from three
  27854. METH_VARARGS methods on _sqlite.Connection.
  27855. - bpo-24134: assertRaises(), assertRaisesRegex(), assertWarns() and
  27856. assertWarnsRegex() checks now emits a deprecation warning when callable is
  27857. None or keyword arguments except msg is passed in the context manager
  27858. mode.
  27859. - bpo-24018: Add a collections.abc.Generator abstract base class.
  27860. Contributed by Stefan Behnel.
  27861. - bpo-23880: Tkinter's getint() and getdouble() now support Tcl_Obj.
  27862. Tkinter's getdouble() now supports any numbers (in particular int).
  27863. - bpo-22619: Added negative limit support in the traceback module. Based on
  27864. patch by Dmitry Kazakov.
  27865. - bpo-24094: Fix possible crash in json.encode with poorly behaved dict
  27866. subclasses.
  27867. - bpo-9246: On POSIX, os.getcwd() now supports paths longer than 1025 bytes.
  27868. Patch written by William Orr.
  27869. - bpo-17445: add difflib.diff_bytes() to support comparison of byte strings
  27870. (fixes a regression from Python 2).
  27871. - bpo-23917: Fall back to sequential compilation when ProcessPoolExecutor
  27872. doesn't exist. Patch by Claudiu Popa.
  27873. - bpo-23008: Fixed resolving attributes with boolean value is False in
  27874. pydoc.
  27875. - Fix asyncio issue 235: LifoQueue and PriorityQueue's put didn't increment
  27876. unfinished tasks (this bug was introduced when JoinableQueue was merged
  27877. with Queue).
  27878. - bpo-23908: os functions now reject paths with embedded null character on
  27879. Windows instead of silently truncating them.
  27880. - bpo-23728: binascii.crc_hqx() could return an integer outside of the range
  27881. 0-0xffff for empty data.
  27882. - bpo-23887: urllib.error.HTTPError now has a proper repr() representation.
  27883. Patch by Berker Peksag.
  27884. - asyncio: New event loop APIs: set_task_factory() and get_task_factory().
  27885. - asyncio: async() function is deprecated in favour of ensure_future().
  27886. - bpo-24178: asyncio.Lock, Condition, Semaphore, and BoundedSemaphore
  27887. support new 'async with' syntax. Contributed by Yury Selivanov.
  27888. - bpo-24179: Support 'async for' for asyncio.StreamReader. Contributed by
  27889. Yury Selivanov.
  27890. - bpo-24184: Add AsyncIterator and AsyncIterable ABCs to collections.abc.
  27891. Contributed by Yury Selivanov.
  27892. - bpo-22547: Implement informative __repr__ for inspect.BoundArguments.
  27893. Contributed by Yury Selivanov.
  27894. - bpo-24190: Implement inspect.BoundArgument.apply_defaults() method.
  27895. Contributed by Yury Selivanov.
  27896. - bpo-20691: Add 'follow_wrapped' argument to
  27897. inspect.Signature.from_callable() and inspect.signature(). Contributed by
  27898. Yury Selivanov.
  27899. - bpo-24248: Deprecate inspect.Signature.from_function() and
  27900. inspect.Signature.from_builtin().
  27901. - bpo-23898: Fix inspect.classify_class_attrs() to support attributes with
  27902. overloaded __eq__ and __bool__. Patch by Mike Bayer.
  27903. - bpo-24298: Fix inspect.signature() to correctly unwrap wrappers around
  27904. bound methods.
  27905. IDLE
  27906. ----
  27907. - bpo-23184: remove unused names and imports in idlelib. Initial patch by Al
  27908. Sweigart.
  27909. Tests
  27910. -----
  27911. - bpo-21520: test_zipfile no longer fails if the word 'bad' appears anywhere
  27912. in the name of the current directory.
  27913. - bpo-9517: Move script_helper into the support package. Patch by Christie
  27914. Wilson.
  27915. Documentation
  27916. -------------
  27917. - bpo-22155: Add File Handlers subsection with createfilehandler to tkinter
  27918. doc. Remove obsolete example from FAQ. Patch by Martin Panter.
  27919. - bpo-24029: Document the name binding behavior for submodule imports.
  27920. - bpo-24077: Fix typo in man page for -I command option: -s, not -S
  27921. Tools/Demos
  27922. -----------
  27923. - bpo-24000: Improved Argument Clinic's mapping of converters to legacy
  27924. "format units". Updated the documentation to match.
  27925. - bpo-24001: Argument Clinic converters now use accept={type} instead of
  27926. types={'type'} to specify the types the converter accepts.
  27927. - bpo-23330: h2py now supports arbitrary filenames in #include.
  27928. - bpo-24031: make patchcheck now supports git checkouts, too.
  27929. What's New in Python 3.5.0 alpha 4?
  27930. ===================================
  27931. *Release date: 2015-04-19*
  27932. Core and Builtins
  27933. -----------------
  27934. - bpo-22980: Under Linux, GNU/KFreeBSD and the Hurd, C extensions now
  27935. include the architecture triplet in the extension name, to make it easy to
  27936. test builds for different ABIs in the same working tree. Under OS X, the
  27937. extension name now includes :pep:`3149`-style information.
  27938. - bpo-22631: Added Linux-specific socket constant CAN_RAW_FD_FRAMES. Patch
  27939. courtesy of Joe Jevnik.
  27940. - bpo-23731: Implement :pep:`488`: removal of .pyo files.
  27941. - bpo-23726: Don't enable GC for user subclasses of non-GC types that don't
  27942. add any new fields. Patch by Eugene Toder.
  27943. - bpo-23309: Avoid a deadlock at shutdown if a daemon thread is aborted
  27944. while it is holding a lock to a buffered I/O object, and the main thread
  27945. tries to use the same I/O object (typically stdout or stderr). A fatal
  27946. error is emitted instead.
  27947. - bpo-22977: Fixed formatting Windows error messages on Wine. Patch by
  27948. Martin Panter.
  27949. - bpo-23466: %c, %o, %x, and %X in bytes formatting now raise TypeError on
  27950. non-integer input.
  27951. - bpo-24044: Fix possible null pointer dereference in list.sort in out of
  27952. memory conditions.
  27953. - bpo-21354: PyCFunction_New function is exposed by python DLL again.
  27954. Library
  27955. -------
  27956. - bpo-23840: tokenize.open() now closes the temporary binary file on error
  27957. to fix a resource warning.
  27958. - bpo-16914: new debuglevel 2 in smtplib adds timestamps to debug output.
  27959. - bpo-7159: urllib.request now supports sending auth credentials
  27960. automatically after the first 401. This enhancement is a superset of the
  27961. enhancement from issue #19494 and supersedes that change.
  27962. - bpo-23703: Fix a regression in urljoin() introduced in 901e4e52b20a. Patch
  27963. by Demian Brecht.
  27964. - bpo-4254: Adds _curses.update_lines_cols(). Patch by Arnon Yaari
  27965. - bpo-19933: Provide default argument for ndigits in round. Patch by
  27966. Vajrasky Kok.
  27967. - bpo-23193: Add a numeric_owner parameter to tarfile.TarFile.extract and
  27968. tarfile.TarFile.extractall. Patch by Michael Vogt and Eric Smith.
  27969. - bpo-23342: Add a subprocess.run() function than returns a CalledProcess
  27970. instance for a more consistent API than the existing call* functions.
  27971. - bpo-21217: inspect.getsourcelines() now tries to compute the start and end
  27972. lines from the code object, fixing an issue when a lambda function is used
  27973. as decorator argument. Patch by Thomas Ballinger and Allison Kaptur.
  27974. - bpo-24521: Fix possible integer overflows in the pickle module.
  27975. - bpo-22931: Allow '[' and ']' in cookie values.
  27976. - The keywords attribute of functools.partial is now always a dictionary.
  27977. - bpo-23811: Add missing newline to the PyCompileError error message. Patch
  27978. by Alex Shkop.
  27979. - bpo-21116: Avoid blowing memory when allocating a multiprocessing shared
  27980. array that's larger than 50% of the available RAM. Patch by Médéric
  27981. Boquien.
  27982. - bpo-22982: Improve BOM handling when seeking to multiple positions of a
  27983. writable text file.
  27984. - bpo-23464: Removed deprecated asyncio JoinableQueue.
  27985. - bpo-23529: Limit the size of decompressed data when reading from GzipFile,
  27986. BZ2File or LZMAFile. This defeats denial of service attacks using
  27987. compressed bombs (i.e. compressed payloads which decompress to a huge
  27988. size). Patch by Martin Panter and Nikolaus Rath.
  27989. - bpo-21859: Added Python implementation of io.FileIO.
  27990. - bpo-23865: close() methods in multiple modules now are idempotent and more
  27991. robust at shutdown. If they need to release multiple resources, all are
  27992. released even if errors occur.
  27993. - bpo-23400: Raise same exception on both Python 2 and 3 if sem_open is not
  27994. available. Patch by Davin Potts.
  27995. - bpo-10838: The subprocess now module includes SubprocessError and
  27996. TimeoutError in its list of exported names for the users wild enough to
  27997. use ``from subprocess import *``.
  27998. - bpo-23411: Added DefragResult, ParseResult, SplitResult,
  27999. DefragResultBytes, ParseResultBytes, and SplitResultBytes to
  28000. urllib.parse.__all__. Patch by Martin Panter.
  28001. - bpo-23881: urllib.request.ftpwrapper constructor now closes the socket if
  28002. the FTP connection failed to fix a ResourceWarning.
  28003. - bpo-23853: :meth:`socket.socket.sendall` does no more reset the socket
  28004. timeout each time data is sent successfully. The socket timeout is now the
  28005. maximum total duration to send all data.
  28006. - bpo-22721: An order of multiline pprint output of set or dict containing
  28007. orderable and non-orderable elements no longer depends on iteration order
  28008. of set or dict.
  28009. - bpo-15133: _tkinter.tkapp.getboolean() now supports Tcl_Obj and always
  28010. returns bool. tkinter.BooleanVar now validates input values (accepted
  28011. bool, int, str, and Tcl_Obj). tkinter.BooleanVar.get() now always returns
  28012. bool.
  28013. - bpo-10590: xml.sax.parseString() now supports string argument.
  28014. - bpo-23338: Fixed formatting ctypes error messages on Cygwin. Patch by
  28015. Makoto Kato.
  28016. - bpo-15582: inspect.getdoc() now follows inheritance chains.
  28017. - bpo-2175: SAX parsers now support a character stream of InputSource
  28018. object.
  28019. - bpo-16840: Tkinter now supports 64-bit integers added in Tcl 8.4 and
  28020. arbitrary precision integers added in Tcl 8.5.
  28021. - bpo-23834: Fix socket.sendto(), use the C Py_ssize_t type to store the
  28022. result of sendto() instead of the C int type.
  28023. - bpo-23618: :meth:`socket.socket.connect` now waits until the connection
  28024. completes instead of raising :exc:`InterruptedError` if the connection is
  28025. interrupted by signals, signal handlers don't raise an exception and the
  28026. socket is blocking or has a timeout. :meth:`socket.socket.connect` still
  28027. raise :exc:`InterruptedError` for non-blocking sockets.
  28028. - bpo-21526: Tkinter now supports new boolean type in Tcl 8.5.
  28029. - bpo-23836: Fix the faulthandler module to handle reentrant calls to its
  28030. signal handlers.
  28031. - bpo-23838: linecache now clears the cache and returns an empty result on
  28032. MemoryError.
  28033. - bpo-10395: Added os.path.commonpath(). Implemented in posixpath and
  28034. ntpath. Based on patch by Rafik Draoui.
  28035. - bpo-23611: Serializing more "lookupable" objects (such as unbound methods
  28036. or nested classes) now are supported with pickle protocols < 4.
  28037. - bpo-13583: sqlite3.Row now supports slice indexing.
  28038. - bpo-18473: Fixed 2to3 and 3to2 compatible pickle mappings. Fixed
  28039. ambiguous reverse mappings. Added many new mappings. Import mapping is
  28040. no longer applied to modules already mapped with full name mapping.
  28041. - bpo-23485: select.select() is now retried automatically with the
  28042. recomputed timeout when interrupted by a signal, except if the signal
  28043. handler raises an exception. This change is part of the :pep:`475`.
  28044. - bpo-23752: When built from an existing file descriptor, io.FileIO() now
  28045. only calls fstat() once. Before fstat() was called twice, which was not
  28046. necessary.
  28047. - bpo-23704: collections.deque() objects now support __add__, __mul__, and
  28048. __imul__().
  28049. - bpo-23171: csv.Writer.writerow() now supports arbitrary iterables.
  28050. - bpo-23745: The new email header parser now handles duplicate MIME
  28051. parameter names without error, similar to how get_param behaves.
  28052. - bpo-22117: Fix os.utime(), it now rounds the timestamp towards minus
  28053. infinity (-inf) instead of rounding towards zero.
  28054. - bpo-23310: Fix MagicMock's initializer to work with __methods__, just like
  28055. configure_mock(). Patch by Kasia Jachim.
  28056. Build
  28057. -----
  28058. - bpo-23817: FreeBSD now uses "1.0" in the SOVERSION as other operating
  28059. systems, instead of just "1".
  28060. - bpo-23501: Argument Clinic now generates code into separate files by
  28061. default.
  28062. Tests
  28063. -----
  28064. - bpo-23799: Added test.support.start_threads() for running and cleaning up
  28065. multiple threads.
  28066. - bpo-22390: test.regrtest now emits a warning if temporary files or
  28067. directories are left after running a test.
  28068. Tools/Demos
  28069. -----------
  28070. - bpo-18128: pygettext now uses standard +NNNN format in the
  28071. POT-Creation-Date header.
  28072. - bpo-23935: Argument Clinic's understanding of format units accepting
  28073. bytes, bytearrays, and buffers is now consistent with both the
  28074. documentation and the implementation.
  28075. - bpo-23944: Argument Clinic now wraps long impl prototypes at column 78.
  28076. - bpo-20586: Argument Clinic now ensures that functions without docstrings
  28077. have signatures.
  28078. - bpo-23492: Argument Clinic now generates argument parsing code with
  28079. PyArg_Parse instead of PyArg_ParseTuple if possible.
  28080. - bpo-23500: Argument Clinic is now smarter about generating the "#ifndef"
  28081. (empty) definition of the methoddef macro: it's only generated once, even
  28082. if Argument Clinic processes the same symbol multiple times, and it's
  28083. emitted at the end of all processing rather than immediately after the
  28084. first use.
  28085. C API
  28086. -----
  28087. - bpo-23998: PyImport_ReInitLock() now checks for lock allocation error
  28088. What's New in Python 3.5.0 alpha 3?
  28089. ===================================
  28090. *Release date: 2015-03-28*
  28091. Core and Builtins
  28092. -----------------
  28093. - bpo-23573: Increased performance of string search operations (str.find,
  28094. str.index, str.count, the in operator, str.split, str.partition) with
  28095. arguments of different kinds (UCS1, UCS2, UCS4).
  28096. - bpo-23753: Python doesn't support anymore platforms without stat() or
  28097. fstat(), these functions are always required.
  28098. - bpo-23681: The -b option now affects comparisons of bytes with int.
  28099. - bpo-23632: Memoryviews now allow tuple indexing (including for
  28100. multi-dimensional memoryviews).
  28101. - bpo-23192: Fixed generator lambdas. Patch by Bruno Cauet.
  28102. - bpo-23629: Fix the default __sizeof__ implementation for variable-sized
  28103. objects.
  28104. Library
  28105. -------
  28106. - bpo-14260: The groupindex attribute of regular expression pattern object
  28107. now is non-modifiable mapping.
  28108. - bpo-23792: Ignore KeyboardInterrupt when the pydoc pager is active. This
  28109. mimics the behavior of the standard unix pagers, and prevents pipepager
  28110. from shutting down while the pager itself is still running.
  28111. - bpo-23775: pprint() of OrderedDict now outputs the same representation as
  28112. repr().
  28113. - bpo-23765: Removed IsBadStringPtr calls in ctypes
  28114. - bpo-22364: Improved some re error messages using regex for hints.
  28115. - bpo-23742: ntpath.expandvars() no longer loses unbalanced single quotes.
  28116. - bpo-21717: The zipfile.ZipFile.open function now supports 'x' (exclusive
  28117. creation) mode.
  28118. - bpo-21802: The reader in BufferedRWPair now is closed even when closing
  28119. writer failed in BufferedRWPair.close().
  28120. - bpo-23622: Unknown escapes in regular expressions that consist of ``'\'``
  28121. and ASCII letter now raise a deprecation warning and will be forbidden in
  28122. Python 3.6.
  28123. - bpo-23671: string.Template now allows specifying the "self" parameter as a
  28124. keyword argument. string.Formatter now allows specifying the "self" and
  28125. the "format_string" parameters as keyword arguments.
  28126. - bpo-23502: The pprint module now supports mapping proxies.
  28127. - bpo-17530: pprint now wraps long bytes objects and bytearrays.
  28128. - bpo-22687: Fixed some corner cases in breaking words in tetxtwrap. Got rid
  28129. of quadratic complexity in breaking long words.
  28130. - bpo-4727: The copy module now uses pickle protocol 4 (PEP 3154) and
  28131. supports copying of instances of classes whose __new__ method takes
  28132. keyword-only arguments.
  28133. - bpo-23491: Added a zipapp module to support creating executable zip file
  28134. archives of Python code. Registered ".pyz" and ".pyzw" extensions on
  28135. Windows for these archives (PEP 441).
  28136. - bpo-23657: Avoid explicit checks for str in zipapp, adding support for
  28137. pathlib.Path objects as arguments.
  28138. - bpo-23688: Added support of arbitrary bytes-like objects and avoided
  28139. unnecessary copying of memoryview in gzip.GzipFile.write(). Original patch
  28140. by Wolfgang Maier.
  28141. - bpo-23252: Added support for writing ZIP files to unseekable streams.
  28142. - bpo-23647: Increase imaplib's MAXLINE to accommodate modern mailbox sizes.
  28143. - bpo-23539: If body is None, http.client.HTTPConnection.request now sets
  28144. Content-Length to 0 for PUT, POST, and PATCH headers to avoid 411 errors
  28145. from some web servers.
  28146. - bpo-22351: The nntplib.NNTP constructor no longer leaves the connection
  28147. and socket open until the garbage collector cleans them up. Patch by
  28148. Martin Panter.
  28149. - bpo-23704: collections.deque() objects now support methods for index(),
  28150. insert(), and copy(). This allows deques to be registered as a
  28151. MutableSequence and it improves their substitutability for lists.
  28152. - bpo-23715: :func:`signal.sigwaitinfo` and :func:`signal.sigtimedwait` are
  28153. now retried when interrupted by a signal not in the *sigset* parameter, if
  28154. the signal handler does not raise an exception. signal.sigtimedwait()
  28155. recomputes the timeout with a monotonic clock when it is retried.
  28156. - bpo-23001: Few functions in modules mmap, ossaudiodev, socket, ssl, and
  28157. codecs, that accepted only read-only bytes-like object now accept writable
  28158. bytes-like object too.
  28159. - bpo-23646: If time.sleep() is interrupted by a signal, the sleep is now
  28160. retried with the recomputed delay, except if the signal handler raises an
  28161. exception (PEP 475).
  28162. - bpo-23136: _strptime now uniformly handles all days in week 0, including
  28163. Dec 30 of previous year. Based on patch by Jim Carroll.
  28164. - bpo-23700: Iterator of NamedTemporaryFile now keeps a reference to
  28165. NamedTemporaryFile instance. Patch by Bohuslav Kabrda.
  28166. - bpo-22903: The fake test case created by unittest.loader when it fails
  28167. importing a test module is now picklable.
  28168. - bpo-22181: On Linux, os.urandom() now uses the new getrandom() syscall if
  28169. available, syscall introduced in the Linux kernel 3.17. It is more
  28170. reliable and more secure, because it avoids the need of a file descriptor
  28171. and waits until the kernel has enough entropy.
  28172. - bpo-2211: Updated the implementation of the http.cookies.Morsel class.
  28173. Setting attributes key, value and coded_value directly now is deprecated.
  28174. update() and setdefault() now transform and check keys. Comparing for
  28175. equality now takes into account attributes key, value and coded_value.
  28176. copy() now returns a Morsel, not a dict. repr() now contains all
  28177. attributes. Optimized checking keys and quoting values. Added new tests.
  28178. Original patch by Demian Brecht.
  28179. - bpo-18983: Allow selection of output units in timeit. Patch by Julian
  28180. Gindi.
  28181. - bpo-23631: Fix traceback.format_list when a traceback has been mutated.
  28182. - bpo-23568: Add rdivmod support to MagicMock() objects. Patch by Håkan
  28183. Lövdahl.
  28184. - bpo-2052: Add charset parameter to HtmlDiff.make_file().
  28185. - bpo-23668: Support os.truncate and os.ftruncate on Windows.
  28186. - bpo-23138: Fixed parsing cookies with absent keys or values in cookiejar.
  28187. Patch by Demian Brecht.
  28188. - bpo-23051: multiprocessing.Pool methods imap() and imap_unordered() now
  28189. handle exceptions raised by an iterator. Patch by Alon Diamant and Davin
  28190. Potts.
  28191. - bpo-23581: Add matmul support to MagicMock. Patch by Håkan Lövdahl.
  28192. - bpo-23566: enable(), register(), dump_traceback() and
  28193. dump_traceback_later() functions of faulthandler now accept file
  28194. descriptors. Patch by Wei Wu.
  28195. - bpo-22928: Disabled HTTP header injections in http.client. Original patch
  28196. by Demian Brecht.
  28197. - bpo-23615: Modules bz2, tarfile and tokenize now can be reloaded with
  28198. imp.reload(). Patch by Thomas Kluyver.
  28199. - bpo-23605: os.walk() now calls os.scandir() instead of os.listdir(). The
  28200. usage of os.scandir() reduces the number of calls to os.stat(). Initial
  28201. patch written by Ben Hoyt.
  28202. Build
  28203. -----
  28204. - bpo-23585: make patchcheck will ensure the interpreter is built.
  28205. Tests
  28206. -----
  28207. - bpo-23583: Added tests for standard IO streams in IDLE.
  28208. - bpo-22289: Prevent test_urllib2net failures due to ftp connection timeout.
  28209. Tools/Demos
  28210. -----------
  28211. - bpo-22826: The result of open() in Tools/freeze/bkfile.py is now better
  28212. compatible with regular files (in particular it now supports the context
  28213. management protocol).
  28214. What's New in Python 3.5.0 alpha 2?
  28215. ===================================
  28216. *Release date: 2015-03-09*
  28217. Core and Builtins
  28218. -----------------
  28219. - bpo-23571: PyObject_Call() and PyCFunction_Call() now raise a SystemError
  28220. if a function returns a result and raises an exception. The SystemError is
  28221. chained to the previous exception.
  28222. Library
  28223. -------
  28224. - bpo-22524: New os.scandir() function, part of the :pep:`471`:
  28225. "os.scandir() function -- a better and faster directory iterator". Patch
  28226. written by Ben Hoyt.
  28227. - bpo-23103: Reduced the memory consumption of IPv4Address and IPv6Address.
  28228. - bpo-21793: BaseHTTPRequestHandler again logs response code as numeric, not
  28229. as stringified enum. Patch by Demian Brecht.
  28230. - bpo-23476: In the ssl module, enable OpenSSL's X509_V_FLAG_TRUSTED_FIRST
  28231. flag on certificate stores when it is available.
  28232. - bpo-23576: Avoid stalling in SSL reads when EOF has been reached in the
  28233. SSL layer but the underlying connection hasn't been closed.
  28234. - bpo-23504: Added an __all__ to the types module.
  28235. - bpo-23563: Optimized utility functions in urllib.parse.
  28236. - bpo-7830: Flatten nested functools.partial.
  28237. - bpo-20204: Added the __module__ attribute to _tkinter classes.
  28238. - bpo-19980: Improved help() for non-recognized strings. help('') now shows
  28239. the help on str. help('help') now shows the help on help(). Original
  28240. patch by Mark Lawrence.
  28241. - bpo-23521: Corrected pure python implementation of timedelta division.
  28242. Eliminated OverflowError from ``timedelta * float`` for some floats;
  28243. Corrected rounding in timedelta true division.
  28244. - bpo-21619: Popen objects no longer leave a zombie after exit in the with
  28245. statement if the pipe was broken. Patch by Martin Panter.
  28246. - bpo-22936: Make it possible to show local variables in tracebacks for both
  28247. the traceback module and unittest.
  28248. - bpo-15955: Add an option to limit the output size in bz2.decompress().
  28249. Patch by Nikolaus Rath.
  28250. - bpo-6639: Module-level turtle functions no longer raise TclError after
  28251. closing the window.
  28252. - bpo-814253: Group references and conditional group references now work in
  28253. lookbehind assertions in regular expressions. (See also: bpo-9179)
  28254. - bpo-23215: Multibyte codecs with custom error handlers that ignores errors
  28255. consumed too much memory and raised SystemError or MemoryError. Original
  28256. patch by Aleksi Torhamo.
  28257. - bpo-5700: io.FileIO() called flush() after closing the file. flush() was
  28258. not called in close() if closefd=False.
  28259. - bpo-23374: Fixed pydoc failure with non-ASCII files when stdout encoding
  28260. differs from file system encoding (e.g. on Mac OS).
  28261. - bpo-23481: Remove RC4 from the SSL module's default cipher list.
  28262. - bpo-21548: Fix pydoc.synopsis() and pydoc.apropos() on modules with empty
  28263. docstrings.
  28264. - bpo-22885: Fixed arbitrary code execution vulnerability in the dbm.dumb
  28265. module. Original patch by Claudiu Popa.
  28266. - bpo-23239: ssl.match_hostname() now supports matching of IP addresses.
  28267. - bpo-23146: Fix mishandling of absolute Windows paths with forward slashes
  28268. in pathlib.
  28269. - bpo-23096: Pickle representation of floats with protocol 0 now is the same
  28270. for both Python and C implementations.
  28271. - bpo-19105: pprint now more efficiently uses free space at the right.
  28272. - bpo-14910: Add allow_abbrev parameter to argparse.ArgumentParser. Patch by
  28273. Jonathan Paugh, Steven Bethard, paul j3 and Daniel Eriksson.
  28274. - bpo-21717: tarfile.open() now supports 'x' (exclusive creation) mode.
  28275. - bpo-23344: marshal.dumps() is now 20-25% faster on average.
  28276. - bpo-20416: marshal.dumps() with protocols 3 and 4 is now 40-50% faster on
  28277. average.
  28278. - bpo-23421: Fixed compression in tarfile CLI. Patch by wdv4758h.
  28279. - bpo-23367: Fix possible overflows in the unicodedata module.
  28280. - bpo-23361: Fix possible overflow in Windows subprocess creation code.
  28281. - logging.handlers.QueueListener now takes a respect_handler_level keyword
  28282. argument which, if set to True, will pass messages to handlers taking
  28283. handler levels into account.
  28284. - bpo-19705: turtledemo now has a visual sorting algorithm demo. Original
  28285. patch from Jason Yeo.
  28286. - bpo-23801: Fix issue where cgi.FieldStorage did not always ignore the
  28287. entire preamble to a multipart body.
  28288. Build
  28289. -----
  28290. - bpo-23445: pydebug builds now use "gcc -Og" where possible, to make the
  28291. resulting executable faster.
  28292. - bpo-23686: Update OS X 10.5 installer build to use OpenSSL 1.0.2a.
  28293. C API
  28294. -----
  28295. - bpo-20204: Deprecation warning is now raised for builtin types without the
  28296. __module__ attribute.
  28297. Windows
  28298. -------
  28299. - bpo-23465: Implement :pep:`486` - Make the Python Launcher aware of
  28300. virtual environments. Patch by Paul Moore.
  28301. - bpo-23437: Make user scripts directory versioned on Windows. Patch by Paul
  28302. Moore.
  28303. What's New in Python 3.5.0 alpha 1?
  28304. ===================================
  28305. *Release date: 2015-02-08*
  28306. Core and Builtins
  28307. -----------------
  28308. - bpo-23285: PEP 475 - EINTR handling.
  28309. - bpo-22735: Fix many edge cases (including crashes) involving custom mro()
  28310. implementations.
  28311. - bpo-22896: Avoid using PyObject_AsCharBuffer(), PyObject_AsReadBuffer()
  28312. and PyObject_AsWriteBuffer().
  28313. - bpo-21295: Revert some changes (issue #16795) to AST line numbers and
  28314. column offsets that constituted a regression.
  28315. - bpo-22986: Allow changing an object's __class__ between a dynamic type and
  28316. static type in some cases.
  28317. - bpo-15859: PyUnicode_EncodeFSDefault(), PyUnicode_EncodeMBCS() and
  28318. PyUnicode_EncodeCodePage() now raise an exception if the object is not a
  28319. Unicode object. For PyUnicode_EncodeFSDefault(), it was already the case
  28320. on platforms other than Windows. Patch written by Campbell Barton.
  28321. - bpo-21408: The default __ne__() now returns NotImplemented if __eq__()
  28322. returned NotImplemented. Original patch by Martin Panter.
  28323. - bpo-23321: Fixed a crash in str.decode() when error handler returned
  28324. replacement string longer than malformed input data.
  28325. - bpo-22286: The "backslashreplace" error handlers now works with decoding
  28326. and translating.
  28327. - bpo-23253: Delay-load ShellExecute[AW] in os.startfile for reduced startup
  28328. overhead on Windows.
  28329. - bpo-22038: pyatomic.h now uses stdatomic.h or GCC built-in functions for
  28330. atomic memory access if available. Patch written by Vitor de Lima and
  28331. Gustavo Temple.
  28332. - bpo-20284: %-interpolation (aka printf) formatting added for bytes and
  28333. bytearray.
  28334. - bpo-23048: Fix jumping out of an infinite while loop in the pdb.
  28335. - bpo-20335: bytes constructor now raises TypeError when encoding or errors
  28336. is specified with non-string argument. Based on patch by Renaud Blanch.
  28337. - bpo-22834: If the current working directory ends up being set to a
  28338. non-existent directory then import will no longer raise FileNotFoundError.
  28339. - bpo-22869: Move the interpreter startup & shutdown code to a new dedicated
  28340. pylifecycle.c module
  28341. - bpo-22847: Improve method cache efficiency.
  28342. - bpo-22335: Fix crash when trying to enlarge a bytearray to 0x7fffffff
  28343. bytes on a 32-bit platform.
  28344. - bpo-22653: Fix an assertion failure in debug mode when doing a reentrant
  28345. dict insertion in debug mode.
  28346. - bpo-22643: Fix integer overflow in Unicode case operations (upper, lower,
  28347. title, swapcase, casefold).
  28348. - bpo-17636: Circular imports involving relative imports are now supported.
  28349. - bpo-22604: Fix assertion error in debug mode when dividing a complex
  28350. number by (nan+0j).
  28351. - bpo-21052: Do not raise ImportWarning when sys.path_hooks or sys.meta_path
  28352. are set to None.
  28353. - bpo-16518: Use 'bytes-like object required' in error messages that
  28354. previously used the far more cryptic "'x' does not support the buffer
  28355. protocol.
  28356. - bpo-22470: Fixed integer overflow issues in "backslashreplace",
  28357. "xmlcharrefreplace", and "surrogatepass" error handlers.
  28358. - bpo-22540: speed up ``PyObject_IsInstance`` and ``PyObject_IsSubclass`` in
  28359. the common case that the second argument has metaclass ``type``.
  28360. - bpo-18711: Add a new ``PyErr_FormatV`` function, similar to
  28361. ``PyErr_Format`` but accepting a ``va_list`` argument.
  28362. - bpo-22520: Fix overflow checking when generating the repr of a unicode
  28363. object.
  28364. - bpo-22519: Fix overflow checking in PyBytes_Repr.
  28365. - bpo-22518: Fix integer overflow issues in latin-1 encoding.
  28366. - bpo-16324: _charset parameter of MIMEText now also accepts
  28367. email.charset.Charset instances. Initial patch by Claude Paroz.
  28368. - bpo-1764286: Fix inspect.getsource() to support decorated functions. Patch
  28369. by Claudiu Popa.
  28370. - bpo-18554: os.__all__ includes posix functions.
  28371. - bpo-21391: Use os.path.abspath in the shutil module.
  28372. - bpo-11471: avoid generating a JUMP_FORWARD instruction at the end of an
  28373. if-block if there is no else-clause. Original patch by Eugene Toder.
  28374. - bpo-22215: Now ValueError is raised instead of TypeError when str or bytes
  28375. argument contains not permitted null character or byte.
  28376. - bpo-22258: Fix the internal function set_inheritable() on Illumos. This
  28377. platform exposes the function ``ioctl(FIOCLEX)``, but calling it fails
  28378. with errno is ENOTTY: "Inappropriate ioctl for device". set_inheritable()
  28379. now falls back to the slower ``fcntl()`` (``F_GETFD`` and then
  28380. ``F_SETFD``).
  28381. - bpo-21389: Displaying the __qualname__ of the underlying function in the
  28382. repr of a bound method.
  28383. - bpo-22206: Using pthread, PyThread_create_key() now sets errno to ENOMEM
  28384. and returns -1 (error) on integer overflow.
  28385. - bpo-20184: Argument Clinic based signature introspection added for 30 of
  28386. the builtin functions.
  28387. - bpo-22116: C functions and methods (of the 'builtin_function_or_method'
  28388. type) can now be weakref'ed. Patch by Wei Wu.
  28389. - bpo-22077: Improve index error messages for bytearrays, bytes, lists, and
  28390. tuples by adding 'or slices'. Added ', not <typename>' for bytearrays.
  28391. Original patch by Claudiu Popa.
  28392. - bpo-20179: Apply Argument Clinic to bytes and bytearray. Patch by Tal
  28393. Einat.
  28394. - bpo-22082: Clear interned strings in slotdefs.
  28395. - Upgrade Unicode database to Unicode 7.0.0.
  28396. - bpo-21897: Fix a crash with the f_locals attribute with closure variables
  28397. when frame.clear() has been called.
  28398. - bpo-21205: Add a new ``__qualname__`` attribute to generator, the
  28399. qualified name, and use it in the representation of a generator
  28400. (``repr(gen)``). The default name of the generator (``__name__``
  28401. attribute) is now get from the function instead of the code. Use
  28402. ``gen.gi_code.co_name`` to get the name of the code.
  28403. - bpo-21669: With the aid of heuristics in SyntaxError.__init__, the parser
  28404. now attempts to generate more meaningful (or at least more search engine
  28405. friendly) error messages when "exec" and "print" are used as statements.
  28406. - bpo-21642: In the conditional if-else expression, allow an integer written
  28407. with no space between itself and the ``else`` keyword (e.g. ``True if
  28408. 42else False``) to be valid syntax.
  28409. - bpo-21523: Fix over-pessimistic computation of the stack effect of some
  28410. opcodes in the compiler. This also fixes a quadratic compilation time
  28411. issue noticeable when compiling code with a large number of "and" and "or"
  28412. operators.
  28413. - bpo-21418: Fix a crash in the builtin function super() when called without
  28414. argument and without current frame (ex: embedded Python).
  28415. - bpo-21425: Fix flushing of standard streams in the interactive
  28416. interpreter.
  28417. - bpo-21435: In rare cases, when running finalizers on objects in cyclic
  28418. trash a bad pointer dereference could occur due to a subtle flaw in
  28419. internal iteration logic.
  28420. - bpo-21377: PyBytes_Concat() now tries to concatenate in-place when the
  28421. first argument has a reference count of 1. Patch by Nikolaus Rath.
  28422. - bpo-20355: -W command line options now have higher priority than the
  28423. PYTHONWARNINGS environment variable. Patch by Arfrever.
  28424. - bpo-21274: Define PATH_MAX for GNU/Hurd in Python/pythonrun.c.
  28425. - bpo-20904: Support setting FPU precision on m68k.
  28426. - bpo-21209: Fix sending tuples to custom generator objects with the yield
  28427. from syntax.
  28428. - bpo-21193: pow(a, b, c) now raises ValueError rather than TypeError when b
  28429. is negative. Patch by Josh Rosenberg.
  28430. - bpo-21176: PEP 465: Add the '@' operator for matrix multiplication.
  28431. - bpo-21134: Fix segfault when str is called on an uninitialized
  28432. UnicodeEncodeError, UnicodeDecodeError, or UnicodeTranslateError object.
  28433. - bpo-19537: Fix PyUnicode_DATA() alignment under m68k. Patch by Andreas
  28434. Schwab.
  28435. - bpo-20929: Add a type cast to avoid shifting a negative number.
  28436. - bpo-20731: Properly position in source code files even if they are opened
  28437. in text mode. Patch by Serhiy Storchaka.
  28438. - bpo-20637: Key-sharing now also works for instance dictionaries of
  28439. subclasses. Patch by Peter Ingebretson.
  28440. - bpo-8297: Attributes missing from modules now include the module name in
  28441. the error text. Original patch by ysj.ray.
  28442. - bpo-19995: %c, %o, %x, and %X now raise TypeError on non-integer input.
  28443. - bpo-19655: The ASDL parser - used by the build process to generate code
  28444. for managing the Python AST in C - was rewritten. The new parser is self
  28445. contained and does not require to carry long the spark.py parser-generator
  28446. library; spark.py was removed from the source base.
  28447. - bpo-12546: Allow ``\x00`` to be used as a fill character when using str,
  28448. int, float, and complex __format__ methods.
  28449. - bpo-20480: Add ipaddress.reverse_pointer. Patch by Leon Weber.
  28450. - bpo-13598: Modify string.Formatter to support auto-numbering of
  28451. replacement fields. It now matches the behavior of str.format() in this
  28452. regard. Patches by Phil Elson and Ramchandra Apte.
  28453. - bpo-8931: Make alternate formatting ('#') for type 'c' raise an exception.
  28454. In versions prior to 3.5, '#' with 'c' had no effect. Now specifying it is
  28455. an error. Patch by Torsten Landschoff.
  28456. - bpo-23165: Perform overflow checks before allocating memory in the
  28457. _Py_char2wchar function.
  28458. Library
  28459. -------
  28460. - bpo-23399: pyvenv creates relative symlinks where possible.
  28461. - bpo-20289: cgi.FieldStorage() now supports the context management
  28462. protocol.
  28463. - bpo-13128: Print response headers for CONNECT requests when debuglevel >
  28464. 0. Patch by Demian Brecht.
  28465. - bpo-15381: Optimized io.BytesIO to make less allocations and copyings.
  28466. - bpo-22818: Splitting on a pattern that could match an empty string now
  28467. raises a warning. Patterns that can only match empty strings are now
  28468. rejected.
  28469. - bpo-23099: Closing io.BytesIO with exported buffer is rejected now to
  28470. prevent corrupting exported buffer.
  28471. - bpo-23326: Removed __ne__ implementations. Since fixing default __ne__
  28472. implementation in issue #21408 they are redundant.
  28473. - bpo-23363: Fix possible overflow in itertools.permutations.
  28474. - bpo-23364: Fix possible overflow in itertools.product.
  28475. - bpo-23366: Fixed possible integer overflow in itertools.combinations.
  28476. - bpo-23369: Fixed possible integer overflow in
  28477. _json.encode_basestring_ascii.
  28478. - bpo-23353: Fix the exception handling of generators in
  28479. PyEval_EvalFrameEx(). At entry, save or swap the exception state even if
  28480. PyEval_EvalFrameEx() is called with throwflag=0. At exit, the exception
  28481. state is now always restored or swapped, not only if why is WHY_YIELD or
  28482. WHY_RETURN. Patch co-written with Antoine Pitrou.
  28483. - bpo-14099: Restored support of writing ZIP files to tellable but
  28484. non-seekable streams.
  28485. - bpo-14099: Writing to ZipFile and reading multiple ZipExtFiles is
  28486. threadsafe now.
  28487. - bpo-19361: JSON decoder now raises JSONDecodeError instead of ValueError.
  28488. - bpo-18518: timeit now rejects statements which can't be compiled outside a
  28489. function or a loop (e.g. "return" or "break").
  28490. - bpo-23094: Fixed readline with frames in Python implementation of pickle.
  28491. - bpo-23268: Fixed bugs in the comparison of ipaddress classes.
  28492. - bpo-21408: Removed incorrect implementations of __ne__() which didn't
  28493. returned NotImplemented if __eq__() returned NotImplemented. The default
  28494. __ne__() now works correctly.
  28495. - bpo-19996: :class:`email.feedparser.FeedParser` now handles (malformed)
  28496. headers with no key rather than assuming the body has started.
  28497. - bpo-20188: Support Application-Layer Protocol Negotiation (ALPN) in the
  28498. ssl module.
  28499. - bpo-23133: Pickling of ipaddress objects now produces more compact and
  28500. portable representation.
  28501. - bpo-23248: Update ssl error codes from latest OpenSSL git master.
  28502. - bpo-23266: Much faster implementation of ipaddress.collapse_addresses()
  28503. when there are many non-consecutive addresses.
  28504. - bpo-23098: 64-bit dev_t is now supported in the os module.
  28505. - bpo-21817: When an exception is raised in a task submitted to a
  28506. ProcessPoolExecutor, the remote traceback is now displayed in the parent
  28507. process. Patch by Claudiu Popa.
  28508. - bpo-15955: Add an option to limit output size when decompressing LZMA
  28509. data. Patch by Nikolaus Rath and Martin Panter.
  28510. - bpo-23250: In the http.cookies module, capitalize "HttpOnly" and "Secure"
  28511. as they are written in the standard.
  28512. - bpo-23063: In the distutils' check command, fix parsing of reST with code
  28513. or code-block directives.
  28514. - bpo-23209: selectors.BaseSelector.get_key() now raises a RuntimeError if
  28515. the selector is closed. And selectors.BaseSelector.close() now clears its
  28516. internal reference to the selector mapping to break a reference cycle.
  28517. Initial patch written by Martin Richard. (See also: bpo-23225)
  28518. - bpo-17911: Provide a way to seed the linecache for a PEP-302 module
  28519. without actually loading the code.
  28520. - bpo-17911: Provide a new object API for traceback, including the ability
  28521. to not lookup lines at all until the traceback is actually rendered,
  28522. without any trace of the original objects being kept alive.
  28523. - bpo-19777: Provide a home() classmethod on Path objects. Contributed by
  28524. Victor Salgado and Mayank Tripathi.
  28525. - bpo-23206: Make ``json.dumps(..., ensure_ascii=False)`` as fast as the
  28526. default case of ``ensure_ascii=True``. Patch by Naoki Inada.
  28527. - bpo-23185: Add math.inf and math.nan constants.
  28528. - bpo-23186: Add ssl.SSLObject.shared_ciphers() and
  28529. ssl.SSLSocket.shared_ciphers() to fetch the client's list ciphers sent at
  28530. handshake.
  28531. - bpo-23143: Remove compatibility with OpenSSLs older than 0.9.8.
  28532. - bpo-23132: Improve performance and introspection support of comparison
  28533. methods created by functool.total_ordering.
  28534. - bpo-19776: Add an expanduser() method on Path objects.
  28535. - bpo-23112: Fix SimpleHTTPServer to correctly carry the query string and
  28536. fragment when it redirects to add a trailing slash.
  28537. - bpo-21793: Added http.HTTPStatus enums (i.e. HTTPStatus.OK,
  28538. HTTPStatus.NOT_FOUND). Patch by Demian Brecht.
  28539. - bpo-23093: In the io, module allow more operations to work on detached
  28540. streams.
  28541. - bpo-23111: In the ftplib, make ssl.PROTOCOL_SSLv23 the default protocol
  28542. version.
  28543. - bpo-22585: On OpenBSD 5.6 and newer, os.urandom() now calls getentropy(),
  28544. instead of reading /dev/urandom, to get pseudo-random bytes.
  28545. - bpo-19104: pprint now produces evaluable output for wrapped strings.
  28546. - bpo-23071: Added missing names to codecs.__all__. Patch by Martin Panter.
  28547. - bpo-22783: Pickling now uses the NEWOBJ opcode instead of the NEWOBJ_EX
  28548. opcode if possible.
  28549. - bpo-15513: Added a __sizeof__ implementation for pickle classes.
  28550. - bpo-19858: pickletools.optimize() now aware of the MEMOIZE opcode, can
  28551. produce more compact result and no longer produces invalid output if input
  28552. data contains MEMOIZE opcodes together with PUT or BINPUT opcodes.
  28553. - bpo-22095: Fixed HTTPConnection.set_tunnel with default port. The port
  28554. value in the host header was set to "None". Patch by Demian Brecht.
  28555. - bpo-23016: A warning no longer produces an AttributeError when the program
  28556. is run with pythonw.exe.
  28557. - bpo-21775: shutil.copytree(): fix crash when copying to VFAT. An exception
  28558. handler assumed that OSError objects always have a 'winerror' attribute.
  28559. That is not the case, so the exception handler itself raised
  28560. AttributeError when run on Linux (and, presumably, any other non-Windows
  28561. OS). Patch by Greg Ward.
  28562. - bpo-1218234: Fix inspect.getsource() to load updated source of reloaded
  28563. module. Initial patch by Berker Peksag.
  28564. - bpo-21740: Support wrapped callables in doctest. Patch by Claudiu Popa.
  28565. - bpo-23009: Make sure selectors.EpollSelector.select() works when no FD is
  28566. registered.
  28567. - bpo-22959: In the constructor of http.client.HTTPSConnection, prefer the
  28568. context's check_hostname attribute over the *check_hostname* parameter.
  28569. - bpo-22696: Add function :func:`sys.is_finalizing` to know about
  28570. interpreter shutdown.
  28571. - bpo-16043: Add a default limit for the amount of data
  28572. xmlrpclib.gzip_decode will return. This resolves CVE-2013-1753.
  28573. - bpo-14099: ZipFile.open() no longer reopen the underlying file. Objects
  28574. returned by ZipFile.open() can now operate independently of the ZipFile
  28575. even if the ZipFile was created by passing in a file-like object as the
  28576. first argument to the constructor.
  28577. - bpo-22966: Fix __pycache__ pyc file name clobber when pyc_compile is asked
  28578. to compile a source file containing multiple dots in the source file name.
  28579. - bpo-21971: Update turtledemo doc and add module to the index.
  28580. - bpo-21032: Fixed socket leak if HTTPConnection.getresponse() fails.
  28581. Original patch by Martin Panter.
  28582. - bpo-22407: Deprecated the use of re.LOCALE flag with str patterns or
  28583. re.ASCII. It was newer worked.
  28584. - bpo-22902: The "ip" command is now used on Linux to determine MAC address
  28585. in uuid.getnode(). Pach by Bruno Cauet.
  28586. - bpo-22960: Add a context argument to xmlrpclib.ServerProxy constructor.
  28587. - bpo-22389: Add contextlib.redirect_stderr().
  28588. - bpo-21356: Make ssl.RAND_egd() optional to support LibreSSL. The
  28589. availability of the function is checked during the compilation. Patch
  28590. written by Bernard Spil.
  28591. - bpo-22915: SAX parser now supports files opened with file descriptor or
  28592. bytes path.
  28593. - bpo-22609: Constructors and update methods of mapping classes in the
  28594. collections module now accept the self keyword argument.
  28595. - bpo-22940: Add readline.append_history_file.
  28596. - bpo-19676: Added the "namereplace" error handler.
  28597. - bpo-22788: Add *context* parameter to logging.handlers.HTTPHandler.
  28598. - bpo-22921: Allow SSLContext to take the *hostname* parameter even if
  28599. OpenSSL doesn't support SNI.
  28600. - bpo-22894: TestCase.subTest() would cause the test suite to be stopped
  28601. when in failfast mode, even in the absence of failures.
  28602. - bpo-22796: HTTP cookie parsing is now stricter, in order to protect
  28603. against potential injection attacks.
  28604. - bpo-22370: Windows detection in pathlib is now more robust.
  28605. - bpo-22841: Reject coroutines in asyncio add_signal_handler(). Patch by
  28606. Ludovic.Gasc.
  28607. - bpo-19494: Added urllib.request.HTTPBasicPriorAuthHandler. Patch by Matej
  28608. Cepl.
  28609. - bpo-22578: Added attributes to the re.error class.
  28610. - bpo-22849: Fix possible double free in the io.TextIOWrapper constructor.
  28611. - bpo-12728: Different Unicode characters having the same uppercase but
  28612. different lowercase are now matched in case-insensitive regular
  28613. expressions.
  28614. - bpo-22821: Fixed fcntl() with integer argument on 64-bit big-endian
  28615. platforms.
  28616. - bpo-21650: Add an ``--sort-keys`` option to ``json.tool`` CLI.
  28617. - bpo-22824: Updated reprlib output format for sets to use set literals.
  28618. Patch contributed by Berker Peksag.
  28619. - bpo-22824: Updated reprlib output format for arrays to display empty
  28620. arrays without an unnecessary empty list. Suggested by Serhiy Storchaka.
  28621. - bpo-22406: Fixed the uu_codec codec incorrectly ported to 3.x. Based on
  28622. patch by Martin Panter.
  28623. - bpo-17293: uuid.getnode() now determines MAC address on AIX using netstat.
  28624. Based on patch by Aivars Kalvāns.
  28625. - bpo-22769: Fixed ttk.Treeview.tag_has() when called without arguments.
  28626. - bpo-22417: Verify certificates by default in httplib (PEP 476).
  28627. - bpo-22775: Fixed unpickling of http.cookies.SimpleCookie with protocol 2
  28628. and above. Patch by Tim Graham.
  28629. - bpo-22776: Brought excluded code into the scope of a try block in
  28630. SysLogHandler.emit().
  28631. - bpo-22665: Add missing get_terminal_size and SameFileError to
  28632. shutil.__all__.
  28633. - bpo-6623: Remove deprecated Netrc class in the ftplib module. Patch by
  28634. Matt Chaput.
  28635. - bpo-17381: Fixed handling of case-insensitive ranges in regular
  28636. expressions.
  28637. - bpo-22410: Module level functions in the re module now cache compiled
  28638. locale-dependent regular expressions taking into account the locale.
  28639. - bpo-22759: Query methods on pathlib.Path() (exists(), is_dir(), etc.) now
  28640. return False when the underlying stat call raises NotADirectoryError.
  28641. - bpo-8876: distutils now falls back to copying files when hard linking
  28642. doesn't work. This allows use with special filesystems such as VirtualBox
  28643. shared folders.
  28644. - bpo-22217: Implemented reprs of classes in the zipfile module.
  28645. - bpo-22457: Honour load_tests in the start_dir of discovery.
  28646. - bpo-18216: gettext now raises an error when a .mo file has an unsupported
  28647. major version number. Patch by Aaron Hill.
  28648. - bpo-13918: Provide a locale.delocalize() function which can remove
  28649. locale-specific number formatting from a string representing a number,
  28650. without then converting it to a specific type. Patch by Cédric Krier.
  28651. - bpo-22676: Make the pickling of global objects which don't have a
  28652. __module__ attribute less slow.
  28653. - bpo-18853: Fixed ResourceWarning in shlex.__nain__.
  28654. - bpo-9351: Defaults set with set_defaults on an argparse subparser are no
  28655. longer ignored when also set on the parent parser.
  28656. - bpo-7559: unittest test loading ImportErrors are reported as import errors
  28657. with their import exception rather than as attribute errors after the
  28658. import has already failed.
  28659. - bpo-19746: Make it possible to examine the errors from unittest discovery
  28660. without executing the test suite. The new ``errors`` attribute on
  28661. ``TestLoader`` exposes these non-fatal errors encountered during
  28662. discovery.
  28663. - bpo-21991: Make email.headerregistry's header 'params' attributes be
  28664. read-only (MappingProxyType). Previously the dictionary was modifiable
  28665. but a new one was created on each access of the attribute.
  28666. - bpo-22638: SSLv3 is now disabled throughout the standard library. It can
  28667. still be enabled by instantiating a SSLContext manually.
  28668. - bpo-22641: In asyncio, the default SSL context for client connections is
  28669. now created using ssl.create_default_context(), for stronger security.
  28670. - bpo-17401: Include closefd in io.FileIO repr.
  28671. - bpo-21338: Add silent mode for compileall. quiet parameters of
  28672. compile_{dir, file, path} functions now have a multilevel value. Also, -q
  28673. option of the CLI now have a multilevel value. Patch by Thomas Kluyver.
  28674. - bpo-20152: Convert the array and cmath modules to Argument Clinic.
  28675. - bpo-18643: Add socket.socketpair() on Windows.
  28676. - bpo-22435: Fix a file descriptor leak when socketserver bind fails.
  28677. - bpo-13096: Fixed segfault in CTypes POINTER handling of large values.
  28678. - bpo-11694: Raise ConversionError in xdrlib as documented. Patch by Filip
  28679. Gruszczyński and Claudiu Popa.
  28680. - bpo-19380: Optimized parsing of regular expressions.
  28681. - bpo-1519638: Now unmatched groups are replaced with empty strings in
  28682. re.sub() and re.subn().
  28683. - bpo-18615: sndhdr.what/whathdr now return a namedtuple.
  28684. - bpo-22462: Fix pyexpat's creation of a dummy frame to make it appear in
  28685. exception tracebacks.
  28686. - bpo-21965: Add support for in-memory SSL to the ssl module. Patch by
  28687. Geert Jansen.
  28688. - bpo-21173: Fix len() on a WeakKeyDictionary when .clear() was called with
  28689. an iterator alive.
  28690. - bpo-11866: Eliminated race condition in the computation of names for new
  28691. threads.
  28692. - bpo-21905: Avoid RuntimeError in pickle.whichmodule() when sys.modules is
  28693. mutated while iterating. Patch by Olivier Grisel.
  28694. - bpo-11271: concurrent.futures.Executor.map() now takes a *chunksize*
  28695. argument to allow batching of tasks in child processes and improve
  28696. performance of ProcessPoolExecutor. Patch by Dan O'Reilly.
  28697. - bpo-21883: os.path.join() and os.path.relpath() now raise a TypeError with
  28698. more helpful error message for unsupported or mismatched types of
  28699. arguments.
  28700. - bpo-22219: The zipfile module CLI now adds entries for directories
  28701. (including empty directories) in ZIP file.
  28702. - bpo-22449: In the ssl.SSLContext.load_default_certs, consult the
  28703. environmental variables SSL_CERT_DIR and SSL_CERT_FILE on Windows.
  28704. - bpo-22508: The email.__version__ variable has been removed; the email code
  28705. is no longer shipped separately from the stdlib, and __version__ hasn't
  28706. been updated in several releases.
  28707. - bpo-20076: Added non derived UTF-8 aliases to locale aliases table.
  28708. - bpo-20079: Added locales supported in glibc 2.18 to locale alias table.
  28709. - bpo-20218: Added convenience methods read_text/write_text and read_bytes/
  28710. write_bytes to pathlib.Path objects.
  28711. - bpo-22396: On 32-bit AIX platform, don't expose os.posix_fadvise() nor
  28712. os.posix_fallocate() because their prototypes in system headers are wrong.
  28713. - bpo-22517: When an io.BufferedRWPair object is deallocated, clear its
  28714. weakrefs.
  28715. - bpo-22437: Number of capturing groups in regular expression is no longer
  28716. limited by 100.
  28717. - bpo-17442: InteractiveInterpreter now displays the full chained traceback
  28718. in its showtraceback method, to match the built in interactive
  28719. interpreter.
  28720. - bpo-23392: Added tests for marshal C API that works with FILE*.
  28721. - bpo-10510: distutils register and upload methods now use HTML standards
  28722. compliant CRLF line endings.
  28723. - bpo-9850: Fixed macpath.join() for empty first component. Patch by Oleg
  28724. Oshmyan.
  28725. - bpo-5309: distutils' build and build_ext commands now accept a ``-j``
  28726. option to enable parallel building of extension modules.
  28727. - bpo-22448: Improve canceled timer handles cleanup to prevent unbound
  28728. memory usage. Patch by Joshua Moore-Oliva.
  28729. - bpo-22427: TemporaryDirectory no longer attempts to clean up twice when
  28730. used in the with statement in generator.
  28731. - bpo-22362: Forbidden ambiguous octal escapes out of range 0-0o377 in
  28732. regular expressions.
  28733. - bpo-20912: Now directories added to ZIP file have correct Unix and MS-DOS
  28734. directory attributes.
  28735. - bpo-21866: ZipFile.close() no longer writes ZIP64 central directory
  28736. records if allowZip64 is false.
  28737. - bpo-22278: Fix urljoin problem with relative urls, a regression observed
  28738. after changes to issue22118 were submitted.
  28739. - bpo-22415: Fixed debugging output of the GROUPREF_EXISTS opcode in the re
  28740. module. Removed trailing spaces in debugging output.
  28741. - bpo-22423: Unhandled exception in thread no longer causes unhandled
  28742. AttributeError when sys.stderr is None.
  28743. - bpo-21332: Ensure that ``bufsize=1`` in subprocess.Popen() selects line
  28744. buffering, rather than block buffering. Patch by Akira Li.
  28745. - bpo-21091: Fix API bug: email.message.EmailMessage.is_attachment is now a
  28746. method.
  28747. - bpo-21079: Fix email.message.EmailMessage.is_attachment to return the
  28748. correct result when the header has parameters as well as a value.
  28749. - bpo-22247: Add NNTPError to nntplib.__all__.
  28750. - bpo-22366: urllib.request.urlopen will accept a context object
  28751. (SSLContext) as an argument which will then be used for HTTPS connection.
  28752. Patch by Alex Gaynor.
  28753. - bpo-4180: The warnings registries are now reset when the filters are
  28754. modified.
  28755. - bpo-22419: Limit the length of incoming HTTP request in wsgiref server to
  28756. 65536 bytes and send a 414 error code for higher lengths. Patch
  28757. contributed by Devin Cook.
  28758. - Lax cookie parsing in http.cookies could be a security issue when combined
  28759. with non-standard cookie handling in some web browsers. Reported by
  28760. Sergey Bobrov.
  28761. - bpo-20537: logging methods now accept an exception instance as well as a
  28762. Boolean value or exception tuple. Thanks to Yury Selivanov for the patch.
  28763. - bpo-22384: An exception in Tkinter callback no longer crashes the program
  28764. when it is run with pythonw.exe.
  28765. - bpo-22168: Prevent turtle AttributeError with non-default Canvas on OS X.
  28766. - bpo-21147: sqlite3 now raises an exception if the request contains a null
  28767. character instead of truncating it. Based on patch by Victor Stinner.
  28768. - bpo-13968: The glob module now supports recursive search in subdirectories
  28769. using the ``**`` pattern.
  28770. - bpo-21951: Fixed a crash in Tkinter on AIX when called Tcl command with
  28771. empty string or tuple argument.
  28772. - bpo-21951: Tkinter now most likely raises MemoryError instead of crash if
  28773. the memory allocation fails.
  28774. - bpo-22338: Fix a crash in the json module on memory allocation failure.
  28775. - bpo-12410: imaplib.IMAP4 now supports the context management protocol.
  28776. Original patch by Tarek Ziadé.
  28777. - bpo-21270: We now override tuple methods in mock.call objects so that they
  28778. can be used as normal call attributes.
  28779. - bpo-16662: ``load_tests()`` is now unconditionally run when it is present
  28780. in a package's ``__init__.py``. ``TestLoader.loadTestsFromModule()``
  28781. still accepts use_load_tests, but it is deprecated and ignored. A new
  28782. keyword-only attribute ``pattern`` is added and documented. Patch given
  28783. by Robert Collins, tweaked by Barry Warsaw.
  28784. - bpo-22226: First letter no longer is stripped from the "status" key in the
  28785. result of Treeview.heading().
  28786. - bpo-19524: Fixed resource leak in the HTTP connection when an invalid
  28787. response is received. Patch by Martin Panter.
  28788. - bpo-20421: Add a .version() method to SSL sockets exposing the actual
  28789. protocol version in use.
  28790. - bpo-19546: configparser exceptions no longer expose implementation
  28791. details. Chained KeyErrors are removed, which leads to cleaner tracebacks.
  28792. Patch by Claudiu Popa.
  28793. - bpo-22051: turtledemo no longer reloads examples to re-run them.
  28794. Initialization of variables and gui setup should be done in main(), which
  28795. is called each time a demo is run, but not on import.
  28796. - bpo-21933: Turtledemo users can change the code font size with a menu
  28797. selection or control(command) '-' or '+' or control-mousewheel. Original
  28798. patch by Lita Cho.
  28799. - bpo-21597: The separator between the turtledemo text pane and the drawing
  28800. canvas can now be grabbed and dragged with a mouse. The code text pane
  28801. can be widened to easily view or copy the full width of the text. The
  28802. canvas can be widened on small screens. Original patches by Jan Kanis and
  28803. Lita Cho.
  28804. - bpo-18132: Turtledemo buttons no longer disappear when the window is
  28805. shrunk. Original patches by Jan Kanis and Lita Cho.
  28806. - bpo-22043: time.monotonic() is now always available.
  28807. ``threading.Lock.acquire()``, ``threading.RLock.acquire()`` and socket
  28808. operations now use a monotonic clock, instead of the system clock, when a
  28809. timeout is used.
  28810. - bpo-21527: Add a default number of workers to ThreadPoolExecutor equal to
  28811. 5 times the number of CPUs. Patch by Claudiu Popa.
  28812. - bpo-22216: smtplib now resets its state more completely after a quit. The
  28813. most obvious consequence of the previous behavior was a STARTTLS failure
  28814. during a connect/starttls/quit/connect/starttls sequence.
  28815. - bpo-22098: ctypes' BigEndianStructure and LittleEndianStructure now define
  28816. an empty __slots__ so that subclasses don't always get an instance dict.
  28817. Patch by Claudiu Popa.
  28818. - bpo-22185: Fix an occasional RuntimeError in threading.Condition.wait()
  28819. caused by mutation of the waiters queue without holding the lock. Patch
  28820. by Doug Zongker.
  28821. - bpo-22287: On UNIX, _PyTime_gettimeofday() now uses
  28822. clock_gettime(CLOCK_REALTIME) if available. As a side effect, Python now
  28823. depends on the librt library on Solaris and on Linux (only with glibc
  28824. older than 2.17).
  28825. - bpo-22182: Use e.args to unpack exceptions correctly in
  28826. distutils.file_util.move_file. Patch by Claudiu Popa.
  28827. - The webbrowser module now uses subprocess's start_new_session=True rather
  28828. than a potentially risky preexec_fn=os.setsid call.
  28829. - bpo-22042: signal.set_wakeup_fd(fd) now raises an exception if the file
  28830. descriptor is in blocking mode.
  28831. - bpo-16808: inspect.stack() now returns a named tuple instead of a tuple.
  28832. Patch by Daniel Shahaf.
  28833. - bpo-22236: Fixed Tkinter images copying operations in NoDefaultRoot mode.
  28834. - bpo-2527: Add a *globals* argument to timeit functions, in order to
  28835. override the globals namespace in which the timed code is executed. Patch
  28836. by Ben Roberts.
  28837. - bpo-22118: Switch urllib.parse to use RFC 3986 semantics for the
  28838. resolution of relative URLs, rather than RFCs 1808 and 2396. Patch by
  28839. Demian Brecht.
  28840. - bpo-21549: Added the "members" parameter to TarFile.list().
  28841. - bpo-19628: Allow compileall recursion depth to be specified with a -r
  28842. option.
  28843. - bpo-15696: Add a __sizeof__ implementation for mmap objects on Windows.
  28844. - bpo-22068: Avoided reference loops with Variables and Fonts in Tkinter.
  28845. - bpo-22165: SimpleHTTPRequestHandler now supports undecodable file names.
  28846. - bpo-15381: Optimized line reading in io.BytesIO.
  28847. - bpo-8797: Raise HTTPError on failed Basic Authentication immediately.
  28848. Initial patch by Sam Bull.
  28849. - bpo-20729: Restored the use of lazy iterkeys()/itervalues()/iteritems() in
  28850. the mailbox module.
  28851. - bpo-21448: Changed FeedParser feed() to avoid *O*\ (*n*\ :sup:`2`)
  28852. behavior when parsing long line. Original patch by Raymond Hettinger.
  28853. - bpo-22184: The functools LRU Cache decorator factory now gives an earlier
  28854. and clearer error message when the user forgets the required parameters.
  28855. - bpo-17923: glob() patterns ending with a slash no longer match non-dirs on
  28856. AIX. Based on patch by Delhallt.
  28857. - bpo-21725: Added support for RFC 6531 (SMTPUTF8) in smtpd.
  28858. - bpo-22176: Update the ctypes module's libffi to v3.1. This release adds
  28859. support for the Linux AArch64 and POWERPC ELF ABIv2 little endian
  28860. architectures.
  28861. - bpo-5411: Added support for the "xztar" format in the shutil module.
  28862. - bpo-21121: Don't force 3rd party C extensions to be built with
  28863. -Werror=declaration-after-statement.
  28864. - bpo-21975: Fixed crash when using uninitialized sqlite3.Row (in particular
  28865. when unpickling pickled sqlite3.Row). sqlite3.Row is now initialized in
  28866. the __new__() method.
  28867. - bpo-20170: Convert posixmodule to use Argument Clinic.
  28868. - bpo-21539: Add an *exists_ok* argument to ``Pathlib.mkdir()`` to mimic
  28869. ``mkdir -p`` and ``os.makedirs()`` functionality. When true, ignore
  28870. ``FileExistsErrors``. Patch by Berker Peksag.
  28871. - bpo-22127: Bypass IDNA for pure-ASCII host names in the socket module (in
  28872. particular for numeric IPs).
  28873. - bpo-21047: set the default value for the *convert_charrefs* argument of
  28874. HTMLParser to True. Patch by Berker Peksag.
  28875. - Add an __all__ to html.entities.
  28876. - bpo-15114: the strict mode and argument of HTMLParser, HTMLParser.error,
  28877. and the HTMLParserError exception have been removed.
  28878. - bpo-22085: Dropped support of Tk 8.3 in Tkinter.
  28879. - bpo-21580: Now Tkinter correctly handles bytes arguments passed to Tk. In
  28880. particular this allows initializing images from binary data.
  28881. - bpo-22003: When initialized from a bytes object, io.BytesIO() now defers
  28882. making a copy until it is mutated, improving performance and memory use on
  28883. some use cases. Patch by David Wilson.
  28884. - bpo-22018: On Windows, signal.set_wakeup_fd() now also supports sockets. A
  28885. side effect is that Python depends to the WinSock library.
  28886. - bpo-22054: Add os.get_blocking() and os.set_blocking() functions to get
  28887. and set the blocking mode of a file descriptor (False if the O_NONBLOCK
  28888. flag is set, True otherwise). These functions are not available on
  28889. Windows.
  28890. - bpo-17172: Make turtledemo start as active on OS X even when run with
  28891. subprocess. Patch by Lita Cho.
  28892. - bpo-21704: Fix build error for _multiprocessing when semaphores are not
  28893. available. Patch by Arfrever Frehtes Taifersar Arahesis.
  28894. - bpo-20173: Convert sha1, sha256, sha512 and md5 to ArgumentClinic. Patch
  28895. by Vajrasky Kok.
  28896. - Fix repr(_socket.socket) on Windows 64-bit: don't fail with OverflowError
  28897. on closed socket. repr(socket.socket) already works fine.
  28898. - bpo-22033: Reprs of most Python implemented classes now contain actual
  28899. class name instead of hardcoded one.
  28900. - bpo-21947: The dis module can now disassemble generator-iterator objects
  28901. based on their gi_code attribute. Patch by Clement Rouault.
  28902. - bpo-16133: The asynchat.async_chat.handle_read() method now ignores
  28903. BlockingIOError exceptions.
  28904. - bpo-22044: Fixed premature DECREF in call_tzinfo_method. Patch by Tom
  28905. Flanagan.
  28906. - bpo-19884: readline: Disable the meta modifier key if stdout is not a
  28907. terminal to not write the ANSI sequence ``"\033[1034h"`` into stdout. This
  28908. sequence is used on some terminal (ex: TERM=xterm-256color") to enable
  28909. support of 8 bit characters.
  28910. - bpo-4350: Removed a number of out-of-dated and non-working for a long time
  28911. Tkinter methods.
  28912. - bpo-6167: Scrollbar.activate() now returns the name of active element if
  28913. the argument is not specified. Scrollbar.set() now always accepts only 2
  28914. arguments.
  28915. - bpo-15275: Clean up and speed up the ntpath module.
  28916. - bpo-21888: plistlib's load() and loads() now work if the fmt parameter is
  28917. specified.
  28918. - bpo-22032: __qualname__ instead of __name__ is now always used to format
  28919. fully qualified class names of Python implemented classes.
  28920. - bpo-22031: Reprs now always use hexadecimal format with the "0x" prefix
  28921. when contain an id in form " at 0x...".
  28922. - bpo-22018: signal.set_wakeup_fd() now raises an OSError instead of a
  28923. ValueError on ``fstat()`` failure.
  28924. - bpo-21044: tarfile.open() now handles fileobj with an integer 'name'
  28925. attribute. Based on patch by Antoine Pietri.
  28926. - bpo-21966: Respect -q command-line option when code module is ran.
  28927. - bpo-19076: Don't pass the redundant 'file' argument to self.error().
  28928. - bpo-16382: Improve exception message of warnings.warn() for bad category.
  28929. Initial patch by Phil Elson.
  28930. - bpo-21932: os.read() now uses a :c:func:`Py_ssize_t` type instead of
  28931. :c:expr:`int` for the size to support reading more than 2 GB at once. On
  28932. Windows, the size is truncated to INT_MAX. As any call to os.read(), the
  28933. OS may read less bytes than the number of requested bytes.
  28934. - bpo-21942: Fixed source file viewing in pydoc's server mode on Windows.
  28935. - bpo-11259: asynchat.async_chat().set_terminator() now raises a ValueError
  28936. if the number of received bytes is negative.
  28937. - bpo-12523: asynchat.async_chat.push() now raises a TypeError if it doesn't
  28938. get a bytes string
  28939. - bpo-21707: Add missing kwonlyargcount argument to
  28940. ModuleFinder.replace_paths_in_code().
  28941. - bpo-20639: calling Path.with_suffix('') allows removing the suffix again.
  28942. Patch by July Tikhonov.
  28943. - bpo-21714: Disallow the construction of invalid paths using
  28944. Path.with_name(). Original patch by Antony Lee.
  28945. - bpo-15014: Added 'auth' method to smtplib to make implementing auth
  28946. mechanisms simpler, and used it internally in the login method.
  28947. - bpo-21151: Fixed a segfault in the winreg module when ``None`` is passed
  28948. as a ``REG_BINARY`` value to SetValueEx. Patch by John Ehresman.
  28949. - bpo-21090: io.FileIO.readall() does not ignore I/O errors anymore. Before,
  28950. it ignored I/O errors if at least the first C call read() succeed.
  28951. - bpo-5800: headers parameter of wsgiref.headers.Headers is now optional.
  28952. Initial patch by Pablo Torres Navarrete and SilentGhost.
  28953. - bpo-21781: ssl.RAND_add() now supports strings longer than 2 GB.
  28954. - bpo-21679: Prevent extraneous fstat() calls during open(). Patch by
  28955. Bohuslav Kabrda.
  28956. - bpo-21863: cProfile now displays the module name of C extension functions,
  28957. in addition to their own name.
  28958. - bpo-11453: asyncore: emit a ResourceWarning when an unclosed file_wrapper
  28959. object is destroyed. The destructor now closes the file if needed. The
  28960. close() method can now be called twice: the second call does nothing.
  28961. - bpo-21858: Better handling of Python exceptions in the sqlite3 module.
  28962. - bpo-21476: Make sure the email.parser.BytesParser TextIOWrapper is
  28963. discarded after parsing, so the input file isn't unexpectedly closed.
  28964. - bpo-20295: imghdr now recognizes OpenEXR format images.
  28965. - bpo-21729: Used the "with" statement in the dbm.dumb module to ensure
  28966. files closing. Patch by Claudiu Popa.
  28967. - bpo-21491: socketserver: Fix a race condition in child processes reaping.
  28968. - bpo-21719: Added the ``st_file_attributes`` field to os.stat_result on
  28969. Windows.
  28970. - bpo-21832: Require named tuple inputs to be exact strings.
  28971. - bpo-21722: The distutils "upload" command now exits with a non-zero return
  28972. code when uploading fails. Patch by Martin Dengler.
  28973. - bpo-21723: asyncio.Queue: support any type of number (ex: float) for the
  28974. maximum size. Patch written by Vajrasky Kok.
  28975. - bpo-21711: support for "site-python" directories has now been removed from
  28976. the site module (it was deprecated in 3.4).
  28977. - bpo-17552: new socket.sendfile() method allowing a file to be sent over a
  28978. socket by using high-performance os.sendfile() on UNIX. Patch by Giampaolo
  28979. Rodola'.
  28980. - bpo-18039: dbm.dump.open() now always creates a new database when the flag
  28981. has the value 'n'. Patch by Claudiu Popa.
  28982. - bpo-21326: Add a new is_closed() method to asyncio.BaseEventLoop.
  28983. run_forever() and run_until_complete() methods of asyncio.BaseEventLoop
  28984. now raise an exception if the event loop was closed.
  28985. - bpo-21766: Prevent a security hole in CGIHTTPServer by URL unquoting paths
  28986. before checking for a CGI script at that path.
  28987. - bpo-21310: Fixed possible resource leak in failed open().
  28988. - bpo-21256: Printout of keyword args should be in deterministic order in a
  28989. mock function call. This will help to write better doctests.
  28990. - bpo-21677: Fixed chaining nonnormalized exceptions in io close() methods.
  28991. - bpo-11709: Fix the pydoc.help function to not fail when sys.stdin is not a
  28992. valid file.
  28993. - bpo-21515: tempfile.TemporaryFile now uses os.O_TMPFILE flag is available.
  28994. - bpo-13223: Fix pydoc.writedoc so that the HTML documentation for methods
  28995. that use 'self' in the example code is generated correctly.
  28996. - bpo-21463: In urllib.request, fix pruning of the FTP cache.
  28997. - bpo-21618: The subprocess module could fail to close open fds that were
  28998. inherited by the calling process and already higher than POSIX resource
  28999. limits would otherwise allow. On systems with a functioning /proc/self/fd
  29000. or /dev/fd interface the max is now ignored and all fds are closed.
  29001. - bpo-20383: Introduce importlib.util.module_from_spec() as the preferred
  29002. way to create a new module.
  29003. - bpo-21552: Fixed possible integer overflow of too long string lengths in
  29004. the tkinter module on 64-bit platforms.
  29005. - bpo-14315: The zipfile module now ignores extra fields in the central
  29006. directory that are too short to be parsed instead of letting a
  29007. struct.unpack error bubble up as this "bad data" appears in many real
  29008. world zip files in the wild and is ignored by other zip tools.
  29009. - bpo-13742: Added "key" and "reverse" parameters to heapq.merge(). (First
  29010. draft of patch contributed by Simon Sapin.)
  29011. - bpo-21402: tkinter.ttk now works when default root window is not set.
  29012. - bpo-3015: _tkinter.create() now creates tkapp object with wantobject=1 by
  29013. default.
  29014. - bpo-10203: sqlite3.Row now truly supports sequence protocol. In
  29015. particular it supports reverse() and negative indices. Original patch by
  29016. Claudiu Popa.
  29017. - bpo-18807: If copying (no symlinks) specified for a venv, then the python
  29018. interpreter aliases (python, python3) are now created by copying rather
  29019. than symlinking.
  29020. - bpo-20197: Added support for the WebP image type in the imghdr module.
  29021. Patch by Fabrice Aneche and Claudiu Popa.
  29022. - bpo-21513: Speedup some properties of IP addresses (IPv4Address,
  29023. IPv6Address) such as .is_private or .is_multicast.
  29024. - bpo-21137: Improve the repr for threading.Lock() and its variants by
  29025. showing the "locked" or "unlocked" status. Patch by Berker Peksag.
  29026. - bpo-21538: The plistlib module now supports loading of binary plist files
  29027. when reference or offset size is not a power of two.
  29028. - bpo-21455: Add a default backlog to socket.listen().
  29029. - bpo-21525: Most Tkinter methods which accepted tuples now accept lists
  29030. too.
  29031. - bpo-22166: With the assistance of a new internal _codecs._forget_codec
  29032. helping function, test_codecs now clears the encoding caches to avoid the
  29033. appearance of a reference leak
  29034. - bpo-22236: Tkinter tests now don't reuse default root window. New root
  29035. window is created for every test class.
  29036. - bpo-10744: Fix :pep:`3118` format strings on ctypes objects with a
  29037. nontrivial shape.
  29038. - bpo-20826: Optimize ipaddress.collapse_addresses().
  29039. - bpo-21487: Optimize ipaddress.summarize_address_range() and
  29040. ipaddress.{IPv4Network,IPv6Network}.subnets().
  29041. - bpo-21486: Optimize parsing of netmasks in ipaddress.IPv4Network and
  29042. ipaddress.IPv6Network.
  29043. - bpo-13916: Disallowed the surrogatepass error handler for non UTF-\*
  29044. encodings.
  29045. - bpo-20998: Fixed re.fullmatch() of repeated single character pattern with
  29046. ignore case. Original patch by Matthew Barnett.
  29047. - bpo-21075: fileinput.FileInput now reads bytes from standard stream if
  29048. binary mode is specified. Patch by Sam Kimbrel.
  29049. - bpo-19775: Add a samefile() method to pathlib Path objects. Initial patch
  29050. by Vajrasky Kok.
  29051. - bpo-21226: Set up modules properly in PyImport_ExecCodeModuleObject (and
  29052. friends).
  29053. - bpo-21398: Fix a unicode error in the pydoc pager when the documentation
  29054. contains characters not encodable to the stdout encoding.
  29055. - bpo-16531: ipaddress.IPv4Network and ipaddress.IPv6Network now accept an
  29056. (address, netmask) tuple argument, so as to easily construct network
  29057. objects from existing addresses.
  29058. - bpo-21156: importlib.abc.InspectLoader.source_to_code() is now a
  29059. staticmethod.
  29060. - bpo-21424: Simplified and optimized heaqp.nlargest() and nmsmallest() to
  29061. make fewer tuple comparisons.
  29062. - bpo-21396: Fix TextIOWrapper(..., write_through=True) to not force a
  29063. flush() on the underlying binary stream. Patch by akira.
  29064. - bpo-18314: Unlink now removes junctions on Windows. Patch by Kim Gräsman
  29065. - bpo-21088: Bugfix for curses.window.addch() regression in 3.4.0. In
  29066. porting to Argument Clinic, the first two arguments were reversed.
  29067. - bpo-21407: _decimal: The module now supports function signatures.
  29068. - bpo-10650: Remove the non-standard 'watchexp' parameter from the
  29069. Decimal.quantize() method in the Python version. It had never been
  29070. present in the C version.
  29071. - bpo-21469: Reduced the risk of false positives in robotparser by checking
  29072. to make sure that robots.txt has been read or does not exist prior to
  29073. returning True in can_fetch().
  29074. - bpo-19414: Have the OrderedDict mark deleted links as unusable. This gives
  29075. an early failure if the link is deleted during iteration.
  29076. - bpo-21421: Add __slots__ to the MappingViews ABC. Patch by Josh Rosenberg.
  29077. - bpo-21101: Eliminate double hashing in the C speed-up code for
  29078. collections.Counter().
  29079. - bpo-21321: itertools.islice() now releases the reference to the source
  29080. iterator when the slice is exhausted. Patch by Anton Afanasyev.
  29081. - bpo-21057: TextIOWrapper now allows the underlying binary stream's read()
  29082. or read1() method to return an arbitrary bytes-like object (such as a
  29083. memoryview). Patch by Nikolaus Rath.
  29084. - bpo-20951: SSLSocket.send() now raises either SSLWantReadError or
  29085. SSLWantWriteError on a non-blocking socket if the operation would block.
  29086. Previously, it would return 0. Patch by Nikolaus Rath.
  29087. - bpo-13248: removed previously deprecated asyncore.dispatcher __getattr__
  29088. cheap inheritance hack.
  29089. - bpo-9815: assertRaises now tries to clear references to local variables in
  29090. the exception's traceback.
  29091. - bpo-19940: ssl.cert_time_to_seconds() now interprets the given time string
  29092. in the UTC timezone (as specified in RFC 5280), not the local timezone.
  29093. - bpo-13204: Calling sys.flags.__new__ would crash the interpreter, now it
  29094. raises a TypeError.
  29095. - bpo-19385: Make operations on a closed dbm.dumb database always raise the
  29096. same exception.
  29097. - bpo-21207: Detect when the os.urandom cached fd has been closed or
  29098. replaced, and open it anew.
  29099. - bpo-21291: subprocess's Popen.wait() is now thread safe so that multiple
  29100. threads may be calling wait() or poll() on a Popen instance at the same
  29101. time without losing the Popen.returncode value.
  29102. - bpo-21127: Path objects can now be instantiated from str subclass
  29103. instances (such as ``numpy.str_``).
  29104. - bpo-15002: urllib.response object to use _TemporaryFileWrapper (and
  29105. _TemporaryFileCloser) facility. Provides a better way to handle file
  29106. descriptor close. Patch contributed by Christian Theune.
  29107. - bpo-12220: mindom now raises a custom ValueError indicating it doesn't
  29108. support spaces in URIs instead of letting a 'split' ValueError bubble up.
  29109. - bpo-21068: The ssl.PROTOCOL* constants are now enum members.
  29110. - bpo-21276: posixmodule: Don't define USE_XATTRS on KFreeBSD and the Hurd.
  29111. - bpo-21262: New method assert_not_called for Mock. It raises AssertionError
  29112. if the mock has been called.
  29113. - bpo-21238: New keyword argument ``unsafe`` to Mock. It raises
  29114. ``AttributeError`` incase of an attribute startswith assert or assret.
  29115. - bpo-20896: ssl.get_server_certificate() now uses PROTOCOL_SSLv23, not
  29116. PROTOCOL_SSLv3, for maximum compatibility.
  29117. - bpo-21239: patch.stopall() didn't work deterministically when the same
  29118. name was patched more than once.
  29119. - bpo-21203: Updated fileConfig and dictConfig to remove inconsistencies.
  29120. Thanks to Jure Koren for the patch.
  29121. - bpo-21222: Passing name keyword argument to mock.create_autospec now
  29122. works.
  29123. - bpo-21197: Add lib64 -> lib symlink in venvs on 64-bit non-OS X POSIX.
  29124. - bpo-17498: Some SMTP servers disconnect after certain errors, violating
  29125. strict RFC conformance. Instead of losing the error code when we issue
  29126. the subsequent RSET, smtplib now returns the error code and defers raising
  29127. the SMTPServerDisconnected error until the next command is issued.
  29128. - bpo-17826: setting an iterable side_effect on a mock function created by
  29129. create_autospec now works. Patch by Kushal Das.
  29130. - bpo-7776: Fix ``Host:`` header and reconnection when using
  29131. http.client.HTTPConnection.set_tunnel(). Patch by Nikolaus Rath.
  29132. - bpo-20968: unittest.mock.MagicMock now supports division. Patch by
  29133. Johannes Baiter.
  29134. - bpo-21529: Fix arbitrary memory access in JSONDecoder.raw_decode with a
  29135. negative second parameter. Bug reported by Guido Vranken. (See also:
  29136. CVE-2014-4616)
  29137. - bpo-21169: getpass now handles non-ascii characters that the input stream
  29138. encoding cannot encode by re-encoding using the replace error handler.
  29139. - bpo-21171: Fixed undocumented filter API of the rot13 codec. Patch by
  29140. Berker Peksag.
  29141. - bpo-20539: Improved math.factorial error message for large positive inputs
  29142. and changed exception type (OverflowError -> ValueError) for large
  29143. negative inputs.
  29144. - bpo-21172: isinstance check relaxed from dict to collections.Mapping.
  29145. - bpo-21155: asyncio.EventLoop.create_unix_server() now raises a ValueError
  29146. if path and sock are specified at the same time.
  29147. - bpo-21136: Avoid unnecessary normalization of Fractions resulting from
  29148. power and other operations. Patch by Raymond Hettinger.
  29149. - bpo-17621: Introduce importlib.util.LazyLoader.
  29150. - bpo-21076: signal module constants were turned into enums. Patch by
  29151. Giampaolo Rodola'.
  29152. - bpo-20636: Improved the repr of Tkinter widgets.
  29153. - bpo-19505: The items, keys, and values views of OrderedDict now support
  29154. reverse iteration using reversed().
  29155. - bpo-21149: Improved thread-safety in logging cleanup during interpreter
  29156. shutdown. Thanks to Devin Jeanpierre for the patch.
  29157. - bpo-21058: Fix a leak of file descriptor in
  29158. :func:`tempfile.NamedTemporaryFile`, close the file descriptor if
  29159. :func:`io.open` fails
  29160. - bpo-21200: Return None from pkgutil.get_loader() when __spec__ is missing.
  29161. - bpo-21013: Enhance ssl.create_default_context() when used for server side
  29162. sockets to provide better security by default.
  29163. - bpo-20145: ``assertRaisesRegex`` and ``assertWarnsRegex`` now raise a
  29164. ``TypeError`` if the second argument is not a string or compiled regex.
  29165. - bpo-20633: Replace relative import by absolute import.
  29166. - bpo-20980: Stop wrapping exception when using ThreadPool.
  29167. - bpo-21082: In os.makedirs, do not set the process-wide umask. Note this
  29168. changes behavior of makedirs when exist_ok=True.
  29169. - bpo-20990: Fix issues found by pyflakes for multiprocessing.
  29170. - bpo-21015: SSL contexts will now automatically select an elliptic curve
  29171. for ECDH key exchange on OpenSSL 1.0.2 and later, and otherwise default to
  29172. "prime256v1".
  29173. - bpo-21000: Improve the command-line interface of json.tool.
  29174. - bpo-20995: Enhance default ciphers used by the ssl module to enable better
  29175. security and prioritize perfect forward secrecy.
  29176. - bpo-20884: Don't assume that __file__ is defined on importlib.__init__.
  29177. - bpo-21499: Ignore __builtins__ in several test_importlib.test_api tests.
  29178. - bpo-20627: xmlrpc.client.ServerProxy is now a context manager.
  29179. - bpo-19165: The formatter module now raises DeprecationWarning instead of
  29180. PendingDeprecationWarning.
  29181. - bpo-13936: Remove the ability of datetime.time instances to be considered
  29182. false in boolean contexts.
  29183. - bpo-18931: selectors module now supports /dev/poll on Solaris. Patch by
  29184. Giampaolo Rodola'.
  29185. - bpo-19977: When the ``LC_TYPE`` locale is the POSIX locale (``C`` locale),
  29186. :py:data:`sys.stdin` and :py:data:`sys.stdout` are now using the
  29187. ``surrogateescape`` error handler, instead of the ``strict`` error
  29188. handler.
  29189. - bpo-20574: Implement incremental decoder for cp65001 code (Windows code
  29190. page 65001, Microsoft UTF-8).
  29191. - bpo-20879: Delay the initialization of encoding and decoding tables for
  29192. base32, ascii85 and base85 codecs in the base64 module, and delay the
  29193. initialization of the unquote_to_bytes() table of the urllib.parse module,
  29194. to not waste memory if these modules are not used.
  29195. - bpo-19157: Include the broadcast address in the usuable hosts for IPv6 in
  29196. ipaddress.
  29197. - bpo-11599: When an external command (e.g. compiler) fails, distutils now
  29198. prints out the whole command line (instead of just the command name) if
  29199. the environment variable DISTUTILS_DEBUG is set.
  29200. - bpo-4931: distutils should not produce unhelpful "error: None" messages
  29201. anymore. distutils.util.grok_environment_error is kept but doc-deprecated.
  29202. - bpo-20875: Prevent possible gzip "'read' is not defined" NameError. Patch
  29203. by Claudiu Popa.
  29204. - bpo-11558: ``email.message.Message.attach`` now returns a more useful
  29205. error message if ``attach`` is called on a message for which
  29206. ``is_multipart`` is False.
  29207. - bpo-20283: RE pattern methods now accept the string keyword parameters as
  29208. documented. The pattern and source keyword parameters are left as
  29209. deprecated aliases.
  29210. - bpo-20778: Fix modulefinder to work with bytecode-only modules.
  29211. - bpo-20791: copy.copy() now doesn't make a copy when the input is a bytes
  29212. object. Initial patch by Peter Otten.
  29213. - bpo-19748: On AIX, time.mktime() now raises an OverflowError for year
  29214. outsize range [1902; 2037].
  29215. - bpo-19573: inspect.signature: Use enum for parameter kind constants.
  29216. - bpo-20726: inspect.signature: Make Signature and Parameter picklable.
  29217. - bpo-17373: Add inspect.Signature.from_callable method.
  29218. - bpo-20378: Improve repr of inspect.Signature and inspect.Parameter.
  29219. - bpo-20816: Fix inspect.getcallargs() to raise correct TypeError for
  29220. missing keyword-only arguments. Patch by Jeremiah Lowin.
  29221. - bpo-20817: Fix inspect.getcallargs() to fail correctly if more than 3
  29222. arguments are missing. Patch by Jeremiah Lowin.
  29223. - bpo-6676: Ensure a meaningful exception is raised when attempting to parse
  29224. more than one XML document per pyexpat xmlparser instance. (Original
  29225. patches by Hirokazu Yamamoto and Amaury Forgeot d'Arc, with suggested
  29226. wording by David Gutteridge)
  29227. - bpo-21117: Fix inspect.signature to better support functools.partial. Due
  29228. to the specifics of functools.partial implementation,
  29229. positional-or-keyword arguments passed as keyword arguments become
  29230. keyword-only.
  29231. - bpo-20334: inspect.Signature and inspect.Parameter are now hashable.
  29232. Thanks to Antony Lee for bug reports and suggestions.
  29233. - bpo-15916: doctest.DocTestSuite returns an empty unittest.TestSuite
  29234. instead of raising ValueError if it finds no tests
  29235. - bpo-21209: Fix asyncio.tasks.CoroWrapper to workaround a bug in yield-from
  29236. implementation in CPythons prior to 3.4.1.
  29237. - asyncio: Add gi_{frame,running,code} properties to CoroWrapper (upstream
  29238. issue #163).
  29239. - bpo-21311: Avoid exception in _osx_support with non-standard compiler
  29240. configurations. Patch by John Szakmeister.
  29241. - bpo-11571: Ensure that the turtle window becomes the topmost window when
  29242. launched on OS X.
  29243. - bpo-21801: Validate that __signature__ is None or an instance of
  29244. Signature.
  29245. - bpo-21923: Prevent AttributeError in
  29246. distutils.sysconfig.customize_compiler due to possible uninitialized
  29247. _config_vars.
  29248. - bpo-21323: Fix http.server to again handle scripts in CGI subdirectories,
  29249. broken by the fix for security issue #19435. Patch by Zach Byrne.
  29250. - bpo-22733: Fix ffi_prep_args not zero-extending argument values correctly
  29251. on 64-bit Windows.
  29252. - bpo-23302: Default to TCP_NODELAY=1 upon establishing an HTTPConnection.
  29253. Removed use of hard-coded MSS as it's an optimization that's no longer
  29254. needed with Nagle disabled.
  29255. IDLE
  29256. ----
  29257. - bpo-20577: Configuration of the max line length for the FormatParagraph
  29258. extension has been moved from the General tab of the Idle preferences
  29259. dialog to the FormatParagraph tab of the Config Extensions dialog. Patch
  29260. by Tal Einat.
  29261. - bpo-16893: Update Idle doc chapter to match current Idle and add new
  29262. information.
  29263. - bpo-3068: Add Idle extension configuration dialog to Options menu. Changes
  29264. are written to HOME/.idlerc/config-extensions.cfg. Original patch by Tal
  29265. Einat.
  29266. - bpo-16233: A module browser (File : Class Browser, Alt+C) requires an
  29267. editor window with a filename. When Class Browser is requested otherwise,
  29268. from a shell, output window, or 'Untitled' editor, Idle no longer displays
  29269. an error box. It now pops up an Open Module box (Alt+M). If a valid name
  29270. is entered and a module is opened, a corresponding browser is also opened.
  29271. - bpo-4832: Save As to type Python files automatically adds .py to the name
  29272. you enter (even if your system does not display it). Some systems
  29273. automatically add .txt when type is Text files.
  29274. - bpo-21986: Code objects are not normally pickled by the pickle module. To
  29275. match this, they are no longer pickled when running under Idle.
  29276. - bpo-17390: Adjust Editor window title; remove 'Python', move version to
  29277. end.
  29278. - bpo-14105: Idle debugger breakpoints no longer disappear when inserting or
  29279. deleting lines.
  29280. - bpo-17172: Turtledemo can now be run from Idle. Currently, the entry is on
  29281. the Help menu, but it may move to Run. Patch by Ramchandra Apt and Lita
  29282. Cho.
  29283. - bpo-21765: Add support for non-ascii identifiers to HyperParser.
  29284. - bpo-21940: Add unittest for WidgetRedirector. Initial patch by Saimadhav
  29285. Heblikar.
  29286. - bpo-18592: Add unittest for SearchDialogBase. Patch by Phil Webster.
  29287. - bpo-21694: Add unittest for ParenMatch. Patch by Saimadhav Heblikar.
  29288. - bpo-21686: add unittest for HyperParser. Original patch by Saimadhav
  29289. Heblikar.
  29290. - bpo-12387: Add missing upper(lower)case versions of default Windows key
  29291. bindings for Idle so Caps Lock does not disable them. Patch by Roger
  29292. Serwy.
  29293. - bpo-21695: Closing a Find-in-files output window while the search is still
  29294. in progress no longer closes Idle.
  29295. - bpo-18910: Add unittest for textView. Patch by Phil Webster.
  29296. - bpo-18292: Add unittest for AutoExpand. Patch by Saihadhav Heblikar.
  29297. - bpo-18409: Add unittest for AutoComplete. Patch by Phil Webster.
  29298. - bpo-21477: htest.py - Improve framework, complete set of tests. Patches by
  29299. Saimadhav Heblikar
  29300. - bpo-18104: Add idlelib/idle_test/htest.py with a few sample tests to begin
  29301. consolidating and improving human-validated tests of Idle. Change other
  29302. files as needed to work with htest. Running the module as __main__ runs
  29303. all tests.
  29304. - bpo-21139: Change default paragraph width to 72, the :pep:`8`
  29305. recommendation.
  29306. - bpo-21284: Paragraph reformat test passes after user changes reformat
  29307. width.
  29308. - bpo-17654: Ensure IDLE menus are customized properly on OS X for
  29309. non-framework builds and for all variants of Tk.
  29310. - bpo-23180: Rename IDLE "Windows" menu item to "Window". Patch by Al
  29311. Sweigart.
  29312. Build
  29313. -----
  29314. - bpo-15506: Use standard PKG_PROG_PKG_CONFIG autoconf macro in the
  29315. configure script.
  29316. - bpo-22935: Allow the ssl module to be compiled if openssl doesn't support
  29317. SSL 3.
  29318. - bpo-22592: Drop support of the Borland C compiler to build Python. The
  29319. distutils module still supports it to build extensions.
  29320. - bpo-22591: Drop support of MS-DOS, especially of the DJGPP compiler
  29321. (MS-DOS port of GCC).
  29322. - bpo-16537: Check whether self.extensions is empty in setup.py. Patch by
  29323. Jonathan Hosmer.
  29324. - bpo-22359: Remove incorrect uses of recursive make. Patch by Jonas
  29325. Wagner.
  29326. - bpo-21958: Define HAVE_ROUND when building with Visual Studio 2013 and
  29327. above. Patch by Zachary Turner.
  29328. - bpo-18093: the programs that embed the CPython runtime are now in a
  29329. separate "Programs" directory, rather than being kept in the Modules
  29330. directory.
  29331. - bpo-15759: "make suspicious", "make linkcheck" and "make doctest" in Doc/
  29332. now display special message when and only when there are failures.
  29333. - bpo-21141: The Windows build process no longer attempts to find Perl,
  29334. instead relying on OpenSSL source being configured and ready to build.
  29335. The ``PCbuild\build_ssl.py`` script has been re-written and re-named to
  29336. ``PCbuild\prepare_ssl.py``, and takes care of configuring OpenSSL source
  29337. for both 32 and 64 bit platforms. OpenSSL sources obtained from
  29338. svn.python.org will always be pre-configured and ready to build.
  29339. - bpo-21037: Add a build option to enable AddressSanitizer support.
  29340. - bpo-19962: The Windows build process now creates "python.bat" in the root
  29341. of the source tree, which passes all arguments through to the most
  29342. recently built interpreter.
  29343. - bpo-21285: Refactor and fix curses configure check to always search in a
  29344. ncursesw directory.
  29345. - bpo-15234: For BerkeleyDB and Sqlite, only add the found library and
  29346. include directories if they aren't already being searched. This avoids an
  29347. explicit runtime library dependency.
  29348. - bpo-17861: Tools/scripts/generate_opcode_h.py automatically regenerates
  29349. Include/opcode.h from Lib/opcode.py if the latter gets any change.
  29350. - bpo-20644: OS X installer build support for documentation build changes in
  29351. 3.4.1: assume externally supplied sphinx-build is available in /usr/bin.
  29352. - bpo-20022: Eliminate use of deprecated bundlebuilder in OS X builds.
  29353. - bpo-15968: Incorporated Tcl, Tk, and Tix builds into the Windows build
  29354. solution.
  29355. - bpo-17095: Fix Modules/Setup *shared* support.
  29356. - bpo-21811: Anticipated fixes to support OS X versions > 10.9.
  29357. - bpo-21166: Prevent possible segfaults and other random failures of python
  29358. --generate-posix-vars in pybuilddir.txt build target.
  29359. - bpo-18096: Fix library order returned by python-config.
  29360. - bpo-17219: Add library build dir for Python extension cross-builds.
  29361. - bpo-22919: Windows build updated to support VC 14.0 (Visual Studio 2015),
  29362. which will be used for the official release.
  29363. - bpo-21236: Build _msi.pyd with cabinet.lib instead of fci.lib
  29364. - bpo-17128: Use private version of OpenSSL for OS X 10.5+ installer.
  29365. C API
  29366. -----
  29367. - bpo-14203: Remove obsolete support for view==NULL in PyBuffer_FillInfo(),
  29368. bytearray_getbuffer(), bytesiobuf_getbuffer() and array_buffer_getbuf().
  29369. All functions now raise BufferError in that case.
  29370. - bpo-22445: PyBuffer_IsContiguous() now implements precise contiguity
  29371. tests, compatible with NumPy's NPY_RELAXED_STRIDES_CHECKING compilation
  29372. flag. Previously the function reported false negatives for corner cases.
  29373. - bpo-22079: PyType_Ready() now checks that statically allocated type has no
  29374. dynamically allocated bases.
  29375. - bpo-22453: Removed non-documented macro PyObject_REPR().
  29376. - bpo-18395: Rename ``_Py_char2wchar()`` to :c:func:`Py_DecodeLocale`,
  29377. rename ``_Py_wchar2char()`` to :c:func:`Py_EncodeLocale`, and document
  29378. these functions.
  29379. - bpo-21233: Add new C functions: PyMem_RawCalloc(), PyMem_Calloc(),
  29380. PyObject_Calloc(), _PyObject_GC_Calloc(). bytes(int) is now using
  29381. ``calloc()`` instead of ``malloc()`` for large objects which is faster and
  29382. use less memory.
  29383. - bpo-20942: PyImport_ImportFrozenModuleObject() no longer sets __file__ to
  29384. match what importlib does; this affects _frozen_importlib as well as any
  29385. module loaded using imp.init_frozen().
  29386. Documentation
  29387. -------------
  29388. - bpo-19548: Update the codecs module documentation to better cover the
  29389. distinction between text encodings and other codecs, together with other
  29390. clarifications. Patch by Martin Panter.
  29391. - bpo-22394: Doc/Makefile now supports ``make venv PYTHON=../python`` to
  29392. create a venv for generating the documentation, e.g., ``make html
  29393. PYTHON=venv/bin/python3``.
  29394. - bpo-21514: The documentation of the json module now refers to new JSON RFC
  29395. 7159 instead of obsoleted RFC 4627.
  29396. - bpo-21777: The binary sequence methods on bytes and bytearray are now
  29397. documented explicitly, rather than assuming users will be able to derive
  29398. the expected behaviour from the behaviour of the corresponding str
  29399. methods.
  29400. - bpo-6916: undocument deprecated asynchat.fifo class.
  29401. - bpo-17386: Expanded functionality of the ``Doc/make.bat`` script to make
  29402. it much more comparable to ``Doc/Makefile``.
  29403. - bpo-21312: Update the thread_foobar.h template file to include newer
  29404. threading APIs. Patch by Jack McCracken.
  29405. - bpo-21043: Remove the recommendation for specific CA organizations and to
  29406. mention the ability to load the OS certificates.
  29407. - bpo-20765: Add missing documentation for PurePath.with_name() and
  29408. PurePath.with_suffix().
  29409. - bpo-19407: New package installation and distribution guides based on the
  29410. Python Packaging Authority tools. Existing guides have been retained as
  29411. legacy links from the distutils docs, as they still contain some required
  29412. reference material for tool developers that isn't recorded anywhere else.
  29413. - bpo-19697: Document cases where __main__.__spec__ is None.
  29414. Tests
  29415. -----
  29416. - bpo-18982: Add tests for CLI of the calendar module.
  29417. - bpo-19548: Added some additional checks to test_codecs to ensure that
  29418. statements in the updated documentation remain accurate. Patch by Martin
  29419. Panter.
  29420. - bpo-22838: All test_re tests now work with unittest test discovery.
  29421. - bpo-22173: Update lib2to3 tests to use unittest test discovery.
  29422. - bpo-16000: Convert test_curses to use unittest.
  29423. - bpo-21456: Skip two tests in test_urllib2net.py if _ssl module not
  29424. present. Patch by Remi Pointel.
  29425. - bpo-20746: Fix test_pdb to run in refleak mode (-R). Patch by Xavier de
  29426. Gaye.
  29427. - bpo-22060: test_ctypes has been somewhat cleaned up and simplified; it now
  29428. uses unittest test discovery to find its tests.
  29429. - bpo-22104: regrtest.py no longer holds a reference to the suite of tests
  29430. loaded from test modules that don't define test_main().
  29431. - bpo-22111: Assorted cleanups in test_imaplib. Patch by Milan Oberkirch.
  29432. - bpo-22002: Added ``load_package_tests`` function to test.support and used
  29433. it to implement/augment test discovery in test_asyncio, test_email,
  29434. test_importlib, test_json, and test_tools.
  29435. - bpo-21976: Fix test_ssl to accept LibreSSL version strings. Thanks to
  29436. William Orr.
  29437. - bpo-21918: Converted test_tools from a module to a package containing
  29438. separate test files for each tested script.
  29439. - bpo-9554: Use modern unittest features in test_argparse. Initial patch by
  29440. Denver Coneybeare and Radu Voicilas.
  29441. - bpo-20155: Changed HTTP method names in failing tests in test_httpservers
  29442. so that packet filtering software (specifically Windows Base Filtering
  29443. Engine) does not interfere with the transaction semantics expected by the
  29444. tests.
  29445. - bpo-19493: Refactored the ctypes test package to skip tests explicitly
  29446. rather than silently.
  29447. - bpo-18492: All resources are now allowed when tests are not run by
  29448. regrtest.py.
  29449. - bpo-21634: Fix pystone micro-benchmark: use floor division instead of true
  29450. division to benchmark integers instead of floating point numbers. Set
  29451. pystone version to 1.2. Patch written by Lennart Regebro.
  29452. - bpo-21605: Added tests for Tkinter images.
  29453. - bpo-21493: Added test for ntpath.expanduser(). Original patch by Claudiu
  29454. Popa.
  29455. - bpo-19925: Added tests for the spwd module. Original patch by Vajrasky
  29456. Kok.
  29457. - bpo-21522: Added Tkinter tests for Listbox.itemconfigure(),
  29458. PanedWindow.paneconfigure(), and Menu.entryconfigure().
  29459. - bpo-17756: Fix test_code test when run from the installed location.
  29460. - bpo-17752: Fix distutils tests when run from the installed location.
  29461. - bpo-18604: Consolidated checks for GUI availability. All platforms now at
  29462. least check whether Tk can be instantiated when the GUI resource is
  29463. requested.
  29464. - bpo-21275: Fix a socket test on KFreeBSD.
  29465. - bpo-21223: Pass test_site/test_startup_imports when some of the extensions
  29466. are built as builtins.
  29467. - bpo-20635: Added tests for Tk geometry managers.
  29468. - Add test case for freeze.
  29469. - bpo-20743: Fix a reference leak in test_tcl.
  29470. - bpo-21097: Move test_namespace_pkgs into test_importlib.
  29471. - bpo-21503: Use test_both() consistently in test_importlib.
  29472. - bpo-20939: Avoid various network test failures due to new redirect of
  29473. http://www.python.org/ to https://www.python.org: use
  29474. http://www.example.com instead.
  29475. - bpo-20668: asyncio tests no longer rely on tests.txt file. (Patch by
  29476. Vajrasky Kok)
  29477. - bpo-21093: Prevent failures of ctypes test_macholib on OS X if a copy of
  29478. libz exists in $HOME/lib or /usr/local/lib.
  29479. - bpo-22770: Prevent some Tk segfaults on OS X when running gui tests.
  29480. - bpo-23211: Workaround test_logging failure on some OS X 10.6 systems.
  29481. - bpo-23345: Prevent test_ssl failures with large OpenSSL patch level values
  29482. (like 0.9.8zc).
  29483. Tools/Demos
  29484. -----------
  29485. - bpo-22314: pydoc now works when the LINES environment variable is set.
  29486. - bpo-22615: Argument Clinic now supports the "type" argument for the int
  29487. converter. This permits using the int converter with enums and typedefs.
  29488. - bpo-20076: The makelocalealias.py script no longer ignores UTF-8 mapping.
  29489. - bpo-20079: The makelocalealias.py script now can parse the SUPPORTED file
  29490. from glibc sources and supports command line options for source paths.
  29491. - bpo-22201: Command-line interface of the zipfile module now correctly
  29492. extracts ZIP files with directory entries. Patch by Ryan Wilson.
  29493. - bpo-22120: For functions using an unsigned integer return converter,
  29494. Argument Clinic now generates a cast to that type for the comparison to -1
  29495. in the generated code. (This suppresses a compilation warning.)
  29496. - bpo-18974: Tools/scripts/diff.py now uses argparse instead of optparse.
  29497. - bpo-21906: Make Tools/scripts/md5sum.py work in Python 3. Patch by Zachary
  29498. Ware.
  29499. - bpo-21629: Fix Argument Clinic's "--converters" feature.
  29500. - Add support for ``yield from`` to 2to3.
  29501. - Add support for the :pep:`465` matrix multiplication operator to 2to3.
  29502. - bpo-16047: Fix module exception list and __file__ handling in freeze.
  29503. Patch by Meador Inge.
  29504. - bpo-11824: Consider ABI tags in freeze. Patch by Meador Inge.
  29505. - bpo-20535: PYTHONWARNING no longer affects the run_tests.py script. Patch
  29506. by Arfrever Frehtes Taifersar Arahesis.
  29507. Windows
  29508. -------
  29509. - bpo-23260: Update Windows installer
  29510. - The bundled version of Tcl/Tk has been updated to 8.6.3. The most visible
  29511. result of this change is the addition of new native file dialogs when
  29512. running on Windows Vista or newer. See Tcl/Tk's TIP 432 for more
  29513. information. Also, this version of Tcl/Tk includes support for Windows
  29514. 10.
  29515. - bpo-17896: The Windows build scripts now expect external library sources
  29516. to be in ``PCbuild\..\externals`` rather than ``PCbuild\..\..``.
  29517. - bpo-17717: The Windows build scripts now use a copy of NASM pulled from
  29518. svn.python.org to build OpenSSL.
  29519. - bpo-21907: Improved the batch scripts provided for building Python.
  29520. - bpo-22644: The bundled version of OpenSSL has been updated to 1.0.1j.
  29521. - bpo-10747: Use versioned labels in the Windows start menu. Patch by Olive
  29522. Kilburn.
  29523. - bpo-22980: .pyd files with a version and platform tag (for example,
  29524. ".cp35-win32.pyd") will now be loaded in preference to those without tags.
  29525. **(For information about older versions, consult the HISTORY file.)**
上海开阖软件有限公司 沪ICP备12045867号-1