]> granicus.if.org Git - python/log
python
5 years agoPython 3.8.0b4 v3.8.0b4
Łukasz Langa [Thu, 29 Aug 2019 21:59:20 +0000 (23:59 +0200)]
Python 3.8.0b4

5 years ago[3.8] bpo-37834: Prevent shutil.rmtree exception (GH-15602) (#15603)
Łukasz Langa [Thu, 29 Aug 2019 21:51:19 +0000 (23:51 +0200)]
[3.8] bpo-37834: Prevent shutil.rmtree exception (GH-15602) (#15603)

when built on non-Windows system without fd system call support,
like older versions of macOS.
(cherry picked from commit 7fcc2088a50a4ecb80e5644cd195bee209c9f979)

Co-authored-by: Ned Deily <nad@python.org>
5 years ago[3.8] bpo-37034: Display argument name on errors with keyword arguments with Argument...
Serhiy Storchaka [Thu, 29 Aug 2019 15:29:59 +0000 (18:29 +0300)]
[3.8] bpo-37034: Display argument name on errors with keyword arguments with Argument Clinic. (GH-13593). (GH-15599)

(cherry picked from commit 4901fe274bc82b95dc89bcb3de8802a3dfedab32)

Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
5 years agobpo-37979: Add alternative to fromisoformat in documentation (GH-15596)
Miss Islington (bot) [Thu, 29 Aug 2019 14:54:37 +0000 (07:54 -0700)]
bpo-37979: Add alternative to fromisoformat in documentation (GH-15596)

Adds a link to `dateutil.parser.isoparse` in the documentation.

It would be nice to set up intersphinx for things like this, but I think we can leave that for a separate PR.

CC: @pitrou
[bpo-37979](https://bugs.python.org/issue37979)

https://bugs.python.org/issue37979

Automerge-Triggered-By: @pitrou
(cherry picked from commit 59725f3badb3028636c8906ecac4ceb0a37f3982)

Co-authored-by: Paul Ganssle <paul@ganssle.io>
5 years agobpo-37947: Avoid double-decrement in symtable recursion counting (GH-15593)
Miss Islington (bot) [Thu, 29 Aug 2019 13:46:20 +0000 (06:46 -0700)]
bpo-37947: Avoid double-decrement in symtable recursion counting (GH-15593)

With `symtable_visit_expr` now correctly adjusting the recursion depth for named
expressions, `symtable_handle_namedexpr` should be leaving it alone.

Also adds a new check to `PySymtable_BuildObject` that raises `SystemError`
if a successful first symbol analysis pass fails to keep the stack depth
accounting clean.
(cherry picked from commit 06145230c833c3db5dab8858e11bcd550a37c57f)

Co-authored-by: Nick Coghlan <ncoghlan@gmail.com>
5 years agobpo-36743: __get__ is sometimes called without the owner argument (GH-12992) (GH...
Miss Islington (bot) [Thu, 29 Aug 2019 09:02:51 +0000 (02:02 -0700)]
bpo-36743: __get__ is sometimes called without the owner argument (GH-12992) (GH-15589)

(cherry picked from commit 0dac68f1e593c11612ed54af9edb865d398f3b05)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
5 years agobpo-16468: Clarify which objects can be passed to "choices" in argparse (GH-15566...
Miss Islington (bot) [Thu, 29 Aug 2019 08:15:18 +0000 (01:15 -0700)]
bpo-16468: Clarify which objects can be passed to "choices" in argparse (GH-15566) (GH-15587)

(cherry picked from commit 84125fed2a45a9e454d7e870d8bbaf6ece3d41e8)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
5 years agobpo-37960: Silence only necessary errors in repr() of buffered and text streams....
Miss Islington (bot) [Thu, 29 Aug 2019 08:13:29 +0000 (01:13 -0700)]
bpo-37960: Silence only necessary errors in repr() of buffered and text streams. (GH-15543)

(cherry picked from commit b235a1b47394eedc5f8ea4cf214f56c4c6932e59)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
5 years agobpo-23674: Clarify ambiguities in super() docs (GH-15564) (GH-15586)
Miss Islington (bot) [Thu, 29 Aug 2019 08:02:58 +0000 (01:02 -0700)]
bpo-23674:  Clarify ambiguities in super() docs (GH-15564) (GH-15586)

(cherry picked from commit cd81f0500fe98c7f4cddb06530fffabd14f036b8)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
5 years agobpo-37372: Fix error unpickling datetime.time objects from Python 2 with seconds...
Miss Islington (bot) [Thu, 29 Aug 2019 07:56:04 +0000 (00:56 -0700)]
bpo-37372: Fix error unpickling datetime.time objects from Python 2 with seconds>=24. (GH-14307)

(cherry picked from commit 122376df550b71dd3bec0513c7483cc1714212fa)

Co-authored-by: Justin Blanchard <UncombedCoconut@gmail.com>
5 years ago[3.8] bpo-37950: Fix ast.dump() when call with incompletely initialized node. (GH...
Serhiy Storchaka [Thu, 29 Aug 2019 07:50:28 +0000 (10:50 +0300)]
[3.8] bpo-37950: Fix ast.dump() when call with incompletely initialized node. (GH-15510) (GH-15582)

(cherry picked from commit e64f948e762a6b9fd02e2902ccf42438df6fcb61)

5 years agobpo-36871: Ensure method signature is used when asserting mock calls to a method...
Miss Islington (bot) [Thu, 29 Aug 2019 06:58:27 +0000 (23:58 -0700)]
bpo-36871: Ensure method signature is used when asserting mock calls to a method (GH15578)

* Fix call_matcher for mock when using methods

* Add NEWS entry

* Use None check and convert doctest to unittest

* Use better name for mock in tests. Handle _SpecState when the attribute was not accessed and add tests.

* Use reset_mock instead of reinitialization. Change inner class constructor signature for check

* Reword comment regarding call object lookup logic
(cherry picked from commit c96127821ebda50760e788b1213975a0d5bea37f)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
5 years agobpo-35946: Improve assert_called_with documentation (GH-11796)
Miss Islington (bot) [Thu, 29 Aug 2019 06:39:47 +0000 (23:39 -0700)]
bpo-35946: Improve assert_called_with documentation (GH-11796)

(cherry picked from commit f5896a05edf5df91fb1b55bd481ba5b2a3682f4e)

Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
5 years agobpo-25777: Wording describes a lookup, not a call (GH-15573) (GH-15576)
Miss Islington (bot) [Thu, 29 Aug 2019 06:12:13 +0000 (23:12 -0700)]
bpo-25777: Wording describes a lookup, not a call (GH-15573) (GH-15576)

(cherry picked from commit 03acba6f1a851064ba1fa78965ece4354d499c04)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
5 years agobpo-36167: fix an incorrect capitalization (GH-14482)
Miss Islington (bot) [Thu, 29 Aug 2019 05:47:42 +0000 (22:47 -0700)]
bpo-36167: fix an incorrect capitalization (GH-14482)

(cherry picked from commit 3aa48b88c7485aca1fdfa54b3d8e53931ff067fd)

Co-authored-by: avinassh <avinassh@users.noreply.github.com>
5 years agobpo-18049: Define THREAD_STACK_SIZE for AIX to pass default recursion limit test...
Miss Islington (bot) [Thu, 29 Aug 2019 05:35:41 +0000 (22:35 -0700)]
bpo-18049: Define THREAD_STACK_SIZE for AIX to pass default recursion limit test (GH-15081)

* Define THREAD_STACK_SIZE for AIX to pass default recursion limit test
(cherry picked from commit 9670ce76b83bde950020f8d89c4d27168aaaf912)

Co-authored-by: Michael Felt <aixtools@users.noreply.github.com>
5 years agobpo-36511: Fix failures in Windows ARM32 buildbot (GH-15181)
Miss Islington (bot) [Thu, 29 Aug 2019 05:18:15 +0000 (22:18 -0700)]
bpo-36511: Fix failures in Windows ARM32 buildbot (GH-15181)

(cherry picked from commit ed70a344b5fbddea85726ebc1964ee0cfdef9c40)

Co-authored-by: Paul Monson <paulmon@users.noreply.github.com>
5 years agobpo-34775: Return NotImplemented in PurePath division. (GH-9509) (GH-15172)
Miss Islington (bot) [Thu, 29 Aug 2019 05:05:59 +0000 (22:05 -0700)]
bpo-34775: Return NotImplemented in PurePath division. (GH-9509) (GH-15172)

(cherry picked from commit 4c69be22df3852f17873a74d015528d9a8ae92d6)

Co-authored-by: aiudirog <aiudirog@gmail.com>
5 years agobpo-18378: Recognize "UTF-8" as a valid name in locale._parse_localename (GH-14736)
Miss Islington (bot) [Thu, 29 Aug 2019 04:56:00 +0000 (21:56 -0700)]
bpo-18378: Recognize "UTF-8" as a valid name in locale._parse_localename (GH-14736)

(cherry picked from commit b0caf329815120acf50287e29858093d328b0e3c)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
5 years ago[3.8] bpo-37482: Fix email address name with encoded words and special chars (GH...
bsiem [Thu, 29 Aug 2019 04:47:15 +0000 (06:47 +0200)]
[3.8] bpo-37482: Fix email address name with encoded words and special chars (GH-14561) (GH-15380)

Special characters in email address header display names are normally
put within double quotes. However, encoded words (=?charset?x?...?=) are
not allowed withing double quotes. When the header contains a word with
special characters and another word that must be encoded, the first one
must also be encoded.

In the next example, the display name in the From header is quoted and
therefore the comma is allowed; in the To header, the comma is not
within quotes and not encoded, which is not allowed and therefore
rejected by some mail servers.

From: "Foo Bar, France" <foo@example.com>
To: Foo Bar, =?utf-8?q?Espa=C3=B1a?= <foo@example.com>

https://bugs.python.org/issue37482
(cherry picked from commit df0c21ff46c5c37b6913828ef8c7651f523432f8)

Co-authored-by: bsiem <52461103+bsiem@users.noreply.github.com>
5 years agocloses bpo-37965: Fix compiler warning of distutils CCompiler.test_function. (GH...
Miss Islington (bot) [Wed, 28 Aug 2019 17:32:34 +0000 (10:32 -0700)]
closes bpo-37965: Fix compiler warning of distutils CCompiler.test_function. (GH-15561)

https://bugs.python.org/issue37965

https://bugs.python.org/issue37965

Automerge-Triggered-By: @benjaminp
(cherry picked from commit 55aabee07501e1468082b3237620e4ecd75c5da6)

Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
5 years agobpo-36582: Make collections.UserString.encode() return bytes, not str (GH-13138)...
Miss Islington (bot) [Wed, 28 Aug 2019 04:59:54 +0000 (21:59 -0700)]
bpo-36582: Make collections.UserString.encode() return bytes, not str (GH-13138) (GH-15557)

(cherry picked from commit 2a16eea71f56c2d8f38c295c8ce71a9a9a140aff)

Co-authored-by: Daniel Fortunov <asqui@users.noreply.github.com>
5 years agobpo-37951: Lift subprocess's fork() restriction (GH-15544)
Miss Islington (bot) [Tue, 27 Aug 2019 21:56:27 +0000 (14:56 -0700)]
bpo-37951: Lift subprocess's fork() restriction (GH-15544)

(cherry picked from commit 98d90f745d35d5d07bffcb46788b50e05eea56c6)

Co-authored-by: Christian Heimes <christian@python.org>
5 years agobpo-37936: Remove some .gitignore rules that were intended locally. (GH-15542)
Miss Islington (bot) [Tue, 27 Aug 2019 18:35:11 +0000 (11:35 -0700)]
bpo-37936: Remove some .gitignore rules that were intended locally. (GH-15542)

These appeared in commit c5ae169e1.  The comment on them, as well as
the presence among them of a rule for the .gitignore file itself,
indicate that the author intended these lines to remain only in their
own local working tree -- not to get committed even to their own repo,
let alone merged upstream.

They did nevertheless get committed, because it turns out that Git
takes no notice of what .gitignore says about files that it's already
tracking... for example, this .gitignore file itself.

Give effect to these lines' original intention, by deleting them. :-)

Git tip, for reference: the `.git/info/exclude` file is a handy way
to do exactly what these lines were originally intended to do.  A
related handy file is `~/.config/git/ignore`.  See gitignore(5),
aka `git help ignore`, for details.

https://bugs.python.org/issue37936

Automerge-Triggered-By: @zware
(cherry picked from commit 8c9e9b0cd5b24dfbf1424d1f253d02de80e8f5ef)

Co-authored-by: Greg Price <gnprice@gmail.com>
5 years agoFix unused variable and signed/unsigned warnings (GH-15537) (GH-15551)
Miss Islington (bot) [Tue, 27 Aug 2019 17:13:52 +0000 (10:13 -0700)]
Fix unused variable and signed/unsigned warnings (GH-15537) (GH-15551)

(cherry picked from commit 0138c4ceab1e10d42d0aa962d2ae079b46da7671)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
5 years agobpo-36205: Fix the rusage implementation of time.process_time() (GH-15538)
Miss Islington (bot) [Tue, 27 Aug 2019 04:34:32 +0000 (21:34 -0700)]
bpo-36205: Fix the rusage implementation of time.process_time() (GH-15538)

(cherry picked from commit 8bf5fef8737fdd12724b9340d76a4ed391c4ad8a)

Co-authored-by: vrajivk <3413293+vrajivk@users.noreply.github.com>
5 years agobpo-36763: Make Py_BytesMain() public (GH-15532)
Miss Islington (bot) [Mon, 26 Aug 2019 23:17:56 +0000 (16:17 -0700)]
bpo-36763: Make Py_BytesMain() public (GH-15532)

Declare Py_BytesMain() in Include/pylifecycle.h, rather in
Include/internal/pycore_pylifecycle.h.
(cherry picked from commit 9a943b4ce13fac26873b8100e89c818c5c47ac4b)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
5 years agoFix an invalid assertEqual() call in test_descr.py (GH-15318)
Miss Islington (bot) [Mon, 26 Aug 2019 23:02:21 +0000 (16:02 -0700)]
Fix an invalid assertEqual() call in test_descr.py (GH-15318)

(cherry picked from commit 6b2e3256b6752055498f41f343fb22100845bc9d)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
5 years agobpo-37925: Mention --embed in python-config usage (GH-15458)
Miss Islington (bot) [Mon, 26 Aug 2019 21:55:31 +0000 (14:55 -0700)]
bpo-37925: Mention --embed in python-config usage (GH-15458)

(cherry picked from commit d3cc189b17c86f670198aca109b5ffa2d526d87a)

Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
5 years agobpo-37664: Update ensurepip bundled wheels, again (GH-15483)
Steve Dower [Mon, 26 Aug 2019 19:57:57 +0000 (12:57 -0700)]
bpo-37664: Update ensurepip bundled wheels, again (GH-15483)

5 years agobpo-37798: Minor code formatting and comment clean-ups. (GH-15526) (GH-15527)
Miss Islington (bot) [Mon, 26 Aug 2019 19:10:00 +0000 (12:10 -0700)]
bpo-37798: Minor code formatting and comment clean-ups. (GH-15526) (GH-15527)

(cherry picked from commit 6fee0f8ea72fa68155a32b33b6c0ed9e5a740e45)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
5 years agobpo-37055: fix warnings in _blake2 module (GH-14646)
Miss Islington (bot) [Mon, 26 Aug 2019 18:23:55 +0000 (11:23 -0700)]
bpo-37055: fix warnings in _blake2 module (GH-14646)

https://bugs.python.org/issue37055

Automerge-Triggered-By: @tiran
(cherry picked from commit b27cbec801e17a13d7fef49116a8fc279930d2b1)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
5 years agoFix typo: Pyssize_t => Py_ssize_t (GH-15411)
Miss Islington (bot) [Mon, 26 Aug 2019 15:54:26 +0000 (08:54 -0700)]
Fix typo: Pyssize_t => Py_ssize_t (GH-15411)

(cherry picked from commit b3b9619f5e1e7ebe3fbb73eae4ec878312056a90)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
5 years agobpo-37954: Fix reference leak in the symtable (GH-15514)
Miss Islington (bot) [Mon, 26 Aug 2019 15:49:44 +0000 (08:49 -0700)]
bpo-37954: Fix reference leak in the symtable (GH-15514)

(cherry picked from commit 4901dc46da5ecb131f8d902a0fbd704934f209e1)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
5 years agoRemove leftovers from the times when long long wasn't required (GH-15501)
Miss Islington (bot) [Mon, 26 Aug 2019 15:33:49 +0000 (08:33 -0700)]
Remove leftovers from the times when long long wasn't required (GH-15501)

In a38e9d139929a227e3899fbb638bc46c6cc6d8ba pyconfig.h.in was
manually edited and that edit was overwritten when running autoreconf.
(cherry picked from commit 52c1a6a15a471f75b775309ed1120d05f69010ca)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
5 years ago[3.8] bpo-37947: Adjust correctly the recursion level in symtable for named expressio...
Pablo Galindo [Mon, 26 Aug 2019 15:27:31 +0000 (16:27 +0100)]
[3.8] bpo-37947: Adjust correctly the recursion level in symtable for named expressions (GH-15499) (GH-15515)

(cherry picked from commit 0e4ea16336685cf3fa353d8c54af59b45b2d5c33)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
5 years agobpo-34679: Restore instantiation Windows IOCP event loop from non-main thread (GH...
Miss Islington (bot) [Mon, 26 Aug 2019 10:14:54 +0000 (03:14 -0700)]
bpo-34679: Restore instantiation Windows IOCP event loop from non-main thread (GH-15492)

* Restore running proactor event loop from non-main thread

Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
(cherry picked from commit 1c0600998681295735a18690fae184b0c9a4ca51)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
5 years ago[3.8] bpo-36917: Add default implementation of ast.NodeVisitor.visit_Constant()....
Miss Islington (bot) [Mon, 26 Aug 2019 07:43:33 +0000 (00:43 -0700)]
[3.8] bpo-36917: Add default implementation of ast.NodeVisitor.visit_Constant(). (GH-15490) (GH-15509)

It emits a deprecation warning and calls corresponding method
visit_Num(), visit_Str(), etc.
(cherry picked from commit c3ea41e9bf100a5396b851488c3efe208e5e2179)

5 years agobpo-37805: Add tests for json.dump(..., skipkeys=True) (GH-15489)
Miss Islington (bot) [Mon, 26 Aug 2019 07:27:31 +0000 (00:27 -0700)]
bpo-37805: Add tests for json.dump(..., skipkeys=True) (GH-15489)

https://bugs.python.org/issue37805

Automerge-Triggered-By: @methane
(cherry picked from commit 44cd86bbdddb1f7b05deba2c1986a1e98f992429)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
5 years agobpo-15542: Documentation incorrectly suggests __init__ called after direct __new__...
Miss Islington (bot) [Mon, 26 Aug 2019 07:19:17 +0000 (00:19 -0700)]
bpo-15542: Documentation incorrectly suggests __init__ called after direct  __new__ call (GH-15478) (GH-15506)

(cherry picked from commit 6b16d938d6d1ccb443815e20e8812deed274dc09)

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
5 years agobpo-37824: Properly handle user input warnings in IDLE shell. (GH-15500)
Miss Islington (bot) [Mon, 26 Aug 2019 06:52:45 +0000 (23:52 -0700)]
bpo-37824: Properly handle user input warnings in IDLE shell. (GH-15500)

Cease turning SyntaxWarnings into SyntaxErrors.
(cherry picked from commit 1039f39c9c6edb4c185856c19316d3a4eb561c38)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
5 years agoDoc: Keep the venv/* exclude pattern. (GH-15229)
Miss Islington (bot) [Mon, 26 Aug 2019 06:19:45 +0000 (23:19 -0700)]
Doc: Keep the venv/* exclude pattern. (GH-15229)

In case it has been previously created.
(cherry picked from commit 73e054970193fc421c533564a4189be522f9c331)

Co-authored-by: Julien Palard <julien@palard.fr>
5 years ago[3.8] bpo-37757: Disallow PEP 572 cases that expose implementation details (GH-15491)
Nick Coghlan [Sun, 25 Aug 2019 14:41:47 +0000 (00:41 +1000)]
[3.8] bpo-37757: Disallow PEP 572 cases that expose implementation details (GH-15491)

- drop TargetScopeError in favour of raising SyntaxError directly
  as per the updated PEP 572
- comprehension iteration variables are explicitly local, but
  named expression targets in comprehensions are nonlocal or
  global. Raise SyntaxError as specified in PEP 572
- named expression targets in the outermost iterable of a
  comprehension have an ambiguous target scope. Avoid resolving
  that question now by raising SyntaxError. PEP 572
  originally required this only for cases where the bound name
  conflicts with the iteration variable in the comprehension,
  but CPython can't easily restrict the exception to that case
  (as it doesn't know the target variable names when visiting
  the outermost iterator expression)

(cherry picked from commit 5dbe0f59b7a4f39c7c606b48056bc29e406ebf78)

5 years agobpo-37905: Improve docs for NormalDist (GH-15486) (GH-15487)
Miss Islington (bot) [Sun, 25 Aug 2019 08:04:24 +0000 (01:04 -0700)]
bpo-37905: Improve docs for NormalDist (GH-15486) (GH-15487)

(cherry picked from commit 8371799e300475c8f9f967e900816218d3500e5d)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
5 years agobpo-37929: IDLE: avoid Squeezer-related config dialog crashes (GH-15452)
Miss Islington (bot) [Sun, 25 Aug 2019 06:18:01 +0000 (23:18 -0700)]
bpo-37929: IDLE: avoid Squeezer-related config dialog crashes (GH-15452)

These were caused by keeping around a reference to the Squeezer
instance and calling it's load_font() upon config changes, which
sometimes happened even if the shell window no longer existed.

This change completely removes that mechanism, instead having the
editor window properly update its width attribute, which can then
be used by Squeezer.
(cherry picked from commit d4b4c00b57d24f6ee2cf3a96213406bb09953df3)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
5 years ago[3.8] bpo-37942: Improve argument clinic float converter (GH-15470) (GH-15480)
Raymond Hettinger [Sun, 25 Aug 2019 02:45:12 +0000 (19:45 -0700)]
[3.8] bpo-37942: Improve argument clinic float converter (GH-15470) (GH-15480)

(cherry picked from commit aef9ad82f7f667cd001a7112d3bc636e918626f7)

5 years agoFix typo and rearrange words in IDLE news item (GH-15471)
Miss Islington (bot) [Sat, 24 Aug 2019 21:42:16 +0000 (14:42 -0700)]
Fix typo and rearrange words in IDLE news item (GH-15471)

Redo of GH-15402 by GeeTransit and Kyle Stanley.
(cherry picked from commit 0dfc025cccc5adf4f209e2421c7686b1e637eeae)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
5 years ago[3.8] Clarify argument types in datetime docs. (GH-15459) (GH-15472)
Miss Islington (bot) [Sat, 24 Aug 2019 19:57:50 +0000 (12:57 -0700)]
[3.8] Clarify argument types in datetime docs. (GH-15459) (GH-15472)

"Arguments may be integers... " could be misunderstand as they also
could be strings.

New wording makes it clear that arguments have to be integers.

modified:   Doc/library/datetime.rst

Automerge-Triggered-By: @pganssle
(cherry picked from commit c5218fce02d6bd7bb343db20c8f14e8d9640783a)

Co-authored-by: Jürgen Gmach <juergen.gmach@googlemail.com>
Automerge-Triggered-By: @pganssle
5 years agobpo-14112: Allow beginners to explore shallowness in greater depth ;-) (GH-15465...
Miss Islington (bot) [Sat, 24 Aug 2019 18:33:18 +0000 (11:33 -0700)]
bpo-14112: Allow beginners to explore shallowness in greater depth ;-) (GH-15465) (GH-15469)

(cherry picked from commit 69ee87e99cfe0b79389cffa92d126af868baf353)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
5 years agobpo-37798: Test both Python and C versions in test_statistics.py (GH-15453) (GH-15467)
Miss Islington (bot) [Sat, 24 Aug 2019 18:14:20 +0000 (11:14 -0700)]
bpo-37798: Test both Python and C versions in test_statistics.py (GH-15453) (GH-15467)

(cherry picked from commit 8ad22a42267d4ecb1c080d420933680cc126363e)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
5 years agobpo-32118: Simplify docs for sequence comparison (GH-15450) (#15466)
Miss Islington (bot) [Sat, 24 Aug 2019 17:53:09 +0000 (10:53 -0700)]
bpo-32118:  Simplify docs for sequence comparison (GH-15450) (#15466)

(cherry picked from commit edd21129dd304e178ca8be82ba689488dfb58276)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
5 years agobpo-37772: fix zipfile.Path.iterdir() outputs (GH-15170) (#15461)
Miss Islington (bot) [Sat, 24 Aug 2019 16:03:52 +0000 (09:03 -0700)]
bpo-37772: fix zipfile.Path.iterdir() outputs (GH-15170) (#15461)

* fix Path._add_implied_dirs to include all implied directories

* fix Path._add_implied_dirs to include all implied directories

* Optimize code by using sets instead of lists

* 📜🤖 Added by blurb_it.

* fix Path._add_implied_dirs to include all implied directories

* Optimize code by using sets instead of lists

* 📜🤖 Added by blurb_it.

* Add tests to zipfile.Path.iterdir() fix

* Update test for zipfile.Path.iterdir()

* remove whitespace from test file

* Rewrite NEWS blurb to describe the user-facing impact and avoid implementation details.

* remove redundant [] within set comprehension

* Update to use unique_everseen to maintain order and other suggestions in review

* remove whitespace and add back add_dirs in tests

* Add new standalone function parents using posixpath to get parents of a directory

* removing whitespace (sorry)

* Remove import pathlib from zipfile.py

* Rewrite _parents as a slice on a generator of the ancestry of a path.

* Remove check for '.' and '/', now that parents no longer returns those.

* Separate calculation of implied dirs from adding those

* Re-use _implied_dirs in tests for generating zipfile with dir entries.

* Replace three fixtures (abcde, abcdef, abde) with one representative example alpharep.

* Simplify implementation of _implied_dirs by collapsing the generation of parent directories for each name.
(cherry picked from commit a4e2991bdc993b60b6457c8a38d6e4a1fc845781)

Co-authored-by: shireenrao <shireenrao@gmail.com>
5 years ago[3.8] bpo-37830: Fix compilation of break and continue in finally. (GH-15320) (GH...
Serhiy Storchaka [Sat, 24 Aug 2019 10:41:53 +0000 (13:41 +0300)]
[3.8] bpo-37830: Fix compilation of break and continue in finally. (GH-15320) (GH-15456)

Fix compilation of "break" and "continue" in the
"finally" block when the corresponding "try" block
contains "return" with a non-constant value.
(cherry picked from commit ef61c524ddeeb56da3858b86e349e7288d68178e)

5 years agobpo-28269: Replace strcasecmp with system function _stricmp. (GH-13095)
Miss Islington (bot) [Sat, 24 Aug 2019 10:22:14 +0000 (03:22 -0700)]
bpo-28269: Replace strcasecmp with system function _stricmp. (GH-13095)

(cherry picked from commit 05f2d84cae4ba1ff15b7a1d0347305393f4bdcc5)

Co-authored-by: Minmin Gong <gongminmin@msn.com>
5 years agobpo-29535: Remove promize about hash randomization of datetime objects. (GH-15269)
Miss Islington (bot) [Sat, 24 Aug 2019 10:19:51 +0000 (03:19 -0700)]
bpo-29535: Remove promize about hash randomization of datetime objects. (GH-15269)

(cherry picked from commit e9c90aa43144b0be1e4e393e8cb549573437a5da)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
5 years agobpo-19119: Remove invalid test and rename a misnamed test (GH-15442) (GH-15447)
Miss Islington (bot) [Sat, 24 Aug 2019 05:54:07 +0000 (22:54 -0700)]
bpo-19119: Remove invalid test and rename a misnamed test (GH-15442) (GH-15447)

(cherry picked from commit 4101181fd87c2fab6456663d3c8cc99377cf0463)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
5 years agoFix funny typo in Doc/bugs. (GH-15412)
Miss Islington (bot) [Sat, 24 Aug 2019 04:16:28 +0000 (21:16 -0700)]
Fix funny typo in  Doc/bugs. (GH-15412)

Fix typo in description of link to mozilla bug report writing guidelines.

Though the URL is misleading, we're indeed trying to write bug _reports_, not to add bugs.

Automerge-Triggered-By: @ned-deily
(cherry picked from commit e17f201cd9293f16593cc507d86f2c0e17b8f2c9)

Co-authored-by: Antoine <43954001+awecx@users.noreply.github.com>
5 years agobpo-37798: Add C fastpath for statistics.NormalDist.inv_cdf() (GH-15266) (GH-15441)
Miss Islington (bot) [Fri, 23 Aug 2019 22:39:27 +0000 (15:39 -0700)]
bpo-37798: Add C fastpath for statistics.NormalDist.inv_cdf() (GH-15266) (GH-15441)

(cherry picked from commit 0a18ee4be7ba215f414bef04598e0849504f9f1e)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
5 years agobpo-36763: PyConfig_Read() handles PySys_AddXOption() (GH-15431) (GH-15435)
Victor Stinner [Fri, 23 Aug 2019 19:16:51 +0000 (21:16 +0200)]
bpo-36763: PyConfig_Read() handles PySys_AddXOption() (GH-15431) (GH-15435)

PyConfig_Read() is now responsible to handle early calls to
PySys_AddXOption() and PySys_AddWarnOption().

Options added by PySys_AddXOption() are now handled the same way than
PyConfig.xoptions and command line -X options.

For example, PySys_AddXOption(L"faulthandler") enables faulthandler
as expected.

(cherry picked from commit 120b707a6d43452e067daa55a8fdca69f9424abc)

5 years agobpo-37549: os.dup() fails for standard streams on Windows 7 (GH-15389)
Miss Islington (bot) [Fri, 23 Aug 2019 19:04:27 +0000 (12:04 -0700)]
bpo-37549: os.dup() fails for standard streams on Windows 7 (GH-15389)

(cherry picked from commit 5be666010e4df65dc4d831435cc92340ea369f94)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
5 years agobpo-26589: Add http status code 451 (GH-15413) (GH-15436)
Miss Islington (bot) [Fri, 23 Aug 2019 17:56:44 +0000 (10:56 -0700)]
bpo-26589: Add http status code 451 (GH-15413) (GH-15436)

(cherry picked from commit 8f080b09953a2d862de5c74edf414a54ea3dbea5)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
5 years agobpo-36763, doc: Add links in the new C API init doc (GH-15433)
Miss Islington (bot) [Fri, 23 Aug 2019 17:05:59 +0000 (10:05 -0700)]
bpo-36763, doc: Add links in the new C API init doc (GH-15433)

(cherry picked from commit 1beb7c3de9c3d0e802e4267a11d937e8f024d661)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
5 years agobpo-36763: Implement PyWideStringList_Insert() of PEP 587 (GH-15423)
Miss Islington (bot) [Fri, 23 Aug 2019 16:24:42 +0000 (09:24 -0700)]
bpo-36763: Implement PyWideStringList_Insert() of PEP 587 (GH-15423)

(cherry picked from commit 3842f2997fbd4dc840986aad2bb94656815e243b)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
5 years ago[3.8] Fix typo (inifite -> infinite) (GH-15429)
GeeTransit [Fri, 23 Aug 2019 16:23:43 +0000 (12:23 -0400)]
[3.8] Fix typo (inifite -> infinite) (GH-15429)

The same typo exists in the changelogs of 3.6 and 3.7.

Automerge-Triggered-By: @Mariatta
5 years agoFix _PyTime_MIN/MAX values (GH-15384) (GH-15426)
Victor Stinner [Fri, 23 Aug 2019 16:17:52 +0000 (17:17 +0100)]
Fix _PyTime_MIN/MAX values (GH-15384) (GH-15426)

_PyTime_t type is defined as int64_t, and so min/max are INT64_MIN/INT64_MAX,
not PY_LLONG_MIN/PY_LLONG_MAX.

(cherry picked from commit 8e76c456226438f2e4931ce7baf05ac8faae34a1)

5 years agobpo-37926: Fix PySys_SetArgvEx(0, NULL, 0) crash (GH-15415) (GH-15420)
Victor Stinner [Fri, 23 Aug 2019 11:22:14 +0000 (12:22 +0100)]
bpo-37926: Fix PySys_SetArgvEx(0, NULL, 0) crash (GH-15415) (GH-15420)

empty_argv is no longer static in Python 3.8, but it is declared in
a temporary scope, whereas argv keeps a reference to it.
empty_argv memory (allocated on the stack) is reused by
make_sys_argv() code which is inlined when using gcc -O3.

Define empty_argv in PySys_SetArgvEx() body, to ensure
that it remains valid for the whole lifetime of
the PySys_SetArgvEx() call.

(cherry picked from commit c48682509dc49b43fe914fe6c502bc390345d1c2)

5 years agoCorrect minor grammar mistake (GH-15404)
Miss Islington (bot) [Fri, 23 Aug 2019 10:06:27 +0000 (03:06 -0700)]
Correct minor grammar mistake (GH-15404)

(cherry picked from commit d288b29fc652d27191bde3b3c9145c2eb8169929)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
5 years agobpo-37915: Fix comparison between tzinfo objects and timezone objects (GH-15390)
Miss Islington (bot) [Fri, 23 Aug 2019 08:48:40 +0000 (01:48 -0700)]
bpo-37915: Fix comparison between tzinfo objects and timezone objects (GH-15390)

https://bugs.python.org/issue37915

Automerge-Triggered-By: @pablogsal
(cherry picked from commit 4be11c009abe88175fa164b45e4838e7267dfa97)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
5 years agobpo-30826: Improve control flow examples (GH-15407) (GH-15410)
Miss Islington (bot) [Fri, 23 Aug 2019 06:52:12 +0000 (23:52 -0700)]
bpo-30826: Improve control flow examples (GH-15407) (GH-15410)

(cherry picked from commit 6fcb6cfb139ade1aac6dbee0b18ca72b18cbe0d2)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
5 years agobpo-12634: Clarify an awkward section of the tutorial (GH-15406) (GH-15409)
Miss Islington (bot) [Fri, 23 Aug 2019 06:45:57 +0000 (23:45 -0700)]
bpo-12634: Clarify an awkward section of the tutorial (GH-15406) (GH-15409)

(cherry picked from commit 483ae0cf1dcf46f8b71c4bf32419dd138e908553)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
5 years agobpo-30550: Clarify JSON ordering guarantees (GH-15397) (GH-15403)
Miss Islington (bot) [Thu, 22 Aug 2019 22:50:32 +0000 (15:50 -0700)]
bpo-30550: Clarify JSON ordering guarantees (GH-15397) (GH-15403)

(cherry picked from commit 657008ea0336ff4f275ed3f0c2b6dd2e52de2bba)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
5 years agobpo-28556: Add a regression test to typing (GH-15396)
Miss Islington (bot) [Thu, 22 Aug 2019 18:11:27 +0000 (11:11 -0700)]
bpo-28556: Add a regression test to typing (GH-15396)

This adds a regression test for the issue found in the Python 2 backport, see https://github.com/python/typing/issues/656

https://bugs.python.org/issue28556
(cherry picked from commit 8889627b53e1eea2e32590f1867fbb0b0fc7407f)

Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
5 years agobpo-14050: Note that not all data can be sorted (GH-15381) (GH-15395)
Miss Islington (bot) [Thu, 22 Aug 2019 16:39:52 +0000 (09:39 -0700)]
bpo-14050: Note that not all data can be sorted (GH-15381) (GH-15395)

(cherry picked from commit 4109263a7edce11194e301138cf66fa2d07f7ce4)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
5 years agobpo-27961: Remove leftovers from the times when long long wasn't required (GH-15388)
Miss Islington (bot) [Thu, 22 Aug 2019 15:59:18 +0000 (08:59 -0700)]
bpo-27961: Remove leftovers from the times when long long wasn't required (GH-15388)

(cherry picked from commit a38e9d139929a227e3899fbb638bc46c6cc6d8ba)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
5 years agoAdd missing space to warning message (GH-14915) (GH-15379)
Miss Islington (bot) [Thu, 22 Aug 2019 06:30:26 +0000 (23:30 -0700)]
Add missing space to warning message (GH-14915) (GH-15379)

This typo was introduced in GH-13409 when changing the message text.
(cherry picked from commit c4106af38bbcb180725fe0d9478e6a11f7a5e7b9)

Co-authored-by: Florian Bruhin <me@the-compiler.org>
5 years agobpo-37834: Fix test on Windows 7 (GH-15377)
Miss Islington (bot) [Thu, 22 Aug 2019 01:01:22 +0000 (18:01 -0700)]
bpo-37834: Fix test on Windows 7 (GH-15377)

(cherry picked from commit 374be59b8e479afa8c7a8ae6e77e98915e2f6d45)

Co-authored-by: Steve Dower <steve.dower@python.org>
5 years agobpo-9949: Call normpath() in realpath() and avoid unnecessary prefixes (GH-15376)
Steve Dower [Thu, 22 Aug 2019 00:23:38 +0000 (17:23 -0700)]
bpo-9949: Call normpath() in realpath() and avoid unnecessary prefixes (GH-15376)

5 years agobpo-36311: Fixes decoding multibyte characters around chunk boundaries and improves...
Miss Islington (bot) [Wed, 21 Aug 2019 23:53:56 +0000 (16:53 -0700)]
bpo-36311: Fixes decoding multibyte characters around chunk boundaries and improves decoding performance (GH-15083)

(cherry picked from commit 7ebdda0dbee7df6f0c945a7e1e623e47676e112d)

Co-authored-by: Steve Dower <steve.dower@python.org>
5 years agobpo-37834: Normalise handling of reparse points on Windows (GH-15370)
Steve Dower [Wed, 21 Aug 2019 22:52:42 +0000 (15:52 -0700)]
bpo-37834: Normalise handling of reparse points on Windows (GH-15370)

bpo-37834: Normalise handling of reparse points on Windows
* ntpath.realpath() and nt.stat() will traverse all supported reparse points (previously was mixed)
* nt.lstat() will let the OS traverse reparse points that are not name surrogates (previously would not traverse any reparse point)
* nt.[l]stat() will only set S_IFLNK for symlinks (previous behaviour)
* nt.readlink() will read destinations for symlinks and junction points only

bpo-1311: os.path.exists('nul') now returns True on Windows
* nt.stat('nul').st_mode is now S_IFCHR (previously was an error)

5 years agobpo-9949: Enable symlink traversal for ntpath.realpath (GH-15287)
Miss Islington (bot) [Wed, 21 Aug 2019 21:09:33 +0000 (14:09 -0700)]
bpo-9949: Enable symlink traversal for ntpath.realpath (GH-15287)

(cherry picked from commit 75e064962ee0e31ec19a8081e9d9cc957baf6415)

Co-authored-by: Steve Dower <steve.dower@python.org>
5 years agoFix difflib `?` hint in diff output when dealing with tabs (GH-15201)
Miss Islington (bot) [Wed, 21 Aug 2019 19:18:26 +0000 (12:18 -0700)]
Fix difflib `?` hint in diff output when dealing with tabs (GH-15201)

(cherry picked from commit e1c638da6a065af6803028ced1afcc679e63f59d)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
5 years agoUpdate asyncio.ensure_future() documentation (GH-15347) (GH-15364)
Miss Islington (bot) [Wed, 21 Aug 2019 17:20:49 +0000 (10:20 -0700)]
Update asyncio.ensure_future() documentation (GH-15347) (GH-15364)

Added back mention that ensure_future actually scheduled obj. This documentation just mentions what ensure_future returns, so I did not realize that ensure_future also schedules obj.
(cherry picked from commit 092911d5c0d8f6db8a0cb02fecd73dbb650f9e2e)

Co-authored-by: Roger Iyengar <ri@rogeriyengar.com>
5 years agobpo-37823: Fix open() link in telnetlib doc (GH-15281)
Miss Islington (bot) [Wed, 21 Aug 2019 11:38:04 +0000 (04:38 -0700)]
bpo-37823: Fix open() link in telnetlib doc (GH-15281)

Fixed wrong link to Telnet.open() method in telnetlib documentation.
(cherry picked from commit e0b6117e2723327d6741d0aa599408514add5b30)

Co-authored-by: Michael Anckaert <michael.anckaert@sinax.be>
5 years agobpo-35518: Skip test that relies on a deceased network service. (GH-15349)
Miss Islington (bot) [Wed, 21 Aug 2019 04:08:57 +0000 (21:08 -0700)]
bpo-35518: Skip test that relies on a deceased network service. (GH-15349)

If this service had thoroughly vanished, we could just ignore the
test until someone gets around to either recreating such a service
or redesigning the test to somehow work locally.  The
`support.transient_internet` mechanism catches the failure to
resolve the domain name, and skips the test.

But in fact the domain snakebite.net does still exist, as do its
nameservers -- and they can be quite slow to reply.  As a result
this test can easily take 20-30s before it gets auto-skipped.

So, skip the test explicitly up front.
(cherry picked from commit 5b95a1507e349da5adae6d2ab57deac3bdd12f15)

Co-authored-by: Greg Price <gnprice@gmail.com>
5 years agobpo-37732: Fix GCC warning in _PyObject_Malloc() (GH-15333) (GH-15342)
Victor Stinner [Tue, 20 Aug 2019 12:44:32 +0000 (13:44 +0100)]
bpo-37732: Fix GCC warning in _PyObject_Malloc() (GH-15333) (GH-15342)

pymalloc_alloc() now returns directly the pointer, return NULL on
memory allocation error.

allocate_from_new_pool() already uses NULL as marker for "allocation
failed".

(cherry picked from commit 18f8dcfa10d8a858b152d12a9ad8fa83b7e967f0)

5 years agobpo-37868: Improve is_dataclass for instances. (GH-15325)
Miss Islington (bot) [Tue, 20 Aug 2019 05:59:21 +0000 (22:59 -0700)]
bpo-37868: Improve is_dataclass for instances. (GH-15325)

(cherry picked from commit b0f4dab8735f692bcfedcf0fa9a25e238a554bab)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
5 years agoRemove 'unstable' warning for Windows Store package in docs (GH-15334)
Miss Islington (bot) [Mon, 19 Aug 2019 17:14:31 +0000 (10:14 -0700)]
Remove 'unstable' warning for Windows Store package in docs (GH-15334)

(cherry picked from commit cf9360e524acafdce99a8a1e48947fd7da06f3d4)

Co-authored-by: Steve Dower <steve.dower@python.org>
5 years agobpo-36502: Correct documentation of str.isspace() (GH-15019) (GH-15296)
Greg Price [Mon, 19 Aug 2019 09:53:22 +0000 (02:53 -0700)]
bpo-36502: Correct documentation of str.isspace() (GH-15019) (GH-15296)

The documented definition was much broader than the real one:
there are tons of characters with general category "Other",
and we don't (and shouldn't) treat most of them as whitespace.

Rewrite the definition to agree with the comment on
_PyUnicode_IsWhitespace, and with the logic in makeunicodedata.py,
which is what generates that function and so ultimately governs.

Add suitable breadcrumbs so that a reader who wants to pin down
exactly what this definition means (what's a "bidirectional class"
of "B"?) can do so.  The `unicodedata` module documentation is an
appropriate central place for our references to Unicode's own copious
documentation, so point there.

Also add to the isspace() test a thorough check that the
implementation agrees with the intended definition.

5 years agobpo-36266: Add module name in ImportError when DLL not found on Windows (GH-15180)
Miss Islington (bot) [Sat, 17 Aug 2019 21:11:28 +0000 (14:11 -0700)]
bpo-36266: Add module name in ImportError when DLL not found on Windows (GH-15180)

(cherry picked from commit 24fe46081be3d1c01b3d21cb39bc3492ab4485a3)

Co-authored-by: shireenrao <shireenrao@gmail.com>
5 years ago[3.8] fix link to time function from time_ns doc (GH-15285) (GH-15321)
Miss Islington (bot) [Sat, 17 Aug 2019 20:51:57 +0000 (13:51 -0700)]
[3.8] fix link to time function from time_ns doc (GH-15285) (GH-15321)

Because mod, func, class, etc all share one namespace, :func:time creates a link to the time module doc page rather than the time.time function.
(cherry picked from commit 1b1d0514adbcdd859817c63d1410455c64660d78)

Co-authored-by: Éric Araujo <merwok@netwok.org>
Automerge-Triggered-By: @merwok
5 years agobpo-37256: Wording in Request class docs (GH-14792)
Miss Islington (bot) [Fri, 16 Aug 2019 08:27:35 +0000 (01:27 -0700)]
bpo-37256: Wording in Request class docs (GH-14792)

* bpo-37256: Wording in Request class docs

* 📜🤖 Added by blurb_it.

* Update Misc/NEWS.d/next/Documentation/2019-07-16-14-48-12.bpo-37256.qJTrBb.rst

Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
(cherry picked from commit 38c7199beb30ae9a5005c0f0d9df9fae0da3680a)

Co-authored-by: Ngalim Siregar <ngalim.siregar@gmail.com>
5 years agobpo-37642: Update acceptable offsets in timezone (GH-14878) (#15227)
Paul Ganssle [Thu, 15 Aug 2019 19:08:57 +0000 (15:08 -0400)]
bpo-37642: Update acceptable offsets in timezone (GH-14878) (#15227)

This fixes an inconsistency between the Python and C implementations of
the datetime module. The pure python version of the code was not
accepting offsets greater than 23:59 but less than 24:00. This is an
accidental legacy of the original implementation, which was put in place
before tzinfo allowed sub-minute time zone offsets.

GH-14878

(cherry picked from commit 92c7e30adf5c81a54d6e5e555a6bdfaa60157a0d)

5 years agoIndent code inside if block. (GH-15284)
Miss Islington (bot) [Thu, 15 Aug 2019 16:38:22 +0000 (09:38 -0700)]
Indent code inside if block. (GH-15284)

Without indendation, seems like strcpy line is parallel to `if` condition.
(cherry picked from commit 69f37bcb28d7cd78255828029f895958b5baf6ff)

Co-authored-by: Hansraj Das <raj.das.136@gmail.com>
5 years ago[3.8] Replace usage of the obscure PEM_read_bio_X509_AUX with the more standard PEM_r...
Miss Islington (bot) [Thu, 15 Aug 2019 12:52:51 +0000 (05:52 -0700)]
[3.8] Replace usage of the obscure PEM_read_bio_X509_AUX with the more standard PEM_read_bio_X509 (GH-15303) (GH-15304)

X509_AUX is an odd, note widely used, OpenSSL extension to the X509 file format. This function doesn't actually use any of the extra metadata that it parses, so just use the standard API.

Automerge-Triggered-By: @tiran
(cherry picked from commit 40dad9545aad4ede89abbab1c1beef5303d9573e)

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
Automerge-Triggered-By: @tiran
5 years agobpo-37775: Update compileall doc for invalidation_mode parameter (GH-15148)
Miss Islington (bot) [Wed, 14 Aug 2019 22:22:02 +0000 (15:22 -0700)]
bpo-37775: Update compileall doc for invalidation_mode parameter (GH-15148)

(cherry picked from commit 68e495df909a33e719e3f1ef5b4893ec785e10a4)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
5 years agobpo-21131: Fix faulthandler.register(chain=True) stack (GH-15276)
Miss Islington (bot) [Wed, 14 Aug 2019 22:02:12 +0000 (15:02 -0700)]
bpo-21131: Fix faulthandler.register(chain=True) stack (GH-15276)

faulthandler now allocates a dedicated stack of SIGSTKSZ*2 bytes,
instead of just SIGSTKSZ bytes. Calling the previous signal handler
in faulthandler signal handler uses more than SIGSTKSZ bytes of stack
memory on some platforms.
(cherry picked from commit ac827edc493d3ac3f5b9b0cc353df1d4b418a9aa)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
5 years agobpo-37811: FreeBSD, OSX: fix poll(2) usage in sockets module (GH-15202)
Miss Islington (bot) [Wed, 14 Aug 2019 21:47:43 +0000 (14:47 -0700)]
bpo-37811: FreeBSD, OSX: fix poll(2) usage in sockets module (GH-15202)

FreeBSD implementation of poll(2) restricts the timeout argument to be
either zero, or positive, or equal to INFTIM (-1).

Unless otherwise overridden, socket timeout defaults to -1. This value
is then converted to milliseconds (-1000) and used as argument to the
poll syscall. poll returns EINVAL (22), and the connection fails.

This bug was discovered during the EINTR handling testing, and the
reproduction code can be found in
https://bugs.python.org/issue23618 (see connect_eintr.py,
attached). On GNU/Linux, the example runs as expected.

This change is trivial:
If the supplied timeout value is negative, truncate it to -1.
(cherry picked from commit 28146206578ebe1b84b48e6f255738a227058c04)

Co-authored-by: Artem Khramov <akhramov@pm.me>
5 years agobpo-37849: IDLE: fix completion window positioning above line (GH-15267)
Miss Islington (bot) [Wed, 14 Aug 2019 17:24:04 +0000 (10:24 -0700)]
bpo-37849: IDLE: fix completion window positioning above line (GH-15267)

(cherry picked from commit 71662dc2f12a7e77e5e1dfe64ec87c1b459c3f59)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
5 years ago[3.8] bpo-37531: Fix regrtest timeout for subprocesses (GH-15072) (GH-15279)
Victor Stinner [Wed, 14 Aug 2019 14:31:32 +0000 (16:31 +0200)]
[3.8] bpo-37531: Fix regrtest timeout for subprocesses (GH-15072) (GH-15279)

* bpo-37531: Fix regrtest timeout for subprocesses (GH-15072)

Co-Authored-By: Joannah Nanjekye <joannah.nanjekye@ibm.com>
(cherry picked from commit b0c8369c603633f445ccbb5ca7a8742145ff9eec)

* bpo-36511: Fix failures in Windows ARM32 buildbot (GH-15181)

(cherry picked from commit ed70a344b5fbddea85726ebc1964ee0cfdef9c40)

Backport also minor fixes from master (fix typo, remove importlib import).

5 years agobpo-37738: Fix curses addch(str, color_pair) (GH-15071)
Miss Islington (bot) [Wed, 14 Aug 2019 10:49:13 +0000 (03:49 -0700)]
bpo-37738: Fix curses addch(str, color_pair) (GH-15071)

Fix the implementation of curses addch(str, color_pair): pass the
color pair to setcchar(), instead of always passing 0 as the color
pair.
(cherry picked from commit 077af8c2c93dd71086e2c5e5ff1e634b6da8f214)

Co-authored-by: Victor Stinner <vstinner@redhat.com>