Commit Graph

2617 Commits

Author SHA1 Message Date
Dong-hee Na 2ee87913dd [3.8] bpo-38588: Fix possible crashes in dict and list when calling P… (GH-17764)
* [3.8] bpo-38588: Fix possible crashes in dict and list when calling PyObject_RichCompareBool (GH-17734)

Take strong references before calling PyObject_RichCompareBool to protect against the case
where the object dies during the call.
(cherry picked from commit 2d5bf568ea)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>

* Update Objects/listobject.c

@methane's suggestion

Co-Authored-By: Inada Naoki <songofacandy@gmail.com>

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2019-12-31 04:15:36 +00:00
Miss Islington (bot) ec941568bd
bpo-34118: memoryview, range, and tuple are classes (GH-17761)
Tag memoryview, range, and tuple as classes, the same as list, etcetera, in
the library manual built-in functions list.
(cherry picked from commit ee9ff05ec2)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-12-30 14:24:27 -08:00
Miss Islington (bot) fcaf14cd91
bpo-38610: Fix possible crashes in several list methods (GH-17022)
Hold strong references to list elements while calling PyObject_RichCompareBool().
(cherry picked from commit d9e561d23d)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-12-30 11:51:06 -08:00
Miss Islington (bot) 2786fdec79
bpo-39144 Align ctags and etags behaviours in the makefile and include Python stdlib files (GH-17721)
(cherry picked from commit ef7eaafc9d)

Co-authored-by: Anthony Shaw <anthony.p.shaw@gmail.com>
2019-12-27 18:50:34 -08:00
Miss Islington (bot) 4ed79b7800
Fix import path for asyncio.TimeoutError (GH-17691)
(cherry picked from commit 025eeaa196)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-12-24 03:04:12 -08:00
Bar Harel 0846e5d460 [3.8] bpo-38878: Fix os.PathLike __subclasshook__ (GH-17336) (GH-17684)
https://bugs.python.org/issue38878
2019-12-23 18:31:00 +00:00
Miss Islington (bot) 44683bbc63
bpo-38918: Add __module__ entry for function & method type in inspect docs table (GH-17408)
Adds` __module__ ` entries for function & method types in inspect docs table.

https://bugs.python.org/issue38918
(cherry picked from commit f522a6ddb6)

Co-authored-by: Parth Sharma <parthsharma2@users.noreply.github.com>
2019-12-20 11:26:39 -08:00
Łukasz Langa 114aad7b14 Python 3.8.1
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl36YEkACgkQsmmV4xAl
 BWh59Q/+OXxgPm7u3EG3KSDZk+Hcd7d7jcuODR67veRjIAe7PSvdPIttC39qVWv5
 j6mnH0xP3Q6wOcpOu+EpKiU60tvTYRVdk7BGCqZsFaQlIZY8lwbm30bw9x/wrFoa
 Qt7W1yJ00avn1x1rZ1ZejyOI9RL8im15WJF5NpS3eqX1EL+UBScrsQNjHGIYi+pM
 ERm+9BTTYVQ3odYnvQ6FsJIASf3IbWcQULtRsr7kGSP4E0Y9PXWCvy89tWay3R2N
 j1L11w7uL/RgqJUvfUljGwuWp2kiBEC1xIM85AzTo464IMIfix4aGhriLh4qX6ZD
 14sJmVJERdSqigpJlhwlaGIs2xOIzOcZ3Tok2aiJDGD9iqnsrtZFJRVGQxu4dExa
 UPfhskUxMdTEMD1vPAgU43JWZ5kMoz+eYP246UQELUCDqhW8ZP5f0Jx+MS8EcFf6
 qY1E/5RsxxSgOE5lcb25Cy63dvFVVtOHfLCt//P/jr8NP+hgpdVVJlqZNhKgoUGs
 KT75wck2MLss+OR0itCzdPsqUc27oMZJEhzeoq6+xNP8IysrTWl7AlmCPoinsaW0
 cKdlx47jnD9JYAjXXf8i7yjov2vaS7npWQYYujd01FGB9Ex7wSfAt54HmVfC1UuE
 Wl6t4s6PN0S9GJqHvbkrWkS6fjaKwHJAWH8Hi3Ik9omTGDgZxvY=
 =emOv
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl37LjYQHGx1a2FzekBs
 YW5nYS5wbAAKCRCyaZXjECUFaKcrD/sGsjOSMynwqBUWBIKOUpkxm8mhfsq4UeX+
 ThsvnruF+TY6vr/v3PO8+YS0TItdlN4xhKWfWeMrIJQwXug4ZFOCnK1yKd16iD5o
 yo259NhOiBX6v41I29L9PGYXdqQQDRd5MdI/8t9hx/XZVgBuYjXoesyRPvEbuPIJ
 8QlxVYx+lhxYeQ/1bEsl9CGX+PIYfWp+v/u2xsi9e5g8gMX0nbkv3wma2JDwDWhM
 nuG9yT8y1zZAGUHEKqKA4Gg2Iwrq2vHBZXfXLuFtTEl+EGUbOVjk0DBA/lu6prP5
 GrVDMrwEmOA9EN/ooXtpGno/mpX2vj6LmUPsfwgtAMDUB73UmkguohdjmpZrW/qf
 8U7oAXAw8ifkC09aHfIWKZHp8xZjhXO4v7hn8bMjTsurxQgCAJciBhrYv9nf2JHl
 ayA+SkScX9rRmAp0QuyjCq6QZyix2CG5ko6nnubg7WuvZbnXzgRum9MAOVa61Inn
 lYlkywmUQp4XhvuW3hOVyV83KZMKNmg0lsziy8bKGPd2cwMBxXTqiNLrDgUAvkBN
 7KlBoT6DWoRt4X1JWEFbCavqSoEjG1QHzfUN6QVcMnSzE9MGKFu5ICNKPgKxPmqf
 4qxP9oeWjUwpgrGL7iem91XPq79FrMeubiyIH/b88oR6qHhceIe7MJ73fyBNe5uN
 uj+5BUpujg==
 =pQD9
 -----END PGP SIGNATURE-----

Merge tag 'v3.8.1' into 3.8

Python 3.8.1
2019-12-19 09:00:46 +01:00
Victor Stinner b0eb046cbd
bpo-38546: Fix concurrent.futures test_ressources_gced_in_workers() (GH-17652) (GH-17655)
Fix test_ressources_gced_in_workers() of test_concurrent_futures:
explicitly stop the manager to prevent leaking a child process
running in the background after the test completes.

(cherry picked from commit 673c39331f)
2019-12-18 21:30:43 +01:00
Łukasz Langa 1b293b6006
Python 3.8.1 2019-12-18 18:21:23 +01:00
Victor Stinner 35acb35972
bpo-38546: multiprocessing tests stop the resource tracker (GH-17641) (GH-17647)
Multiprocessing and concurrent.futures tests now stop the resource
tracker process when tests complete.

Add ResourceTracker._stop() method to
multiprocessing.resource_tracker.

Add _cleanup_tests() helper function to multiprocessing.util: share
code between multiprocessing and concurrent.futures tests.

(cherry picked from commit 9707e8e22d)
2019-12-18 10:11:05 +01:00
Pablo Galindo b1f2044710 [3.8] bpo-39080: Starred Expression's column offset fix when inside a CALL (GH-17645) (GH-17649)
… 
Co-Authored-By: Pablo Galindo <Pablogsal@gmail.com>
(cherry picked from commit 50d4f12958)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>





https://bugs.python.org/issue39080
2019-12-17 17:41:58 -08:00
Ned Deily bf3aa1060a
bpo-38295: prevent test_relative_path of test_py_compile failure on macOS Catalina (GH-17636) 2019-12-17 04:05:41 -05:00
Miss Islington (bot) 8d0f36940e
bpo-38811: Check for presence of os.link method in pathlib (GH-17225)
Commit 6b5b013bcc ("bpo-26978: Implement pathlib.Path.link_to (Using
os.link) (GH-12990)") introduced a new link_to method in pathlib. However,
this makes pathlib crash when the 'os' module is missing a 'link' method.

Fix this by checking for the presence of the 'link' method on pathlib
module import, and if it's not present, turn it into a runtime error like
those emitted when there is no lchmod() or symlink().

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
(cherry picked from commit 092435e932)

Co-authored-by: Toke Høiland-Jørgensen <toke@redhat.com>
2019-12-16 04:42:20 -08:00
Miss Islington (bot) aa74a53ad6 bpo-36406: Handle namespace packages in doctest (GH-12520) (GH-17591)
(cherry picked from commit 8289e27393)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
2019-12-13 15:30:41 -08:00
Miss Islington (bot) 3b18b17efc bpo-39031: Include elif keyword when producing lineno/col-offset info for if_stmt (GH-17582) (GH-17589)
When parsing an "elif" node, lineno and col_offset of the node now point to the "elif" keyword and not to its condition, making it consistent with the "if" node.

https://bugs.python.org/issue39031

Automerge-Triggered-By: @pablogsal
(cherry picked from commit 025a602af7)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2019-12-13 16:21:54 +00:00
Miss Islington (bot) b738237d67 bpo-39022, bpo-38594: Sync with importlib_metadata 1.3 (GH-17568) (GH-17569)
* bpo-39022, bpo-38594: Sync with importlib_metadata 1.3 including improved docs for custom finders and better serialization support in EntryPoints.

* 📜🤖 Added by blurb_it.

* Correct module reference
(cherry picked from commit b7a0109cd2)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2019-12-10 20:47:06 -05:00
Pablo Galindo 3ac65a7161 [3.8] Minor fixes to the NEWS entries (GH-17557)
Automerge-Triggered-By: @pablogsal
2019-12-10 08:11:33 -08:00
Łukasz Langa 8129e5e356 Python 3.8.1rc1
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl3uiPsACgkQsmmV4xAl
 BWh1PQ//fJRLYxpcIwreGvP1XXPACjyByXdYgwf5xuXeoPIjdNccMC30nDzbmitR
 zaqKXcQUOmjsFGEq95hctl7tUKzk2lgGQBf1gUOBIXcoGaK3UY30K6JgsvGKSQqd
 hyOCxSlrEjLU8pJpsTWtOH8o+sOtjlChopj88mLq9xNxaEBY+U6SIv9YN0FQhWDm
 RvvhBuQax4f+Bry3edH6eNqk9a4EsRQ9ud2ABwXPI71s1BUvNfdTwcU1NSI2JQaQ
 vJNT8yQXgP0hWJJfB4wFn9ior6q288WUhWATVTtF7dBGkuTI7e0PiaYezMUF+hTm
 bCsSbaFoNoCn5acYZtilGG+LRzMSp2svYJXMvTeaB5h8lpIexn0rIzMHqFAwhyGJ
 LMgXw32LXI9XaYbdqyON/pXUH24tL8fu5rgvupgnmtXnWSSxml2nVUv8zEqHTqmV
 TvOOf0jyVpSMvMab3sdc4OwV+VSyKVKtsAoEKt0K1Tq05hzUBvG41uxE+2rvxBYF
 dANyJK+0Jeo6ouTlQCIqefXBPUI7JXM+94BwOmLIEvhA/ycKFv2lOMibX1FZQO//
 TjOEK8NwGULY2Z1AdeC8TcDfT/iTefteljC6cq1FcAkHNwnMjWVrhvK0rqnrXUn2
 CpzoQm7GShP/ViUqgdAfM1czGM5mrlY8OWX7sFLSUN2mPOBLrgs=
 =f79H
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl3vU3UQHGx1a2FzekBs
 YW5nYS5wbAAKCRCyaZXjECUFaEiAEACcl0GKXfYz0C6texEO6FFMNJPQtXWNwdt5
 U2d1UsXhp4xJKLz7NhgAvVldjEB0WT20F0ZzC9Z9YIbOCgJLwbLm0nIINlQ7jxzM
 edz81gYYnnWNet4G57ljRdveMZ14K5CY9wijyPw89y7UHXZ93B9scMyccdRmFRuv
 A817Qr4Sdqy7JsbZ7PP9OKkroMeAVVf0Xj3v07ZIqq83+g3pDsnMZTEsRKhJXVnG
 rzllNQNYHFCz7ViBiBfK1AdYVRhkhjWaqvGadlaG//9qo7UymTrmVrNrllXy705o
 Z2fQS4c6IDkEC2+uFOYJdgdptsueKfZzzj5QITZz6NaIxE5PMFW2x4vLgEYPIj7w
 bPII8IkwRp+95iG60xxet0IQyIEh/HYwYa3Z4AeWH8ZYWSxkysgLx6qJ5KaYGBYC
 AAi5YCKo4gzvRABbd5uq5ebYutuXQWVJcDqtOl8f/SH8zvA2bVsv8H95SD7kwAGS
 EOuDN37unmTKjWNycFa0NLqTJqv7XUpMnKlwU2z2PPJHsqCRS9AkKqw7UU/ljbn6
 bc6lvOLTWI1CdqbGedbqGoi9oF4HAqSmmIgVjh16+fOYgYa1qRe/hcBn3Up+KVas
 5fVt/f4sR6C3sDKnh5ynVnLkzWZgJD4QBx4DS0ZYHnNCCVQfJQbdWpG+N4muiJAi
 oHIFP43J8w==
 =uwbV
 -----END PGP SIGNATURE-----

Merge tag 'v3.8.1rc1' into 3.8

Python 3.8.1rc1
2019-12-10 09:12:15 +01:00
Miss Islington (bot) 859767d58e bpo-39002: Fix simple typo: tranlation -> translation (GH-17517) (GH-17538)
(cherry picked from commit c18b805ac6)

Co-authored-by: Tim Gates <tim.gates@iress.com>
2019-12-09 17:35:25 -08:00
Miss Islington (bot) 34d5d5e096
bpo-38943: Fix IDLE autocomplete window not always appearing (GH-17416)
This has happened on some versions of Ubuntu.
(cherry picked from commit bbc4162baf)

Co-authored-by: JohnnyNajera <58344607+JohnnyNajera@users.noreply.github.com>
2019-12-09 16:48:20 -08:00
Miss Islington (bot) 2b2c7bf231
bpo-38944: Escape key now closes IDLE completion windows. (GH-17419)
(cherry picked from commit 232689b40d)

Co-authored-by: JohnnyNajera <58344607+JohnnyNajera@users.noreply.github.com>
2019-12-09 15:38:33 -08:00
Miss Islington (bot) 0ac9aaeb97
bpo-39007: Add auditing events to functions in winreg (GH-17541)
Also allows winreg.CloseKey() to accept same types as other functions.
(cherry picked from commit ee17e37356)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-12-09 11:36:25 -08:00
Miss Islington (bot) c93d68bbb9
bpo-39008: Require Py_ssize_t for PySys_Audit formats rather than raise a deprecation warning (GH-17540)
(cherry picked from commit b8cbe74c34)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-12-09 11:22:30 -08:00
Łukasz Langa b00a2b5b76
Python 3.8.1rc1 2019-12-09 18:47:55 +01:00
Miss Islington (bot) 3c5feaffde bpo-38992: avoid fsum test failure from constant-folding (GH-17513) (GH-17530)
* Issue 38992: avoid fsum test failure

* Add NEWS entry
(cherry picked from commit bba873e633)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
2019-12-09 11:32:34 -06:00
Miss Islington (bot) 0d57db27f2 bpo-34776: Fix dataclasses to support __future__ "annotations" mode (GH-9518) (#17531)
(cherry picked from commit d219cc4180)

Co-authored-by: Yury Selivanov <yury@magic.io>
2019-12-09 17:07:51 +01:00
Miss Islington (bot) 79c29742a8 bpo-37228: Fix loop.create_datagram_endpoint()'s usage of SO_REUSEADDR (GH-17311) (#17529)
(cherry picked from commit ab513a38c9)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2019-12-09 15:39:54 +01:00
Miss Islington (bot) b22183f273
bpo-39006: Fix asyncio when the ssl module is missing (GH-17524)
Fix asyncio when the ssl module is missing: only check for
ssl.SSLSocket instance if the ssl module is available.
(cherry picked from commit 82b4950b5e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-12-09 06:19:48 -08:00
Miss Islington (bot) d08fd298dc
bpo-38547: Fix test_pty if the process is the session leader (GH-17519)
Fix test_pty: if the process is the session leader, closing the
master file descriptor raises a SIGHUP signal: simply ignore SIGHUP
when running the tests.
(cherry picked from commit a1838ec259)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-12-09 03:15:23 -08:00
Miss Islington (bot) 4594565b56 bpo-38669: patch.object now raises a helpful error (GH17510)
This means a clearer message is now shown when patch.object is called with two string arguments, rather than a class and a string argument.
(cherry picked from commit cd90a52983)

Co-authored-by: Elena Oat <oat.elena@gmail.com>
2019-12-09 06:59:04 +00:00
Miss Islington (bot) 184a3812b8
bpo-38673: dont switch to ps2 if the line starts with comment or whitespace (GH-17421)
https://bugs.python.org/issue38673
(cherry picked from commit 109fc2792a)

Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
2019-12-08 20:56:19 -08:00
Miss Islington (bot) 2abd3a8f58
bpo-38708: email: Fix a potential IndexError when parsing Message-ID (GH-17504)
Fix a potential IndexError when passing an empty value to the message-id
parser. Instead, HeaderParseError should be raised.
(cherry picked from commit 3ae4ea1931)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2019-12-08 18:12:50 -08:00
Miss Islington (bot) f66f4a09d0
bpo-38698: Add a new InvalidMessageID token to email header parser. (GH-17503)
This adds a new InvalidMessageID token to the email header parser which can be
used to represent invalid message-id headers in the parse tree.
(cherry picked from commit 68157da8b4)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2019-12-08 18:11:31 -08:00
Miss Islington (bot) 960fca1a58
bpo-38979: fix ContextVar "__class_getitem__" method (GH-17497)
now contextvars.ContextVar "__class_getitem__" method returns ContextVar class, not None.

https://bugs.python.org/issue38979

Automerge-Triggered-By: @asvetlov
(cherry picked from commit 28c91631c2)

Co-authored-by: AMIR <31338382+amiremohamadi@users.noreply.github.com>
2019-12-08 04:49:07 -08:00
Miss Islington (bot) 9d3cacd590
[3.8] bpo-38820: OpenSSL 3.0.0 compatibility. (GH-17190) (GH-17499)
test_openssl_version now accepts version 3.0.0.

getpeercert() no longer returns IPv6 addresses with a trailing new line.

Signed-off-by: Christian Heimes <christian@python.org>


https://bugs.python.org/issue38820
(cherry picked from commit 2b7de6696b)


Co-authored-by: Christian Heimes <christian@python.org>


https://bugs.python.org/issue38820



Automerge-Triggered-By: @tiran
2019-12-07 09:20:27 -08:00
Andrew Svetlov 930cef2770
[3.8] bpo-37404: Raising value error if an SSLSocket is passed to asyncio functions (GH-16457) (#17496)
https://bugs.python.org/issue37404
(cherry picked from commit 892f9e0777)

Co-authored-by: idomic <michael.ido@gmail.com>
2019-12-07 14:44:20 +02:00
Miss Islington (bot) ce0a2a8620
Make repr of C accelerated TaskWakeupMethWrapper the same as of pure Python version (GH-17484)
(cherry picked from commit 969ae7aca8)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-12-07 03:41:41 -08:00
Miss Islington (bot) 7fde4f446a
bpo-38529: Fix asyncio stream warning (GH-17474)
(cherry picked from commit 7ddcd0caa4)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-12-07 03:39:57 -08:00
Miss Islington (bot) 836cf31a3c
bpo-37931: Fix crash on OSX re-initializing os.environ (GH-15428)
On most platforms, the `environ` symbol is accessible everywhere.

In a dylib on OSX, it's not easily accessible, you need to find it with
_NSGetEnviron.

The code was caching the *value* of environ. But a setenv() can change the value,
leaving garbage at the old value. Fix: don't cache the value of environ, just
read it every time.
(cherry picked from commit 723f71abf7)

Co-authored-by: Benoit Hudson <benoit@imgspc.com>
2019-12-06 11:32:33 -08:00
Steve Dower c9f480d2cc
bpo-33125: Add support for building and releasing Windows ARM64 packages (GH-17480)
Note that the support is not actually enabled yet, and so we won't be publishing these packages. However, for those who want to build it themselves (even by reusing the Azure Pipelines definition), it's now relatively easy to enable.
2019-12-06 09:40:39 -08:00
Miss Islington (bot) 681285d052
bpo-36820: Break unnecessary cycle in socket.py, codeop.py and dyld.py (GH-13135)
Break cycle generated when saving an exception in socket.py, codeop.py and dyld.py as they keep alive not only the exception but user objects through the ``__traceback__`` attribute.

https://bugs.python.org/issue36820

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

Co-authored-by: Mario Corchero <mcorcherojim@bloomberg.net>
2019-12-06 06:59:49 -08:00
Miss Islington (bot) e21aa61e96
bpo-38698: Prevent UnboundLocalError to pop up in parse_message_id (GH-17277)
parse_message_id() was improperly using a token defined inside an exception
handler, which was raising `UnboundLocalError` on parsing an invalid value.

https://bugs.python.org/issue38698
(cherry picked from commit bb815499af)

Co-authored-by: Claudiu Popa <pcmanticore@gmail.com>
2019-12-05 09:42:01 -08:00
Miss Islington (bot) f4a21d3b23
bpo-38965: Fix faulthandler._stack_overflow() on GCC 10 (GH-17467)
Use the "volatile" keyword to prevent tail call optimization
on any compiler, rather than relying on compiler specific pragma.
(cherry picked from commit 8b787964e0)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-12-04 12:30:31 -08:00
Miss Islington (bot) 68669ef788
bpo-38634: Allow non-apple build to cope with libedit (GH-16986)
The readline module now detects if Python is linked to libedit at runtime
on all platforms.  Previously, the check was only done on macOS.

If Python is used as a library by a binary linking to libedit, the linker
resolves the rl_initialize symbol required by the readline module against
libedit instead of libreadline, which leads to a segfault.

Take advantage of the existing supporting code to have readline module being
compatible with both situations.
(cherry picked from commit 7105319ada)

Co-authored-by: serge-sans-paille <serge.guelton@telecom-bretagne.eu>
2019-12-04 08:21:16 -08:00
Miss Islington (bot) a75cad440a
bpo-33684: json.tool: Use utf-8 for infile and outfile. (GH-17460)
(cherry picked from commit 808769f3a4)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2019-12-04 01:57:55 -08:00
Miss Islington (bot) 8859fc6294
bpo-38945: UU Encoding: Don't let newline in filename corrupt the output format (GH-17418)
(cherry picked from commit a62ad4730c)

Co-authored-by: Matthew Rollings <1211162+stealthcopter@users.noreply.github.com>
2019-12-02 14:44:44 -08:00
Steve Dower b74a6f14b9
bpo-38920: Add audit hooks for when sys.excepthook and sys.unraisablehook are invoked (GH-17392)
Also fixes some potential segfaults in unraisable hook handling.
2019-11-28 08:46:23 -08:00
Miss Islington (bot) d21b8e82dd
bpo-26730: Fix SpooledTemporaryFile data corruption (GH-17400)
SpooledTemporaryFile.rollback() might cause data corruption
when it is in text mode.

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit ea9835c5d1)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2019-11-27 21:23:14 -08:00
Bruno P. Kinoshita 65c92c5870 [3.8] bpo-38688, shutil.copytree: consume iterator and create list of entries to prevent infinite recursion (GH-17397)
(cherry picked from commit 9bbcbc9f6d)

Co-authored-by: Bruno P. Kinoshita <kinow@users.noreply.github.com>
2019-11-27 12:49:37 +08:00
Terry Jan Reedy a9c86f5e1a
[3.8] bpo-38862: IDLE Strip Trailing Whitespace fixes end newlines (GH-17366)
Extra newlines are removed at the end of non-shell files. If the file only has newlines after stripping other trailing whitespace, all are removed, as is done by patchcheck.py.
(cherry picked from commit 6bf644ec82)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-11-26 20:13:23 -05:00
Miss Islington (bot) 191f94cca6
bpo-38922: Raise code.__new__ audit event when code object replace() is called (GH-17394)
(cherry picked from commit c7c01ab1e5)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-11-26 16:46:32 -08:00
Miss Islington (bot) 86d9933cc6
bpo-38892: Improve docs for audit event (GH-17361)
(cherry picked from commit e563a155be)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-11-26 09:14:48 -08:00
Miss Islington (bot) b9e5547f58
bpo-38686: fix HTTP Digest handling in request.py (GH-17045)
* fix HTTP Digest handling in request.py

There is a bug triggered when server replies to a request with `WWW-Authenticate: Digest` where `qop="auth,auth-int"` rather than mere `qop="auth"`. Having both `auth` and `auth-int` is legitimate according to the `qop-options` rule in §3.2.1 of [[https://www.ietf.org/rfc/rfc2617.txt|RFC 2617]]:
>      qop-options       = "qop" "=" <"> 1GH-qop-value <">
>      qop-value         = "auth" | "auth-int" | token
> **qop-options**: [...] If present, it is a quoted string **of one or more** tokens indicating the "quality of protection" values supported by the server.  The value `"auth"` indicates authentication; the value `"auth-int"` indicates authentication with integrity protection

This is description confirmed by the definition of the [//n//]`GH-`[//m//]//rule// extended-BNF pattern defined in §2.1 of [[https://www.ietf.org/rfc/rfc2616.txt|RFC 2616]] as 'a comma-separated list of //rule// with at least //n// and at most //m// items'.

When this reply is parsed by `get_authorization`, request.py only tests for identity with `'auth'`, failing to recognize it as one of the supported modes the server announced, and claims that `"qop 'auth,auth-int' is not supported"`.

* 📜🤖 Added by blurb_it.

* bpo-38686 review fix: remember why.

* fix trailing space in Lib/urllib/request.py

Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
(cherry picked from commit 14a89c4798)

Co-authored-by: PypeBros <PypeBros@users.noreply.github.com>
2019-11-22 15:36:38 -08:00
Miss Islington (bot) a1e1be4c49
bpo-38804: Fix REDoS in http.cookiejar (GH-17157)
The regex http.cookiejar.LOOSE_HTTP_DATE_RE was vulnerable to regular
expression denial of service (REDoS).

LOOSE_HTTP_DATE_RE.match is called when using http.cookiejar.CookieJar
to parse Set-Cookie headers returned by a server.
Processing a response from a malicious HTTP server can lead to extreme
CPU usage and execution will be blocked for a long time.

The regex contained multiple overlapping \s* capture groups.
Ignoring the ?-optional capture groups the regex could be simplified to

    \d+-\w+-\d+(\s*\s*\s*)$

Therefore, a long sequence of spaces can trigger bad performance.

Matching a malicious string such as

    LOOSE_HTTP_DATE_RE.match("1-c-1" + (" " * 2000) + "!")

caused catastrophic backtracking.

The fix removes ambiguity about which \s* should match a particular
space.

You can create a malicious server which responds with Set-Cookie headers
to attack all python programs which access it e.g.

    from http.server import BaseHTTPRequestHandler, HTTPServer

    def make_set_cookie_value(n_spaces):
        spaces = " " * n_spaces
        expiry = f"1-c-1{spaces}!"
        return f"b;Expires={expiry}"

    class Handler(BaseHTTPRequestHandler):
        def do_GET(self):
            self.log_request(204)
            self.send_response_only(204)  GH- Don't bother sending Server and Date
            n_spaces = (
                int(self.path[1:])  GH- Can GET e.g. /100 to test shorter sequences
                if len(self.path) > 1 else
                65506  GH- Max header line length 65536
            )
            value = make_set_cookie_value(n_spaces)
            for i in range(99):  GH- Not necessary, but we can have up to 100 header lines
                self.send_header("Set-Cookie", value)
            self.end_headers()

    if __name__ == "__main__":
        HTTPServer(("", 44020), Handler).serve_forever()

This server returns 99 Set-Cookie headers. Each has 65506 spaces.
Extracting the cookies will pretty much never complete.

Vulnerable client using the example at the bottom of
https://docs.python.org/3/library/http.cookiejar.html :

    import http.cookiejar, urllib.request
    cj = http.cookiejar.CookieJar()
    opener = urllib.request.build_opener(urllib.request.HTTPCookieProcessor(cj))
    r = opener.open("http://localhost:44020/")

The popular requests library was also vulnerable without any additional
options (as it uses http.cookiejar by default):

    import requests
    requests.get("http://localhost:44020/")

* Regression test for http.cookiejar REDoS

If we regress, this test will take a very long time.

* Improve performance of http.cookiejar.ISO_DATE_RE

A string like

"444444" + (" " * 2000) + "A"

could cause poor performance due to the 2 overlapping \s* groups,
although this is not as serious as the REDoS in LOOSE_HTTP_DATE_RE was.
(cherry picked from commit 1b779bfb85)

Co-authored-by: bcaller <bcaller@users.noreply.github.com>
2019-11-22 06:42:06 -08:00
Lisa Roach b2744c1be7 [3.8] bpo-38857: AsyncMock fix for awaitable values and StopIteration fix [3.8] (GH-17269) (#17304)
(cherry picked from commit 046442d02b)

Co-authored-by: Jason Fried <fried@fb.com>
2019-11-21 20:14:32 +02:00
Miss Islington (bot) 9458c5c42b
bpo-37838: get_type_hints for wrapped functions with forward reference (GH-17126)
https://bugs.python.org/issue37838
(cherry picked from commit 0aca3a3a1e)

Co-authored-by: benedwards14 <53377856+benedwards14@users.noreply.github.com>
2019-11-21 09:43:42 -08:00
Miss Islington (bot) 767b42633b
bpo-38875: test_capi: trashcan tests require cpu resource (GH-17314)
test_capi: trashcan tests now require the test "cpu" resource.
(cherry picked from commit 0127bb1c5c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-11-21 04:11:44 -08:00
Miss Islington (bot) b762375ba2
bpo-38841: Skip asyncio test_create_datagram_endpoint_existing_sock_unix (GH-17294)
on platforms lacking a functional bind() for named unix domain sockets

https://bugs.python.org/issue38841

Automerge-Triggered-By: @asvetlov
(cherry picked from commit 559bad1a70)

Co-authored-by: xdegaye <xdegaye@gmail.com>
2019-11-20 12:20:25 -08:00
Miss Islington (bot) 836f137f7a
bpo-38821: Fix crash in argparse when using gettext (GH-17192)
(cherry picked from commit be5c79e033)

Co-authored-by: Federico Bond <federicobond@gmail.com>
2019-11-20 05:48:25 -08:00
Miss Islington (bot) 132243957c
bpo-38636: Fix IDLE tab toggle and file indent width (GH-17008)
These Format menu functions (default shortcuts Alt-T and Alt-U)
were mistakenly disabled in 3.7.5 and 3.8.0.
(cherry picked from commit b8462477bf)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-11-19 22:37:47 -08:00
Miss Islington (bot) 829593a926
bpo-38707: Fix for multiprocessing.Process MainThread.native_id (GH-17088)
This PR implements a fix for `multiprocessing.Process` objects; the error occurs when Processes are created using either `fork` or `forkserver` as the `start_method`.

In these instances, the `MainThread` of the newly created `Process` object retains all attributes from its parent's `MainThread` object, including the `native_id` attribute. The resulting behavior is such that the new process' `MainThread` captures an incorrect/outdated `native_id` (the parent's instead of its own).

This change forces the Process object to update its `native_id` attribute during the bootstrap process.

cc @vstinner

https://bugs.python.org/issue38707

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

Co-authored-by: Jake Tesler <jake.tesler@gmail.com>
2019-11-19 12:11:20 -08:00
Miss Islington (bot) 6c3b471c8c
bpo-35409: Ignore GeneratorExit in async_gen_athrow_throw (GH-14755)
Ignore `GeneratorExit` exceptions when throwing an exception into the `aclose` coroutine of an asynchronous generator.

https://bugs.python.org/issue35409
(cherry picked from commit 8e0de2a480)

Co-authored-by: Vincent Michel <vxgmichel@gmail.com>
2019-11-19 06:12:06 -08:00
Miss Islington (bot) b5bb3b637c bpo-38807: Add os.PathLike to exception message raised by _check_arg_types (GH-17160) (GH-17249)
(cherry picked from commit fe75b62575)

Co-authored-by: Tomás Farías <tomasfariassantana@gmail.com>
2019-11-18 22:46:10 -08:00
Miss Islington (bot) e37767bee1
bpo-38722: Runpy use io.open_code() (GH-17234)
https://bugs.python.org/issue38722

Automerge-Triggered-By: @taleinat
(cherry picked from commit e243bae999)

Co-authored-by: jsnklln <jsnklln@gmail.com>
2019-11-18 13:58:02 -08:00
Miss Islington (bot) 47db7439dd
bpo-38622: Add missing audit events for ctypes module (GH-17158)
(cherry picked from commit 00923c6399)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-11-18 11:53:34 -08:00
Miss Islington (bot) cbbf1098f3
bpo-38809: Windows build scripts use python.exe from virtual envs (GH-17164)
https://bugs.python.org/issue38809
(cherry picked from commit ee703cbb41)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2019-11-18 09:53:21 -08:00
Steve Dower 66c0f01f98
bpo-38453: Ensure ntpath.realpath correctly resolves relative paths (GH-16967)
Ensure isabs() is always True for \\?\ prefixed paths
Avoid unnecessary usage of readlink() to avoid resolving broken links incorrectly
Ensure shutil tests run in test directory
2019-11-15 15:25:03 -08:00
Miss Islington (bot) a4be5aae6e
bpo-38778: Document that os.fork is not allowed in subinterpreters (GH-17123)
Small docs update for [bpo-34651](https://bugs.python.org/issue34651).

Other references to fork (e.g. the PyOS.*Fork functions or discussions of fork() when embedding Python) point back to os.fork, so I don't think any other updates are needed.

https://bugs.python.org/issue38778

Automerge-Triggered-By: @ericsnowcurrently
(cherry picked from commit b22030073b)

Co-authored-by: Phil Connell <pconnell@gmail.com>
2019-11-15 13:37:25 -08:00
Miss Islington (bot) 7a5d4c7a86
bpo-38816: Add notes in the C-API docs about fork in subinterpreters. (GH-17176)
The C-API docs are a bit sparse on the interplay between C `fork()` and the CPython runtime.  This change adds some more information on the subject.

https://bugs.python.org/issue38816
(cherry picked from commit 73cdb0c6b2)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2019-11-15 13:36:49 -08:00
Miss Islington (bot) dae27cc8e7
bpo-38351: Modernize email examples from %-formatting to f-strings (GH-17162)
(cherry picked from commit e8acc865a3)

Co-authored-by: Andrey Doroschenko <dorosch.github.io@yandex.ru>
2019-11-15 01:11:48 -08:00
Miss Islington (bot) 694c03fabb
bpo-38785: Prevent asyncio from crashing (GH-17144)
if parent `__init__` is not called from a constructor of object derived from `asyncio.Future`

https://bugs.python.org/issue38785
(cherry picked from commit dad6be5ffe)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-11-13 13:54:56 -08:00
Miss Islington (bot) a67bc10e42
bpo-4630: Add cursor no-blink option for IDLE (GH-16960)
This immediately toggles shell, editor, and output windows, but does not affect other input widgets.
(cherry picked from commit 9c2844927d)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-11-12 23:36:42 -08:00
Benjamin Peterson 9788f97bf6
[3.8] closes bpo-27805: Ignore ESPIPE in initializing seek of append-mode files. (GH-17136)
This change, which follows the behavior of C stdio's fdopen and Python 2's file object, allows pipes to be opened in append mode..
(cherry picked from commit 74fa9f723f)
2019-11-12 15:54:19 -08:00
Miss Islington (bot) 0a8e7fde06
bpo-38723: Pdb._runscript should use io.open_code() instead of open() (GH-17127)
Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
(cherry picked from commit d593881505)

Co-authored-by: jsnklln <jsnklln@gmail.com>
2019-11-12 15:09:03 -08:00
Miss Islington (bot) 8ce1a9ce03
bpo-26353: IDLE adds an unneeded newline when saving a shell window (GH-17103)
(cherry picked from commit c8b53dc3d8)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-11-12 03:13:18 -08:00
Miss Islington (bot) 7c20888e71
bpo-38684: haslib: fix build when Blake2 not enabled in OpenSSL (GH-17043)
(cherry picked from commit 6552563b3d)

Co-authored-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2019-11-05 22:10:05 -08:00
Miss Islington (bot) 4c22e1665c
closes bpo-37633: Reëxport some function compatibility wrappers for macros in ``pythonrun.h``. (GH-17056)
(cherry picked from commit 62161ce989)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2019-11-04 21:52:59 -08:00
Miss Skeleton (bot) aa1fee8ffb
bpo-38422: Clarify docstrings of pathlib suffix(es) (GH-16679)
Whenever I use `path.suffix` I have to check again whether it includes the dot or not. I decided to add it to the docstring so I won't have to keep checking.

https://bugs.python.org/issue38422

Automerge-Triggered-By: @pitrou
(cherry picked from commit 8d4fef4ee2)

Co-authored-by: Ram Rachum <ram@rachum.com>
2019-11-02 10:04:10 -07:00
Miss Skeleton (bot) dcb338ea1b
bpo-38640: Allow break and continue in always false while loops (GH-16992)
(cherry picked from commit 6c3e66a34b)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-10-30 05:11:41 -07:00
Miss Skeleton (bot) 3801b2699e
bpo-36993: Improve error reporting for zipfiles with bad zip64 extra data. (GH-14656)
(cherry picked from commit da6ce58dd5)

Co-authored-by: Daniel Hillier <daniel.hillier@gmail.com>
2019-10-29 00:44:07 -07:00
Miss Skeleton (bot) 2267cb9da4
bpo-38589: Fixes HTML Help shortcut when Windows is not installed to C drive (GH-16968)
(cherry picked from commit 0ac6137dd3)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-10-28 14:55:10 -07:00
Miss Skeleton (bot) 07eee640cb
bpo-38519: Internal include files missing on Windows (GH-16921)
(cherry picked from commit edb172a872)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-10-28 10:23:07 -07:00
Miss Skeleton (bot) 955f96f6aa bpo-38592 Add pt-br switcher to Python Docs website (GH-16924) (GH-16953)
(cherry picked from commit 85c6f8c65c)
Co-authored-by: Marco Rougeth <marco@rougeth.com>
2019-10-27 11:11:14 +01:00
Miss Skeleton (bot) 76fbdaa2a6
bpo-38334: Fix seeking backward on an encrypted zipfile.ZipExtFile. (GH-16937)
Test by Daniel Hillier.
(cherry picked from commit 5c32af7522)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-10-27 01:40:44 -07:00
Miss Skeleton (bot) e3a477aa07
bpo-38598: Do not try to compile IDLE shell or output windows (GH-16939)
(cherry picked from commit e3f90b217a)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2019-10-26 18:41:26 -07:00
Miss Skeleton (bot) ba3a566328
bpo-38535: Fix positions for AST nodes for calls without arguments in decorators. (GH-16861)
(cherry picked from commit 26ae9f6d3d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-10-26 07:06:40 -07:00
Miss Skeleton (bot) d04661f9ca
bpo-33348: parse expressions after * and ** in lib2to3 (GH-6586)
These are valid even in python 2.7

https://bugs.python.org/issue33348

Automerge-Triggered-By: @gpshead
(cherry picked from commit 96b06aefe2)

Co-authored-by: Zsolt Dollenstein <zsol.zsol@gmail.com>
2019-10-23 23:37:21 -07:00
Miss Skeleton (bot) cbf474c98e
bpo-34679: ProactorEventLoop only uses set_wakeup_fd() in main thread (GH-16901)
bpo-34679, bpo-38563: asyncio.ProactorEventLoop.close() now only calls
signal.set_wakeup_fd() in the main thread.
(cherry picked from commit 1b53a24fb4)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-10-23 08:43:57 -07:00
Miss Skeleton (bot) dbcea39ba7
bpo-37415: Fix stdatomic.h header check for ICC compiler (GH-16717)
Fix stdatomic.h header check for ICC compiler: the ICC implementation
lacks atomic_uintptr_t type which is needed by Python.

Test:

* atomic_int and atomic_uintptr_t types
* atomic_load_explicit() and atomic_store_explicit()
* memory_order_relaxed and memory_order_seq_cst constants

But don't test ATOMIC_VAR_INIT(): it's not used in Python.
(cherry picked from commit 028f7349a0)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-10-22 13:19:32 -07:00
Miss Skeleton (bot) 2f8d4f08e2
bpo-31202: Preserve case of literal parts in Path.glob() on Windows. (GH-16860)
(cherry picked from commit 10ecbadb79)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-10-21 11:17:57 -07:00
Miss Skeleton (bot) b1fc8c0c8a
bpo-38540: Fix possible leak in PyArg_Parse for "esGH-" and "etGH-". (GH-16869)
(cherry picked from commit 5bc6a7c06e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-10-21 02:12:37 -07:00
Miss Islington (bot) d73205d788
bpo-38525: Fix a segmentation fault when using reverse iterators of empty dict (GH-16846)
The reverse iterator for empty dictionaries was not handling correctly shared-key dictionaries.
(cherry picked from commit 24dc2f8c56)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2019-10-19 13:20:51 -07:00
Miss Islington (bot) 652a1cb0e1 bpo-38521: Fix error in NormalDist.__eq__() (GH-16840) (GH-16842)
(cherry picked from commit 5eabec022b)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2019-10-18 14:41:19 -07:00
Miss Islington (bot) 5fb81420d5
bpo-38418: Fixes audit event for os.system to be named 'os.system' (GH-16670)
https://bugs.python.org/issue38418

Automerge-Triggered-By: @zooba
(cherry picked from commit fbe3c76c7c)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-10-18 09:32:14 -07:00
Senthil Kumaran 0f3187c1ce
[3.8] bpo-27657: Fix urlparse() with numeric paths (GH-661) (#16839)
* bpo-27657: Fix urlparse() with numeric paths

Revert parsing decision from bpo-754016 in favor of the documented
consensus in bpo-16932 of how to treat strings without a // to
designate the netloc.

* bpo-22891: Remove urlsplit() optimization for 'http' prefixed inputs.
(cherry picked from commit 5a88d50ff0)

Co-authored-by: Tim Graham <timograham@gmail.com>
2019-10-18 08:23:14 -07:00
Miss Islington (bot) c615db608d
bpo-33604: Raise TypeError on missing hmac arg. (GH-16805)
Also updates the documentation to clarify the situation surrounding
the digestmod parameter that is required despite its position in the
argument list as of 3.8.0 as well as removing old python2 era
references to "binary strings".

We indavertently had this raise ValueError in 3.8.0 for the missing
arg.  This is not considered an API change as no reasonable code would
be catching this missing argument error in order to handle it.
(cherry picked from commit f33c57d5c7)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2019-10-17 20:48:42 -07:00
Miss Islington (bot) 7773d391f8
bpo-38492: Remove pythonw.exe dependency on the Microsoft C++ runtime (GH-16824)
(cherry picked from commit 7aebbd1182)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-10-16 10:46:29 -07:00
Miss Islington (bot) afbcd9f26d
bpo-35998: Fix test_asyncio.test_start_tls_server_1() (GH-16815)
main() is now responsible to send the ANSWER, rather than
ServerProto. main() now waits until it got the HELLO before sending
the ANSWER over the new transport.

Previously, there was a race condition between main() replacing the
protocol and the protocol sending the ANSWER once it gets the HELLO.

TLSv1.3 was disabled for the test: reenable it.
(cherry picked from commit fab4ef2df0)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-10-16 01:36:57 -07:00
Miss Islington (bot) f705f8e9b5
bpo-38478: Correctly handle keyword argument with same name as positional-only parameter (GH-16800)
(cherry picked from commit f3ef06a7cb)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-10-15 05:02:34 -07:00
Victor Stinner f82ce5b1b1
[3.8] bpo-36389: Backport debug enhancements from master (GH-16796)
* bpo-36389: _PyObject_CheckConsistency() available in release mode (GH-16612)

bpo-36389, bpo-38376: The _PyObject_CheckConsistency() function is
now also available in release mode. For example, it can be used to
debug a crash in the visit_decref() function of the GC.

Modify the following functions to also work in release mode:

* _PyDict_CheckConsistency()
* _PyObject_CheckConsistency()
* _PyType_CheckConsistency()
* _PyUnicode_CheckConsistency()

Other changes:

* _PyMem_IsPtrFreed(ptr) now also returns 1 if ptr is NULL
  (equals to 0).
* _PyBytesWriter_CheckConsistency() now returns 1 and is only used
  with assert().
* Reorder _PyObject_Dump() to write safe fields first, and only
  attempt to render repr() at the end.

(cherry picked from commit 6876257eaa)

* bpo-36389: Fix _PyBytesWriter in release mode (GH-16624)

Fix _PyBytesWriter API when Python is built in release mode with
assertions.

(cherry picked from commit 60ec6efd96)

* bpo-38070: Enhance visit_decref() debug trace (GH-16631)

subtract_refs() now pass the parent object to visit_decref() which
pass it to _PyObject_ASSERT(). So if the "is freed" assertion fails,
the parent is used in debug trace, rather than the freed object. The
parent object is more likely to contain useful information. Freed
objects cannot be inspected are are displayed as "<object at xxx is
freed>" with no other detail.

(cherry picked from commit 4d5f94b8cd)

* Fix also a typo in PYMEM_DEADBYTE macro comment

* bpo-36389: Add newline to _PyObject_AssertFailed() (GH-16629)

Add a newline between the verbose object dump and the Py_FatalError()
logs for readability.

(cherry picked from commit 7775349895)
2019-10-15 03:06:16 +02:00
Łukasz Langa fa919fdf25
v3.8.0 2019-10-14 15:34:47 +02:00
Miss Islington (bot) 927f07c816 bpo-38469: Handle named expression scope with global/nonlocal keywords (GH-16755) (#16760)
The symbol table handing of PEP572's assignment expressions is not resolving correctly the scope of some variables in presence of global/nonlocal keywords in conjunction with comprehensions.
(cherry picked from commit fd5c414880)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-10-14 13:40:15 +02:00
Miss Islington (bot) 6da52ac411
bpo-38431: Fix __repr__ method of InitVar to work with typing objects. (GH-16702)
(cherry picked from commit 793cb85437)

Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
2019-10-13 05:04:05 -07:00
Miss Islington (bot) e540bb5461
bpo-38332: Catch KeyError from unknown cte in encoded-word. (GH-16503)
KeyError should cause a failure in parsing the encoded word and should be caught and raised as a _InvalidEWError instead.
(cherry picked from commit 65dcc8a8dc)

Co-authored-by: Andrei Troie <andreitroie90@gmail.com>
2019-10-12 10:03:24 -07:00
Abhilash Raj 5a638a8055
[3.8] bpo-38449: Revert "bpo-22347: Update mimetypes.guess_type to allow oper parsing of URLs" (GH-16724) (GH-16728)
This reverts commit 87bd2071c7.

The reason for revert is a regression caused by the change in 3.8.0rc1, see bpo-38449 for more details.

https://bugs.python.org/issue38449
(cherry picked from commit 19a3d87300)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2019-10-12 09:58:11 -07:00
Miss Islington (bot) 1da648aceb
bpo-38341: Add SMTPNotSupportedError in the exports of smtplib (GH-16525)
Add SMTPNotSupportedError in the exports of smtplib

Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
(cherry picked from commit 3faf826e58)

Co-authored-by: nde <denayer.norman@gmail.com>
2019-10-12 09:08:24 -07:00
Miss Islington (bot) 73665b4147
bpo-38347: find pathfix for Python scripts whose name contain a '-' (GH-16536)
pathfix.py: Assume all files that end on '.py' are Python scripts when working recursively.
(cherry picked from commit 2b7dc40b2a)

Co-authored-by: Ruediger Pluem <r.pluem@gmx.de>
2019-10-11 06:56:49 -07:00
Miss Islington (bot) 8ab11c433a bpo-38109: Add missing constants to Lib/stat.py (GH-16665) (GH-16690)
Add missing stat.S_IFDOOR, stat.S_IFPORT, stat.S_IFWHT,
stat.S_ISDOOR, stat.S_ISPORT, and stat.S_ISWHT values to
the Python implementation of the stat module.
(cherry picked from commit 7bb14316b8)

Co-authored-by: Ronan Lamy <ronan.lamy@gmail.com>
2019-10-10 15:50:32 +02:00
Pablo Galindo 0bd9fac7a8 [3.8] bpo-38379: don't claim objects are collected when they aren't (GH-16658) (GH-16683)
* [bpo-38379](https://bugs.python.org/issue38379):  when a finalizer resurrects an object,
nothing is actually collected in this run of gc.
Change the stats to relect that truth.
(cherry picked from commit ecbf35f933)

Co-authored-by: Tim Peters <tim.peters@gmail.com>





https://bugs.python.org/issue38379



Automerge-Triggered-By: @pablogsal
2019-10-09 14:25:06 -07:00
Miss Islington (bot) 359a1975cb
bpo-37531: regrtest ignores output on timeout (GH-16659)
bpo-37531, bpo-38207: On timeout, regrtest no longer attempts to call
`popen.communicate() again: it can hang until all child processes
using stdout and stderr pipes completes. Kill the worker process and
ignores its output.

Reenable test_regrtest.test_multiprocessing_timeout().

bpo-37531: Change also the faulthandler timeout of the main process
from 1 minute to 5 minutes, for Python slowest buildbots.
(cherry picked from commit 0ec618af98)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-10-09 07:02:15 -07:00
Pablo Galindo 526ef856dd
[3.8] bpo-38395: Fix ownership in weakref.proxy methods (GH-16632) (GH-16662)
The implementation of weakref.proxy's methods call back into the Python
API using a borrowed references of the weakly referenced object
(acquired via PyWeakref_GET_OBJECT). This API call may delete the last
reference to the object (either directly or via GC), leaving a dangling
pointer, which can be subsequently dereferenced.

To fix this, claim a temporary ownership of the referenced object when
calling the appropriate method. Some functions because at the moment they
do not need to access the borrowed referent, but to protect against
future changes to these functions, ownership need to be fixed in
all potentially affected methods..
(cherry picked from commit 10cd00a9e3)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-10-08 21:38:11 +01:00
Miss Islington (bot) 10b475a151
bpo-38405: Make nested subclasses of typing.NamedTuple pickleable. (GH-16641)
(cherry picked from commit 13abda4100)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-10-08 07:12:38 -07:00
Miss Islington (bot) 364532fb49
bpo-38118: Ignore Valgrind false alarm in PyUnicode_Decode() (GH-16651)
Valgrind emits "Conditional jump or move depends on uninitialised
value(s)" false alarms on GCC builtin strcmp() function. The GCC code
is correct.

Valgrind bug: https://bugs.kde.org/show_bug.cgi?id=264936
(cherry picked from commit 03ab6b4fc6)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-10-08 06:49:12 -07:00
Miss Islington (bot) a1f45008f1
bpo-36698: IDLE no longer fails when write non-encodable characters to stderr. (GH-16583)
It now escapes them with a backslash, as the regular Python interpreter.
Added the "errors" field to the standard streams.
(cherry picked from commit b690a2759e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-10-08 04:51:16 -07:00
Miss Islington (bot) 4880e5a1b6
bpo-38344: Fix syntax in activate.bat (GH-16533)
(cherry picked from commit e310af9e29)

Co-authored-by: James Abel <j@abel.co>
2019-10-07 14:26:57 -07:00
Miss Islington (bot) b731fc521c
bpo-38294: Add list of no-longer-escaped chars to re.escape documentation. (GH-16442)
Prior to 3.7, re.escape escaped many characters that don't have
special meaning in Python, but that use to require escaping in other
tools and languages. This commit aims to make it clear which characters
were, but are no longer escaped.
(cherry picked from commit 15ae75d660)

Co-authored-by: Ricardo Bánffy <rbanffy@gmail.com>
2019-10-07 14:07:46 -07:00
Miss Islington (bot) dc191245d8
bpo-13153: Use OS native encoding for converting between Python and Tcl. (GH-16545)
On Windows use UTF-16 (or UTF-32 for 32-bit Tcl_UniChar) with the
"surrogatepass" error handler for converting to/from Tcl Unicode objects.

On Linux use UTF-8 with the "surrogateescape" error handler for converting
to/from Tcl String objects.

Converting strings from Tcl to Python and back now never fails
(except MemoryError).
(cherry picked from commit 06cb94bc84)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-10-04 03:28:54 -07:00
Miss Islington (bot) e74fa70bcc
bpo-38359: Ensures pyw.exe launcher reads correct registry key (GH-16561)
(cherry picked from commit 353fb1ecbf)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-10-03 08:51:12 -07:00
Miss Islington (bot) 6067e1d2be
bpo-38355: Fix ntpath.realpath failing on sys.executable (GH-16551)
(cherry picked from commit a0e3d27e4e)

Co-authored-by: Steve Dower <steve.dower@python.org>
2019-10-03 08:49:56 -07:00
Łukasz Langa 34214de6ab
v3.8.0rc1 2019-10-01 14:58:26 +02:00
Miss Islington (bot) 938c00ca9e bpo-38319: Fix shutil._fastcopy_sendfile(): set sendfile() max block size (GH-16491) (#16506)
(cherry picked from commit 94e165096f)

Co-authored-by: Giampaolo Rodola <g.rodola@gmail.com>
2019-10-01 09:55:02 +02:00
Victor Stinner bdace21b76 bpo-38304: Remove PyConfig.struct_size (GH-16500)
For now, we'll rely on the fact that the config structures aren't covered by the stable ABI.

We may revisit this in the future if we further explore the idea of offering a stable embedding API.
2019-10-01 08:46:42 +10:00
Miss Islington (bot) 92ca515ee1 Clear weakrefs in garbage found by the GC (GH-16495) (#16499)
Fix a bug due to the interaction of weakrefs and the cyclic garbage
collector. We must clear any weakrefs in garbage in order to prevent
their callbacks from executing and causing a crash.
(cherry picked from commit bcda460baf)

Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
2019-09-30 19:27:46 +02:00
Miss Islington (bot) 2f87a7dc5a bpo-30773: Fix ag_running; prohibit running athrow/asend/aclose in parallel (GH-7468) (#16486)
(cherry picked from commit fc4a044a3c)

Co-authored-by: Yury Selivanov <yury@magic.io>
2019-09-29 23:19:02 -07:00
Yury Selivanov 1c19d656a7
bpo-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482) (#16485)
See https://bugs.python.org/issue38242 for more details
2019-09-29 22:30:17 -07:00
Lisa Roach 21f24ead90
[3.8] bpo-38163: Child mocks detect their type as sync or async (GH-16471) (GH-16484) 2019-09-29 22:22:44 -07:00
Miss Islington (bot) 36e7e4aabb bpo-38161: Removes _AwaitEvent from AsyncMock. (GH-16443) (GH-16481) 2019-09-29 21:23:33 -07:00
Miss Islington (bot) b76ab35240 bpo-38108: Makes mock objects inherit from Base (GH-16060) (GH-16470) 2019-09-29 21:02:46 -07:00
Miss Islington (bot) c9ed9e6fc7
bpo-38317: Fix PyConfig.warnoptions priority (GH-16478)
Fix warnings options priority: PyConfig.warnoptions has the highest
priority, as stated in the PEP 587.

* Document options order in PyConfig.warnoptions documentation.
* Make PyWideStringList_INIT macro private: replace "Py" prefix
  with "_Py".
* test_embed: add test_init_warnoptions().
(cherry picked from commit fb4ae152a9)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-09-29 16:58:57 -07:00
Miss Islington (bot) 19cd5951ec
bpo-38019: correctly handle pause/resume reading of closed asyncio unix pipe (GH-16472)
(cherry picked from commit 58498bc717)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-09-29 05:20:15 -07:00
Gregory P. Smith 36c6fa9680
bpo-38115: Deal with invalid bytecode offsets in lnotab (GH-16079) (GH-16464)
Document that lnotab can contain invalid bytecode offsets (because of
terrible reasons that are difficult to fix). Make dis.findlinestarts()
ignore invalid offsets in lnotab. All other uses of lnotab in CPython
(various reimplementations of addr2line or line2addr in Python, C and gdb)
already ignore this, because they take an address to look for, instead.

Add tests for the result of dis.findlinestarts() on wacky constructs in
test_peepholer.py, because it's the easiest place to add them.

(cherry picked from commit c8165036f3)
2019-09-28 08:22:00 -07:00
Miss Islington (bot) 8f478b489a
bpo-38216, bpo-36274: Allow subclasses to separately override validation and encoding behavior (GH-16448)
* bpo-38216: Allow bypassing input validation

* bpo-36274: Also allow the URL encoding to be overridden.

* bpo-38216, bpo-36274: Add tests demonstrating a hook for overriding validation, test demonstrating override encoding, and a test to capture expectation of the interface for the URL.

* Call with skip_host to avoid tripping on the host checking in the URL.

* Remove obsolete comment.

* Make _prepare_path_encoding its own attr.

This makes overriding just that simpler.

Also, don't use the := operator to make backporting easier.

* Add a news entry.

* _prepare_path_encoding -> _encode_prepared_path()

* Once again separate the path validation and request encoding, drastically simplifying the behavior. Drop the guarantee that all processing happens in _prepare_path.
(cherry picked from commit 7774d7831e)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2019-09-28 07:23:34 -07:00
Victor Stinner 6e128382b3
bpo-38304: Add PyConfig.struct_size (GH-16451) (GH-16453)
Add a new struct_size field to PyPreConfig and PyConfig structures to
allow to modify these structures in the future without breaking the
backward compatibility.

* Replace private _config_version field with public struct_size field
  in PyPreConfig and PyConfig.
* Public PyPreConfig_InitIsolatedConfig() and
  PyPreConfig_InitPythonConfig()
  return type becomes PyStatus, instead of void.
* Internal _PyConfig_InitCompatConfig(),
  _PyPreConfig_InitCompatConfig(), _PyPreConfig_InitFromConfig(),
  _PyPreConfig_InitFromPreConfig() return type becomes PyStatus,
  instead of void.
* Remove _Py_CONFIG_VERSION
* Update the Initialization Configuration documentation.

(cherry picked from commit 441b10cf28)
2019-09-28 04:50:43 +02:00
Miss Islington (bot) 8750bce988 bpo-38301: In Solaris family, we must be sure to use '-D_REENTRANT' (GH-16446) (#16449)
(cherry picked from commit 52d1b86bde)

Co-authored-by: Jesús Cea <jcea@jcea.es>
2019-09-28 04:20:31 +02:00
Lisa Roach 52bdd414ed
[3.8] bpo-38136: Updates await_count and call_count to be different things (GH-16192) (GH-16431) 2019-09-27 15:44:34 -07:00
Miss Islington (bot) 6447b9f9bd
bpo-38243, xmlrpc.server: Escape the server_title (GH-16373)
Escape the server title of xmlrpc.server.DocXMLRPCServer
when rendering the document page as HTML.
(cherry picked from commit e8650a4f8c)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2019-09-27 13:19:41 -07:00
Christian Heimes 1931132db3
[3.8] bpo-38275: Skip ssl tests for disabled versions (GH-16386) (GH-16425)
test_ssl now handles disabled TLS/SSL versions better. OpenSSL's crypto
policy and run-time settings are recognized and tests for disabled versions
are skipped.

Signed-off-by: Christian Heimes <christian@python.org>

https://bugs.python.org/issue38275
(cherry picked from commit df6ac7e2b8)
2019-09-26 22:53:09 +02:00
Miss Islington (bot) c989340065
bpo-38239: Fix test_gdb for Link Time Optimization (LTO) (GH-16422)
(cherry picked from commit 64b4a3a2de)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-09-26 08:13:39 -07:00
Victor Stinner 96c8475362
[3.8] bpo-38234: Backport init path config changes from master (GH-16423)
* bpo-38234: Py_SetPath() uses the program full path (GH-16357)

Py_SetPath() now sets sys.executable to the program full path
(Py_GetProgramFullPath()), rather than to the program name
(Py_GetProgramName()).

Fix also memory leaks in pathconfig_set_from_config().

(cherry picked from commit 1ce152a42e)

* bpo-38234: Add tests for Python init path config (GH-16358)


(cherry picked from commit bb6bf7d342)

* bpo-38234: test_embed: test pyvenv.cfg and pybuilddir.txt (GH-16366)

Add test_init_pybuilddir() and test_init_pyvenv_cfg() to test_embed
to test pyvenv.cfg and pybuilddir.txt configuration files.

Fix sysconfig._generate_posix_vars(): pybuilddir.txt uses UTF-8
encoding, not ASCII.

(cherry picked from commit 52ad33abbf)

* bpo-38234: Cleanup getpath.c (GH-16367)

* search_for_prefix() directly calls reduce() if found is greater
  than 0.
* Add calculate_pybuilddir() subfunction.
* search_for_prefix(): add path string buffer for readability.
* Fix some error handling code paths: release resources on error.
* calculate_read_pyenv(): rename tmpbuffer to filename.
* test.pythoninfo now also logs windows.dll_path

(cherry picked from commit 221fd84703)

* bpo-38234: Fix test_embed pathconfig tests (GH-16390)

bpo-38234: On macOS and FreeBSD, the temporary directory can be
symbolic link. For example, /tmp can be a symbolic link to /var/tmp.
Call realpath() to resolve all symbolic links.

(cherry picked from commit 00508a7407)

* bpo-38234: Add test_init_setpath_config() to test_embed (GH-16402)

* Add test_embed.test_init_setpath_config(): test Py_SetPath()
  with PyConfig.
* test_init_setpath() and test_init_setpythonhome() no longer call
  Py_SetProgramName(), but use the default program name.
* _PyPathConfig: isolated, site_import  and base_executable
  fields are now only available on Windows.
* If executable is set explicitly in the configuration, ignore
  calculated base_executable: _PyConfig_InitPathConfig() copies
  executable to base_executable.
* Complete path config documentation.

(cherry picked from commit 8bf39b606e)

* bpo-38234: Complete init config documentation (GH-16404)


(cherry picked from commit 88feaecd46)

* bpo-38234: Fix test_embed.test_init_setpath_config() on FreeBSD (GH-16406)

Explicitly preinitializes with a Python preconfiguration to avoid
Py_SetPath() implicit preinitialization with a compat
preconfiguration.

Fix also test_init_setpath() and test_init_setpythonhome() on macOS:
use self.test_exe as the executable (and base_executable), rather
than shutil.which('python3').

(cherry picked from commit 49d99f01e6)

* bpo-38234: Py_Initialize() sets global path configuration (GH-16421)

* Py_InitializeFromConfig() now writes PyConfig path configuration to
  the global path configuration (_Py_path_config).
* Add test_embed.test_get_pathconfig().
* Fix typo in _PyWideStringList_Join().

(cherry picked from commit 12f2f177fc)
2019-09-26 16:17:34 +02:00
Benjamin Peterson d75bf44a28
[3.8] closes bpo-38174: Update vendored expat library to 2.2.8. (GH-16409)
Fixes CVE-2019-15903. See full changelog at https://github.com/libexpat/libexpat/blob/R_2_2_8/expat/Changes.
(cherry picked from commit 52b9408038)
2019-09-25 21:57:14 -07:00
Miss Islington (bot) 4267e8f72a
bpo-38271: encrypt private key test files with AES256 (GH-16385)
The private keys for test_ssl were encrypted with 3DES in traditional
PKCSGH-5 format. 3DES and the digest algorithm of PKCSGH-5 are blocked by
some strict crypto policies. Use PKCSGH-8 format with AES256 encryption
instead.

Signed-off-by: Christian Heimes <christian@python.org>

https://bugs.python.org/issue38271

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

Co-authored-by: Christian Heimes <christian@python.org>
2019-09-25 09:13:54 -07:00
Miss Islington (bot) 66cd041df8
[3.8] bpo-38270: Check for hash digest algorithms and avoid MD5 (GH-16382) (GH-16393)
Make it easier to run and test Python on systems with restrict crypto policies:

* add requires_hashdigest to test.support to check if a hash digest algorithm is available and working
* avoid MD5 in test_hmac
* replace MD5 with SHA256 in test_tarfile
* mark network tests that require MD5 for MD5-based digest auth or CRAM-MD5


https://bugs.python.org/issue38270
(cherry picked from commit c64a1a61e6)


Co-authored-by: Christian Heimes <christian@python.org>


https://bugs.python.org/issue38270



Automerge-Triggered-By: @tiran
2019-09-25 08:50:31 -07:00
Michael Felt e4be8c984d bpo-36210: correct logic in setup.py for optional extensions for AIX (GH-12202) (GH-16376) 2019-09-25 10:14:09 -04:00
Victor Stinner c71c54c626
bpo-37064: Add -k and -a options to pathfix.py tool (GH-16387)
* bpo-37064: Add option -k to Tools/scripts/pathfix.py (GH-15548)

Add flag -k to pathscript.py script: preserve shebang flags.

(cherry picked from commit 50254ac4c1)

* bpo-37064: Add option -a to pathfix.py tool (GH-15717)

Add option -a to Tools/Scripts/pathfix.py script: add flags.

(cherry picked from commit 1dc1acbd73)
2019-09-25 15:22:40 +02:00
Miss Islington (bot) 16cec136b7 bpo-38248: Fix inconsistent immediate asyncio.Task cancellation (GH-16330) (GH-16383)
(cherry picked from commit edad4d89e3)

Co-authored-by: Yury Selivanov <yury@edgedb.com>
2019-09-25 04:48:52 -07:00
Miss Islington (bot) 1a17a054f6
[3.8] bpo-36871: Handle spec errors in assert_has_calls (GH-16005) (GH-16364)
The fix in PR 13261 handled the underlying issue about the spec for specific methods not being applied correctly, but it didn't fix the issue that was causing the misleading error message.

The code currently grabs a list of responses from _call_matcher (which may include exceptions). But it doesn't reach inside the list when checking if the result is an exception. This results in a misleading error message when one of the provided calls does not match the spec.


https://bugs.python.org/issue36871



Automerge-Triggered-By: @gpshead
(cherry picked from commit b5a7a4f0c2)


Co-authored-by: Samuel Freilich <sfreilich@google.com>


https://bugs.python.org/issue36871



Automerge-Triggered-By: @gpshead
2019-09-24 17:29:17 -07:00
Miss Islington (bot) 081641fe52
bpo-37123: multiprocessing test_mymanager() accepts SIGTERM (GH-16349)
Multiprocessing test test_mymanager() now also expects -SIGTERM, not
only exitcode 0.

bpo-30356: BaseManager._finalize_manager() sends SIGTERM to the
manager process if it takes longer than 1 second to stop, which
happens on slow buildbots.
(cherry picked from commit b0e1ae5f54)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-09-24 05:39:47 -07:00
Miss Islington (bot) fea9ca1b0c
bpo-38212: Increase MP test_queue_feeder_donot_stop_onexc() timeout (GH-16348)
Multiprocessing tests: increase test_queue_feeder_donot_stop_onexc()
timeout from 1 to 60 seconds.
(cherry picked from commit 99799c7220)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-09-24 04:07:28 -07:00
Victor Stinner 3f5409a3f1
bpo-38234: Fix _PyConfig_InitPathConfig() (GH-16335) (GH-16336)
* _PyConfig_InitPathConfig() now starts by copying the global path
  configuration, and then override values set in PyConfig.
* _PyPathConfig_Calculate() implementations no longer override
  _PyPathConfig fields which are already computed. For example,
  if _PyPathConfig.prefix is not NULL, leave it unchanged.
* If Py_SetPath() has been called, _PyConfig_InitPathConfig() doesn't
  call _PyPathConfig_Calculate() anymore.
* _PyPathConfig_Calculate() no longer uses PyConfig,
  except to initialize PyCalculatePath structure.
* pathconfig_calculate(): remove useless temporary
  "_PyPathConfig new_config" variable.
* calculate_module_search_path(): remove hack to workaround memory
  allocation failure, call Py_FatalError() instead.
* Fix get_program_full_path(): handle memory allocation failure.

(cherry picked from commit 9c42f8cda5)
2019-09-23 19:50:27 +02:00