Commit Graph

23123 Commits

Author SHA1 Message Date
Miss Islington (bot) 1813d318fd
bpo-41094: Fix decoding errors with audit when open files. (GH-21095)
(cherry picked from commit 6c6810d989)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-06-24 09:45:38 -07:00
Miss Islington (bot) adf8708c44
bpo-41005: Fixed perrmission error (GH-20936) (GH-21052)
* fixed issue 41005: webbrowser fails when xdg-settings cannot be executed

Co-authored-by: KrishnaSai2020 <krishnasai.chivukula@gmal.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 9e27bc0c1e)

Co-authored-by: Krishna Chivukula <63070026+KrishnaSai2020@users.noreply.github.com>

Co-authored-by: Krishna Chivukula <63070026+KrishnaSai2020@users.noreply.github.com>
2020-06-24 14:58:27 +02:00
Anthony Sottile 60cbdc81d1
[3.8] bpo-31938: Fix default-value signatures of several functions in the select module (GH-21066) (GH-21098)
(cherry picked from commit d051801052)

Automerge-Triggered-By: @vstinner
2020-06-23 15:17:02 -07:00
Miss Islington (bot) c6e24e7420
bpo-41085: Fix array.array.index() on 64-bit Windows (GH-21071)
Fix integer overflow in the :meth:`array.array.index` method on 64-bit Windows
for index larger than ``2**31``.
(cherry picked from commit 1d3dad5f96)

Co-authored-by: WildCard65 <WildCard65@users.noreply.github.com>
2020-06-23 06:40:47 -07:00
Miss Islington (bot) d7f37d1ed4
bpo-41068: Fix read after write in zipfile for non-ASCII files names. (GH-21040)
(cherry picked from commit 36ff513f82)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-06-22 01:40:05 -07:00
Miss Islington (bot) b99824a8e1
bpo-40824: Do not mask errors in __iter__ in "in" and the operator module. (GH-20537)
Unexpected errors in calling the __iter__ method are no longer
masked by TypeError in the "in" operator and functions
operator.contains(), operator.indexOf() and operator.countOf().
(cherry picked from commit cafe1b6e9d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-06-22 01:21:04 -07:00
Miss Islington (bot) d5ee9b9940
bpo-41056: Fix reference to deallocated stack in pathconfig (Coverity) (GH-21013)
Reported by Coverity.  (CID 1457554 RETURN_LOCAL)

path0 is assigned as a pointer to this right before it goes out of scope.
(cherry picked from commit 81328f3070)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2020-06-22 00:43:41 -07:00
Miss Islington (bot) 14195597b3
bpo-41058: Use source file encoding in pdb.find_function(). (GH-21010)
(cherry picked from commit 19fcffa927)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-06-21 12:36:23 -07:00
Miss Islington (bot) 10bf6e4823
bpo-41056: Fix a NULL pointer dereference on MemoryError within the ssl module. (GH-21009)
Detected by Coverity.
(cherry picked from commit eb0d5c38de)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2020-06-21 12:11:29 -07:00
Victor Stinner e8056180a1
bpo-38377: Add support.skip_if_broken_multiprocessing_synchronize() (GH-20944) (GH-20962) (GH-20966)
On Linux, skip tests using multiprocessing if the current user cannot
create a file in /dev/shm/ directory. Add the
skip_if_broken_multiprocessing_synchronize() function to the
test.support module.

(cherry picked from commit ddbeb2f3e0)
(cherry picked from commit b1e7361134)
2020-06-18 18:56:43 +02:00
Victor Stinner 3d974b2fc6
bpo-41003: Fix test_copyreg when numpy is installed (GH-20935) (GH-20945) (GH-20946)
Fix test_copyreg when numpy is installed: test.pickletester now
saves/restores warnings.filters when importing numpy, to ignore
filters installed by numpy.

Add the save_restore_warnings_filters() function to the
test.support.warnings_helper module.

(cherry picked from commit 8362893e3f)
(cherry picked from commit b39d41ba1b)
2020-06-17 19:09:49 +02:00
Ned Deily e63cc2f646
bpo-38488: Upgrade bundled versions of pip & setuptools (GH-20491) (GH-20900)
Co-authored-by: Xavier Fernandez <xav.fernandez@gmail.com>
2020-06-15 17:42:22 -04:00
Miss Islington (bot) a1d3be4623
bpo-40448: ensurepip: Do not use cache (GH-19812)
ensurepip optionally installs or upgrades 'pip' and 'setuptools' using
the version of those modules bundled with Python.  The internal PIP
installation routine by default temporarily uses its cache, if it
exists.  This is undesirable as Python builds and installations may be
independent of the user running the build, whilst PIP cache location
is dependent on the user's environment and outside of the build
environment.

At the same time, there's no value in using the cache while installing
bundled modules.

This change disables PIP caching when used in ensurepip.
(cherry picked from commit 4a3a682b12)

Co-authored-by: Krzysztof Konopko <kkonopko@users.noreply.github.com>
2020-06-15 10:45:21 -07:00
Miss Islington (bot) c72b7f703e
bpo-34226: fix cgi.parse_multipart without content_length (GH-8530)
In Python 3.7 the behavior of parse_multipart changed requiring CONTENT-LENGTH
header, this fix remove this header as required and fix FieldStorage
read_lines_to_outerboundary, by not using limit when it's negative,
since by default it's -1 if not content-length and keeps substracting what
was read from the file object.

Also added a test case for this problem.
(cherry picked from commit d8cf3514dd)

Co-authored-by: roger <rogerduran@gmail.com>
2020-06-15 08:51:35 -07:00
Miss Islington (bot) 811e040b6e
bpo-40855: Fix ignored mu and xbar parameters (GH-20835) (GH-20863) 2020-06-13 16:57:17 -07:00
Miss Islington (bot) a8936fa5c0
bpo-40957: Fix refleak in _Py_fopen_obj() (GH-20827)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 9672912e8f)

Co-authored-by: Christian Heimes <christian@python.org>
2020-06-13 09:15:05 -07:00
Miss Islington (bot) 26db10a431
bpo-40834: Fix truncate when sending str object with channel (GH-20555)
(cherry picked from commit 29c117202e)

Co-authored-by: An Long <aisk@users.noreply.github.com>
2020-06-13 05:44:50 -07:00
Steve Dower 7e57c367d6
bpo-40164: Update Windows OpenSSL to 1.1.1g (GH-20834)
Co-authored-by: Srinivas Reddy Thatiparthy (శ్రీనివాస్  రెడ్డి తాటిపర్తి) <thatiparthysreenivas@gmail.com>
2020-06-12 22:14:53 +01:00
Christian Heimes adce133378
bpo-40964: disable remote IMAP tests (GH-20836)
Remote host cyrus.andrew.cmu.edu is blocking incoming connections and is
causing test suite to fail.

Signed-off-by: Christian Heimes <christian@python.org>
2020-06-12 15:08:32 -04:00
Miss Islington (bot) a3d6d23a92
bpo-40626: Support HDF5 in mimetypes (GH-20042)
Add hdf5 with .h5 file extension

See 'Recommendations' section for mime types from the HDF group:  https://www.hdfgroup.org/2018/06/citations-for-hdf-data-and-software/

Patch by Mark Schwab.
(cherry picked from commit 60c2a810e3)

Co-authored-by: MARK SCHWAB <32745414+schwabm@users.noreply.github.com>
2020-06-11 12:32:37 -07:00
Miss Islington (bot) 3e499cda47
bpo-29620: iterate over a copy of sys.modules (GH-4800) (GH-20816)
unittest.TestCase.assertWarns no longer raises a RuntimeException
when accessing a module's ``__warningregistry__`` causes importation of a new
module, or when a new module is imported in another thread.
(cherry picked from commit 46398fba4d)

Co-authored-by: kernc <kerncece@gmail.com>
2020-06-11 14:31:46 -04:00
Miss Islington (bot) 5b8e3a5335
bpo-34401: Fix test_gdb for HP GDB version string (GH-20804)
The GDB provided by HPE on HP-UX contains a modified version string. Therefore
the tests fail. Adapt the regex to match that string.

Patch by Michael Osipov.

Co-Authored-by: Michael Osipov <michael.osipov@siemens.com>
(cherry picked from commit b2dca49ca3)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-06-11 07:07:39 -07:00
Miss Islington (bot) 264e4fd961
bpo-40741: Update macOS installer to use SQLite 3.32.2. (GH-20705)
(cherry picked from commit 37eed5a9ee)

Co-authored-by: Ned Deily <nad@python.org>
2020-06-07 19:43:35 -07:00
Miss Islington (bot) 83a9ba4426
bpo-40870: Invalidate usage of some constants with ast.Name (GH-20649)
(cherry picked from commit 68874a8502)

Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
2020-06-06 10:04:47 -07:00
Shantanu f7ed4d4e83
bpo-40614: Respect feature version for f-string debug expressions (GH-20196) (GH-20466)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
(cherry picked from commit c116c94ff1)
2020-06-06 11:08:48 +01:00
Miss Islington (bot) c067183605
bpo-40807: Show warnings once from codeop._maybe_compile (GH-20486)
* bpo-40807: Show warnings once from codeop._maybe_compile

* Move catch_warnings

* news

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 052d3fc090)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2020-06-06 01:24:45 -07:00
Victor Stinner 6f7346bb39
[3.9] bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20613) (GH-20616)
* bpo-40826: Fix GIL usage in PyOS_Readline() (GH-20579)

Fix GIL usage in PyOS_Readline(): lock the GIL to set an exception.

Pass tstate to my_fgets() and _PyOS_WindowsConsoleReadline(). Cleanup
these functions.

(cherry picked from commit c353764fd5)

* bpo-40826: Add _PyOS_InterruptOccurred(tstate) function (GH-20599)

my_fgets() now calls _PyOS_InterruptOccurred(tstate) to check for
pending signals, rather calling PyOS_InterruptOccurred().

my_fgets() is called with the GIL released, whereas
PyOS_InterruptOccurred() must be called with the GIL held.

test_repl: use text=True and avoid SuppressCrashReport in
test_multiline_string_parsing().

Fix my_fgets() on Windows: fgets(fp) does crash if fileno(fp) is closed.

(cherry picked from commit fa7ab6aa0f)
2020-06-03 18:28:18 +02:00
Miss Islington (bot) 5b8787ef19
bpo-40767: Allow pure Wayland to get default XDG web browser (GH-20382)
Would be nice to backport to python 3.7+. I don't think it's worth the hassle to backport this all the way down to 3.10. But I'll let the maintainers decide.

This is hard to test because the test setup already includes this [environment variable](https://github.com/python/cpython/blob/master/Lib/test/pythoninfo.pyGH-L292)

Let me know if something doesn't match the PR guidelines. This is my first PR in the python source code.
(cherry picked from commit c822efeda9)

Co-authored-by: Jeremy Attali <jeremy.attali@gmail.com>
2020-06-03 06:02:33 -07:00
Miss Islington (bot) 9c0ff178a5
bpo-30008: Fix OpenSSL no-deprecated compilation (GH-20397)
Fix :mod:`ssl`` code to be compatible with OpenSSL 1.1.x builds that use
``no-deprecated`` and ``--api=1.1.0``.

Note: Tests assume full OpenSSL API and fail with limited API.

Signed-off-by: Christian Heimes <christian@python.org>
Co-authored-by: Mark Wright <gienah@gentoo.org>
(cherry picked from commit a871f692b4)

Co-authored-by: Christian Heimes <christian@python.org>
2020-06-01 00:17:16 -07:00
Miss Islington (bot) 3dcccd1186
bpo-39885: Make IDLE context menu cut and copy work again (GH-18951)
Leave selection when right click within.  This exception to clearing selections when right-clicking was omitted from the previous commit, 4ca060d.  I did not realize that this completely disabled the context menu entries, and  I should have merged a minimal fix immediately.  An automated test should follow.
(cherry picked from commit 97e4e0f53d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-05-29 16:13:00 -07:00
Andrew Kuchling b86636bff4
[3.8] bpo-25872: Fix KeyError in linecache when multithreaded (GH-18007) (GH-20092)
Backporting to 3.8 and adding a NEWS item (I should have added one to the master branch -- oh well).
2020-05-29 04:59:44 -07:00
Miss Islington (bot) 6381ee077d
bpo-39040: Fix parsing of email mime headers with whitespace between encoded-words. (gh-17620)
* bpo-39040: Fix parsing of email headers with encoded-words inside a quoted string.

It is fairly common to find malformed mime headers (especially content-disposition
headers) where the parameter values, instead of being encoded to RFC
standards, are "encoded" by doing RFC 2047 "encoded word" encoding, and
then enclosing the whole thing in quotes.  The processing of these malformed
headers was incorrectly leaving the spaces between encoded words in the decoded
text (whitespace between adjacent encoded words is supposed to be stripped on
decoding).  This changeset fixes the encoded word processing inside quoted strings
(bare-quoted-string) to do correct RFC 2047 decoding by stripping that
whitespace.
(cherry picked from commit 21017ed904)

Co-authored-by: Abhilash Raj <maxking@users.noreply.github.com>
2020-05-29 04:43:27 -07:00
Miss Islington (bot) 45ce0dbc4f
bpo-40795: ctypes calls unraisablehook with an exception (GH-20452)
If ctypes fails to convert the result of a callback or if a ctypes
callback function raises an exception, sys.unraisablehook is now
called with an exception set. Previously, the error was logged into
stderr by PyErr_Print().
(cherry picked from commit 10228bad04)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-05-27 15:56:36 -07:00
Miss Islington (bot) b5ecbf02e4
bpo-40025: Require _generate_next_value_ to be defined before members(GH-19763)
require `_generate_next_value_` to be defined before members
2020-05-27 13:12:08 -07:00
Miss Islington (bot) a285af7e62
bpo-13097: ctypes: limit callback to 1024 arguments (GH-19914)
ctypes now raises an ArgumentError when a callback
is invoked with more than 1024 arguments.

The ctypes module allocates arguments on the stack in
ctypes_callproc() using alloca(), which is problematic
when large numbers of arguments are passed. Instead
of a stack overflow, this commit raises an ArgumentError
if more than 1024 parameters are passed.
(cherry picked from commit 29a1384c04)

Co-authored-by: Sean Gillespie <sean@swgillespie.me>
2020-05-27 08:53:03 -07:00
Miss Islington (bot) 75635c6095
bpo-39073: validate Address parts to disallow CRLF (GH-19007)
Disallow CR or LF in email.headerregistry.Address arguments to guard against header injection attacks.
(cherry picked from commit 614f17211c)

Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>
2020-05-27 06:37:40 -07:00
Miss Islington (bot) 285ff63351
bpo-39244: multiprocessing return default start method first on macOS (GH-18625)
(cherry picked from commit db098bc1f0)

Co-authored-by: idomic <michael.ido@gmail.com>
2020-05-26 08:13:59 -07:00
Zackery Spytz 5ff5edfef6
[3.8] bpo-35714: Reject null characters in struct format strings (GH-16928) (GH-20419)
struct.error is now raised if there is a null character in a struct
format string.
(cherry picked from commit 3f59b55316)
2020-05-26 11:57:09 +03:00
Miss Islington (bot) 5c1d745da5
bpo-39830: Add zipfile.Path to __all__ (GH-19115) (GH-19116)
(cherry picked from commit 9a81ab107a)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-05-26 02:44:57 -04:00
Miss Islington (bot) 907ee1f14a
bpo-36290: Fix keytword collision handling in AST node constructors (GH-12382)
(cherry picked from commit c73914a562)

Co-authored-by: Rémi Lapeyre <remi.lapeyre@lenstra.fr>
2020-05-24 14:31:47 -07:00
Miss Islington (bot) a64df485a4
bpo-40723: Make IDLE autocomplete test run without __main__.__file__ (GH-20311)
This was the only failure running unittest.main(test.test_idle) after imports.
(cherry picked from commit 905b3cd05f)

Co-authored-by: Florian Dahlitz <f2dahlitz@freenet.de>
2020-05-24 04:08:04 -07:00
Batuhan Taskaya a4d219b35e
[3.8] bpo-40663: Correctly handle annotations with subscripts in ast_unparse.c (GH-20156). (GH-20191)
(cherry picked from commit 2135e10dc7)

Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
2020-05-22 23:32:40 +01:00
Miss Islington (bot) 381ceeaa59
bpo-39631: Adds NEWS entry (GH-20227)
(cherry picked from commit 92327a9913)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-05-19 15:19:26 -07:00
Miss Islington (bot) 560d643661
bpo-40677: Define IO_REPARSE_TAG_APPEXECLINK explicitly (GH-20206)
This allows building with older versions of the Windows SDK where the value is not defined.
(cherry picked from commit 711f9e180a)

Co-authored-by: Minmin Gong <gongminmin@msn.com>
2020-05-19 05:39:06 -07:00
Miss Islington (bot) ab9d9535aa
bpo-40650: Include winsock2.h in pytime.c, instead of a full windows.h (GH-20137)
(cherry picked from commit f660567937)

Co-authored-by: Minmin Gong <gongminmin@msn.com>
2020-05-18 09:42:14 -07:00
Miss Islington (bot) ddd5bbdeec
bpo-40653: Move _dirnameW out of GH-ifdef HAVE_SYMLINK/GH-endif (GH-20144)
(cherry picked from commit 7f21c9ac87)

Co-authored-by: Minmin Gong <gongminmin@msn.com>
2020-05-18 09:36:02 -07:00
Miss Islington (bot) 94d9c5e5af
bpo-39148: enable ipv6 for datagrams in Proactor (GH-19121)
Ifdef is not necessary, as AF_INET6 is supported from Windows Vista, and other code in overlapped.c uses AF_INET6 and is not ifdef'd.
Change the raised exception so users are not fooled to think it comes from Windows API.

Automerge-Triggered-By: @njsmith
(cherry picked from commit 442634c42f)

Co-authored-by: Kjell Braden <afflux@pentabarf.de>
2020-05-17 23:42:25 -07:00
Miss Islington (bot) c1f1ddf30a
bpo-40597: email: Use CTE if lines are longer than max_line_length consistently (gh-20038) (gh-20084)
raw_data_manager (default for EmailPolicy, EmailMessage)
does correct wrapping of 'text' parts as long as the message contains
characters outside of 7bit US-ASCII set: base64 or qp
Content-Transfer-Encoding is applied if the lines would be too long
without it.  It did not, however, do this for ascii-only text,
which could result in lines that were longer than
policy.max_line_length or even the rfc 998  maximum.

This changeset fixes the heuristic so that if lines are longer than
policy.max_line_length, it will always apply a
content-transfer-encoding so that the lines are wrapped correctly.
(cherry picked from commit 6f2f475d5a)

Co-authored-by: Arkadiusz Hiler <arek.l1@gmail.com>
2020-05-17 20:57:42 -04:00
Miss Islington (bot) a669443dfb
bpo-40457: Support OpenSSL without TLS 1.0/1.1 (GH-19862)
OpenSSL can be build without support for TLS 1.0 and 1.1. The ssl module
now correctly adheres to OPENSSL_NO_TLS1 and OPENSSL_NO_TLS1_1 flags.

Also update multissltest to test with latest OpenSSL and LibreSSL
releases.

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

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

Co-authored-by: Christian Heimes <christian@python.org>
2020-05-16 01:33:42 -07:00
Miss Islington (bot) fcea08059f
bpo-40163: Fix multissltest download of old OpenSSL (GH-19329)
(cherry picked from commit 938717fd04)

Co-authored-by: Christian Heimes <christian@python.org>
2020-05-15 13:55:45 -07:00
Christian Heimes 387c7441f5 [3.8] bpo-40515: Require OPENSSL_THREADS (GH-19953) (GH-20119) 2020-05-15 22:36:51 +02:00
Miss Islington (bot) 5a06cf01ec
bpo-40479: Test with latest OpenSSL versions (GH-20108)
* 1.0.2u (EOL)
* 1.1.0l (EOL)
* 1.1.1g
* 3.0.0-alpha2 (disabled for now)

Build the FIPS provider and create a FIPS configuration file for OpenSSL
3.0.0.

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

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

Co-authored-by: Christian Heimes <christian@python.org>
2020-05-15 10:10:15 -07:00
Miss Islington (bot) 4e6545b002
bpo-40055: test_distutils leaves warnings filters unchanged (GH-20095)
distutils.tests now saves/restores warnings filters to leave them
unchanged. Importing tests imports docutils which imports
pkg_resources which adds a warnings filter.
(cherry picked from commit 6e57237faf)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-05-15 09:25:00 -07:00
Łukasz Langa 6f8c8320e9
Python 3.8.3 2020-05-13 19:31:54 +02:00
Miss Islington (bot) a63c611685
bpo-40561: Add docstrings for webbrowser open functions (GH-19999)
Co-authored-by: Brad Solomon <brsolomon@deloitte.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit ef7973a981)

Co-authored-by: Brad Solomon <brad.solomon.1124@gmail.com>
2020-05-11 12:09:10 -07:00
Miss Islington (bot) 0e4a5e96f0
[3.8] bpo-40559: Add Py_DECREF to _asynciomodule.c:task_step_impl() (GH-19990)
This fixes a possible memory leak in the C implementation of
asyncio.Task.
(cherry picked from commit d2c349b190)

Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
2020-05-08 04:28:38 -07:00
Miss Islington (bot) bce4ddafdd
bpo-40527: Fix command line argument parsing (GH-19955)
(cherry picked from commit 2668a9a5aa)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-05-06 06:43:09 -07:00
Robert Rouhani a32587a60d
[3.8] bpo-40417: Fix deprecation warning in PyImport_ReloadModule (GH-19750) (GH-19934)
Automerge-Triggered-By: @brettcannon.
(cherry picked from commit f40bd466bf)

Co-authored-by: Robert Rouhani <robert.rouhani@gmail.com>
2020-05-05 17:32:14 -07:00
Miss Islington (bot) 2a3b876b02
bpo-40355: Improve error messages in ast.literal_eval with malformed Dict nodes (GH-19868)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
(cherry picked from commit c21c51235a)

Co-authored-by: Curtis Bucher <cpbucher5@gmail.com>
2020-05-05 13:00:57 -07:00
Miss Islington (bot) a6a116c1b9
bpo-40458: Increase reserved stack space to prevent overflow crash on Windows (GH-19845)
(cherry picked from commit ac4bf42411)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-05-05 11:03:21 -07:00
Miss Islington (bot) efc782d29e
bpo-40459: Fix NameError in platform.py (GH-19855)
(cherry picked from commit 1e7e4519a8)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
2020-05-04 19:51:48 -07:00
Serhiy Storchaka a629d4c63c
[3.8] bpo-40398: Fix typing.get_args() for special generic aliases. (GH-19720) (GH-19857)
(cherry picked from commit 6292be7adf)
2020-05-02 11:08:00 +03:00
Miss Islington (bot) 1205afb3e1
bpo-40412: Nullify inittab_copy during finalization (GH-19746)
Otherwise we leave a dangling pointer to free'd memory. If we
then initialize a new interpreter in the same process and call
PyImport_ExtendInittab, we will (likely) crash when calling
PyMem_RawRealloc(inittab_copy, ...) since the pointer address
is bogus.

Automerge-Triggered-By: @brettcannon
(cherry picked from commit 64224a4727)

Co-authored-by: Gregory Szorc <gregory.szorc@gmail.com>
2020-05-01 16:06:23 -07:00
Antoine Pitrou e05828055e
[3.8] bpo-39435: Fix docs for pickle.loads (GH-18160) (GH-19843)
(cherry picked from commit 289842a)

Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>

Automerge-Triggered-By: @pitrou
2020-05-01 12:54:44 -07:00
Pablo Galindo 5055c274c6
[3.8] bpo-39562: Prevent collision of future and compiler flags (GH-19230) (GH-19835)
The constant values of future flags in the __future__ module
is updated in order to prevent collision with compiler flags.
Previously PyCF_ALLOW_TOP_LEVEL_AWAIT was clashing
with CO_FUTURE_DIVISION..
(cherry picked from commit 4454057269)

Co-authored-by: Batuhan Taşkaya <batuhanosmantaskaya@gmail.com>
2020-05-01 07:18:27 -07:00
Łukasz Langa 802eb676ba
Python 3.8.3rc1 2020-04-29 19:21:55 +02:00
Miss Islington (bot) d9e9049191
bpo-40436: Fix code parsing gdb version (GH-19792)
test_gdb and test.pythoninfo now check gdb command exit code.
(cherry picked from commit ec9bea4a37)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-04-29 08:30:01 -07:00
Zachary Ware ca5649c4c1
[3.8] bpo-38387: Formally document PyDoc_STRVAR and PyDoc_STR macros (GH-16607) (GH-19727)
Adds a short description of `PyDoc_STRVAR` and `PyDoc_STR` to "Useful macros" section of C-API docs.

Currently, there is [one lone mention](https://docs.python.org/3/c-api/module.html?highlight=pydoc_strvarGH-c.PyModuleDef) in the C-API reference, despite the fact that `PyDoc_STRVAR` is ubiquitous to `Modules/`.

Additionally, this properly uses `c:macro` within `Doc/c-api/module.rst` to link.
(cherry picked from commit b54e46c)

Authored-by: Brad Solomon <brad.solomon.1124@gmail.com>
2020-04-26 21:45:05 -05:00
Miss Islington (bot) 714aa832a5
gdbinit: Use proper define syntax (GH-19557)
Using `def` rather than `define` results in:

    Ambiguous command "def pu": define, define-prefix.

Automerge-Triggered-By: @csabella
(cherry picked from commit 1221135289)

Co-authored-by: Florian Bruhin <me@the-compiler.org>
2020-04-23 05:55:29 -07:00
Miss Islington (bot) 4a6da0b63b
bpo-38360: macOS: support alternate form of -isysroot flag (GH-16480)
It is possible to use either '-isysroot /some/path' (with a space) or
'-isysroot/some/path' (no space in between). Support both forms in
places where special handling of -isysroot is done, rather than just
the first form.
Co-authored-by: Ned Deily <nad@python.org>
(cherry picked from commit b310700976)

Co-authored-by: Joshua Root <jmr@macports.org>
2020-04-22 10:13:47 -07:00
Victor Stinner b07350901c
bpo-40138: Fix Windows os.waitpid() for large exit code (GH-19654)
Fix the Windows implementation of os.waitpid() for exit code
larger than "INT_MAX >> 8". The exit status is now interpreted as an
unsigned number.
2020-04-22 17:57:59 +02:00
Miss Islington (bot) 3a55450256
bpo-38439: Add 256px IDLE icon (GH-17473)
Icon author: Andrew Clover, bpo-1490384
(cherry picked from commit 3a69f3caee)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2020-04-22 00:39:59 -07:00
Miss Islington (bot) 9e51aab37e
bpo-40164: Update macOS installer builds to use OpenSSL 1.1.1g. (GH-19642)
(cherry picked from commit 783a673f23)

Co-authored-by: Ned Deily <nad@python.org>
2020-04-21 20:00:27 -07:00
Miss Islington (bot) 41660cac63
bpo-39942:Fix failure in `TypeVar` when missing `__name__` (GH-19616)
https://bugs.python.org/issue39942
(cherry picked from commit a25a04fea5)

Co-authored-by: HongWeipeng <hongweichen8888@sina.com>
2020-04-20 13:24:35 -07:00
Antoine Pitrou 887ff8e37e
[3.8] bpo-40330: Fix utf-8 size check in ShareableList (GH-19606) (GH-19625)
The item size must be checked after encoding to bytes, not before.

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

Co-authored-by: Antoine Pitrou <antoine@python.org>
2020-04-20 21:22:50 +02:00
Miss Islington (bot) 020f2aaaea
bpo-27635: Fix pickle documentation about `__new__` not being called. (GH-19269)
Automerge-Triggered-By: @pitrou
(cherry picked from commit 482259d0dc)

Co-authored-by: Furkan Önder <furkantahaonder@gmail.com>
2020-04-18 11:14:55 -07:00
Serhiy Storchaka bfda4db0d2
[3.8] bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364) (GH-19583)
Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
(cherry picked from commit 12446e6a60)
2020-04-18 19:11:48 +03:00
Miss Islington (bot) 9796fe88da
bpo-40287: Fix SpooledTemporaryFile.seek() return value (GH-19540)
It has not returned the file position after the seek.
(cherry picked from commit 485e715cb1)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2020-04-17 00:14:55 -07:00
Miss Islington (bot) ccf30e96d4
bpo-39793: use the same domain on make_msgid tests (GH-18698) (GH-19554)
(cherry picked from commit 5565c30f0b)

Co-authored-by: Batuhan Taşkaya <batuhanosmantaskaya@gmail.com>
2020-04-16 14:07:52 -04:00
Miss Islington (bot) 3e72de9e08
[3.8] bpo-39667: Sync zipp 3.0 (GH-18540) (GH-18701)
* bpo-39667: Sync zipp 3.0 (GH-18540)

* bpo-39667: Improve pathlib.Path compatibility on zipfile.Path and correct performance degradation as found in zipp 3.0

* 📜🤖 Added by blurb_it.

* Update docs for new zipfile.Path.open

* Rely on dict, faster than OrderedDict.

* Syntax edits on docs

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 0aeab5c438)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

* Clarify the change in behavior with a couple of workaround options.

* Restore API compatibility while backporting performance improvements.

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-04-15 14:45:25 -04:00
Miss Islington (bot) 59047fab0e
bpo-40260: Update modulefinder to use io.open_code() and respect coding comments (GH-19488)
(cherry picked from commit d42e582063)

Co-authored-by: Barry <barry@barrys-emacs.org>
2020-04-14 12:34:41 -07:00
Victor Stinner 67b8a1f0f0
[3.8] Update libregrtest from master (GH-19516)
* bpo-37531: regrtest now catchs ProcessLookupError (GH-16827)

Fix a warning on a race condition on TestWorkerProcess.kill(): ignore
silently ProcessLookupError rather than logging an useless warning.

(cherry picked from commit a661392f8f)

* bpo-38502: regrtest uses process groups if available (GH-16829)

test.regrtest now uses process groups in the multiprocessing mode
(-jN command line option) if process groups are available: if
os.setsid() and os.killpg() functions are available.

(cherry picked from commit ecb035cd14)

* bpo-37957: Allow regrtest to receive a file with test (and subtests) to ignore (GH-16989)

When building Python in some uncommon platforms there are some known tests that will fail. Right now, the test suite has the ability to ignore entire tests using the -x option and to receive a filter file using the --matchfile filter. The problem with the --matchfile option is that it receives a file with patterns to accept and when you want to ignore a couple of tests and subtests, is too cumbersome to lists ALL tests that are not the ones that you want to accept and he problem with -x is that is not easy to ignore just a subtests that fail and the whole test needs to be ignored.

For these reasons, add a new option to allow to ignore a list of test and subtests for these situations.

(cherry picked from commit e0cd8aa70a)

* regrtest: log timeout at startup (GH-19514)

Reduce also worker timeout.

(cherry picked from commit 4cf65a630a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-04-14 19:51:18 +02:00
Miss Islington (bot) 61511488cf
bpo-31758: Prevent crashes when using an uninitialized _elementtree.XMLParser object (GH-3997) (GH-19485)
(cherry picked from commit 402e1cdb13)
2020-04-12 17:18:57 +02:00
Serhiy Storchaka ee249d798b
[3.8] bpo-40126: Fix reverting multiple patches in unittest.mock. (GH-19351) (GH-19483)
Patcher's __exit__() is now never called if its __enter__() is failed.
Returning true from __exit__() silences now the exception.
(cherry picked from commit 4b222c9491)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-04-12 14:53:46 +03:00
Miss Islington (bot) 2714c907df
closes bpo-39953: Update OpenSSL error codes table. (GH-19082)
I updated the error codes using the OpenSSL 1.1.1f source tree.
(cherry picked from commit 3e0dd3730b)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2020-04-11 13:53:00 -07:00
Victor Stinner 37a257c0ae
bpo-40204: Pin Sphinx version to 1.8.2 in Doc/Makefile (GH-19442) 2020-04-09 00:36:13 +02:00
Miss Islington (bot) 6318e45bda
bpo-40089: Fix threading._after_fork() (GH-19191) (GH-19194)
If fork was not called by a thread spawned by threading.Thread,
threading._after_fork() now creates a _MainThread instance for
_main_thread, instead of a _DummyThread instance.
(cherry picked from commit d8ff44ce4c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-04-07 23:35:52 +02:00
Miss Islington (bot) 8bd84e7f79
bpo-40196: Fix a bug in the symtable when reporting inspecting global variables (GH-19391) (GH-19394)
(cherry picked from commit 799d7d61a9)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-04-06 17:41:55 +01:00
Steve Dower 37126e7bd2
bpo-40164: Update Windows to OpenSSL 1.1.1f (GH-19359) 2020-04-04 15:47:40 +01:00
Miss Islington (bot) 15337726e5
bpo-38689: avoid IDLE hanging when calltip fails getting a signature (GH-17152)
Inspect.signature failed on the test case because its isinstance call raised.
(cherry picked from commit 52013e5b6d)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2020-04-03 20:25:06 -07:00
Miss Islington (bot) e6685ad053
bpo-40158: Fix CPython MSBuild Properties in NuGet Package (GH-19343)
Fix default Python home path relative to the NuGet package
(cherry picked from commit 6e623ff9d2)

Co-authored-by: Chris Martinez <sydefekt@hotmail.com>
2020-04-03 23:20:12 +01:00
Miss Islington (bot) 1c325c4e0b
bpo-40162: Update Travis CI config to OpenSSL 1.1.1f (GH-19319)
(cherry picked from commit b1ffb8b723)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-04-02 18:21:54 -07:00
Miss Islington (bot) 1098671e4e
lib2to3: Support named assignment expressions (GH-12702)
There are two copies of the grammar -- the one used by Python itself as
Grammar/Grammar, and the one used by lib2to3 which has necessarily diverged at
Lib/lib2to3/Grammar.txt because it needs to support older syntax an we want it
to be reasonable stable to avoid requiring fixer rewrites.

This brings suport for syntax like `if x:= foo():` to match what the live
Python grammar does.

This should've been added at the time of the walrus operator itself, but lib2to3 being
independent is often overlooked.  So we do consider this a bugfix rather than enhancement.
(cherry picked from commit 3c3aa4516c)

Co-authored-by: Tim Hatch <tim@timhatch.com>
2020-04-02 16:03:09 -07:00
Miss Islington (bot) ea9e240aa0
bpo-39503: CVE-2020-8492: Fix AbstractBasicAuthHandler (GH-18284) (GH-19296)
The AbstractBasicAuthHandler class of the urllib.request module uses
an inefficient regular expression which can be exploited by an
attacker to cause a denial of service. Fix the regex to prevent the
catastrophic backtracking. Vulnerability reported by Ben Caller
and Matt Schwager.

AbstractBasicAuthHandler of urllib.request now parses all
WWW-Authenticate HTTP headers and accepts multiple challenges per
header: use the realm of the first Basic challenge.

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>

(cherry picked from commit 0b297d4ff1)
2020-04-02 12:15:55 +02:00
Miss Islington (bot) 40fff1ff04
bpo-40146: Update OpenSSL to 1.1.1f in Azure Pipelines (GH-19288)
(cherry picked from commit 224e1c34d6)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-04-01 18:26:09 -07:00
Miss Islington (bot) fc03640922
bpo-38527: fix configure script for Solaris (GH-16845)
On Solaris, the regular "grep" command may be an old version that fails to search a binary file. We need to use the correct command (ggrep, in our case), which is found by the configure script earlier.

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

Co-authored-by: Arnon Yaari <wiggin15@yahoo.com>
2020-04-01 08:38:17 -07:00
Miss Islington (bot) 4ced9a7611
bpo-40019: Skip test_gdb if Python was optimized (GH-19081)
test_gdb now skips tests if it detects that gdb failed to read debug
information because the Python binary is optimized.
(cherry picked from commit 7bf069b611)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-03-31 10:27:41 -07:00
Miss Islington (bot) 6a0ee60db4
bpo-40121: Fixes audit event raised on creating a new socket (GH-19238)
(cherry picked from commit 63ba5cccf4)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-03-31 04:57:06 -07:00
Miss Islington (bot) b05fbe9f37
bpo-1812: Fix newline conversion when doctest.testfile loads from a package whose loader has a get_data method (GH-17385)
This pull request fixes the newline conversion bug originally reported in bpo-1812. When that issue was originally submitted, the open builtin did not default to universal newline mode; now it does, which makes the issue fix simpler, since the only code path that needs to be changed is the one in doctest._load_testfile where the file is loaded from a package whose loader has a get_data method.
(cherry picked from commit e0b8101492)

Co-authored-by: Peter Donis <peterdonis@alum.mit.edu>
2020-03-26 09:18:52 -07:00
Miss Islington (bot) 96686c761d
bpo-39879: Update datamodel docs to include dict ordering (GH-19006)
Co-authored-by: furkanonder <furkantahaonder@gmail.com>
(cherry picked from commit 59c644eaa7)

Co-authored-by: Lahfa Samy <lahfa121999@gmail.com>
2020-03-26 08:00:46 -07:00
Miss Islington (bot) 686d508c26
bpo-40016: re docstring: Clarify relationship of inline and argument flags (GH-19078)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 89a2209ae6)

Co-authored-by: Ram Rachum <ram@rachum.com>
2020-03-25 12:01:31 -07:00
Miss Islington (bot) af6fd1faa6
bpo-40014: Fix os.getgrouplist() (GH-19126)
Fix os.getgrouplist(): if getgrouplist() function fails because the
group list is too small, retry with a larger group list.

On failure, the glibc implementation of getgrouplist() sets ngroups
to the total number of groups. For other implementations, double the
group list size.
(cherry picked from commit f5c7cabb2b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-03-24 10:40:31 -07:00
Victor Stinner e97c8b0688
bpo-20526: Fix PyThreadState_Clear(): don't decref frame (GH-19120) (GH-19136)
PyThreadState.frame is a borrowed reference, not a strong reference:
PyThreadState_Clear() must not call Py_CLEAR(tstate->frame).

Remove test_threading.test_warnings_at_exit(): we cannot warranty
that the Python thread state of daemon threads is cleared in a
reliable way during Python shutdown.

(cherry picked from commit 5804f878e7)
2020-03-24 17:12:19 +01:00
Miss Islington (bot) 21bee0bd71
bpo-40014: Fix os.getgrouplist() on macOS (GH-19118)
On macOS, getgrouplist() returns a non-zero value without setting
errno if the group list is too small. Double the list size and call
it again in this case.
(cherry picked from commit 8ec7370c89)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-03-23 12:18:41 -07:00
Miss Islington (bot) c959fa9353
bpo-22490: Remove __PYVENV_LAUNCHER__ from environment during launch (GH-9516) (GH-19110)
* bpo-22490: Remove "__PYVENV_LAUNCHER__" from the shell environment on macOS

This changeset removes the environment varialbe "__PYVENV_LAUNCHER__"
during interpreter launch as it is only needed to communicate between
the stub executable in framework installs and the actual interpreter.

Leaving the environment variable present may lead to misbehaviour when
launching other scripts.

* Actually commit the changes for issue 22490...

* Correct typo

Co-Authored-By: Nicola Soranzo <nicola.soranzo@gmail.com>

* Run make patchcheck

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
(cherry picked from commit 044cf94f61)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2020-03-22 14:56:26 -04:00
Miss Islington (bot) 687f5921a4
bpo-39652: Truncate the column name after '[' only if PARSE_COLNAMES is set. (GH-18942)
(cherry picked from commit b146568dfc)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-03-21 07:32:25 -07:00
Victor Stinner ba26bf3094
[3.8] bpo-27807: Skip test_site.test_startup_imports() if pth file (GH-19060) (GH-19090)
test_site.test_startup_imports() is now skipped if a path of sys.path
contains a .pth file.

Sort test_site imports.
2020-03-20 15:10:14 +01:00
Miss Islington (bot) ec8a973f7c
bpo-39562: Allow executing asynchronous comprehensions in the asyncio REPL (GH-18968)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
(cherry picked from commit 9052f7a41b)

Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
2020-03-19 04:54:16 -07:00
Victor Stinner 046255c40f
bpo-35370: PyEval_SetTrace() logs unraisable error (GH-18977) (GH-19029)
If PySys_Audit() fails in PyEval_SetProfile() or PyEval_SetTrace(),
log the error as an unraisable exception.

(cherry picked from commit f6a5850782)
2020-03-16 18:18:20 +01:00
Miss Islington (bot) 7f5302fed4
bpo-39360: Ensure all workers exit when finalizing a multiprocessing Pool (GH-19009)
When the pull is not used via the context manager or terminate() is called, there is a system in multiprocessing.util that handles finalization of all pools via an atexit handler (the Finalize) class. This class registers the _terminate_pool handler in the registry of finalizers of the module, and that registry is called on interpreter exit via _exit_function. The problem is that the "happy" path with the context manager or manual call to finalize() does some extra steps that _terminate_pool does not. The step that is not executed when the atexit() handler calls _terminate_pool is pinging the _change_notifier queue to unblock the maintenance threads.

This commit moves the notification to the _terminate_pool function so is called from both code paths.

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
(cherry picked from commit ac10e0c932)

Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
2020-03-15 14:26:43 -07:00
Miss Islington (bot) f7e32fcbd6
bpo-39965: Correctly raise SyntaxError if await is used outside async functions when PyCF_ALLOW_TOP_LEVEL_AWAIT is set (GH-19010)
(cherry picked from commit 90235810ec)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-03-14 21:46:26 -07:00
Miss Islington (bot) ff69c9d12c
bpo-38576: Disallow control characters in hostnames in http.client (GH-18995)
Add host validation for control characters for more CVE-2019-18348 protection.
(cherry picked from commit 9165addc22)

Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>
2020-03-14 12:13:32 -07:00
Miss Islington (bot) a927e91186
bpo-39677: dis: rename the operand of MAKE_FUNCTION from `argc` to `flags` for 3.6+ (GC-18550)
(cherry picked from commit 6672c16b1d)

Co-authored-by: Taine Zhao <twshere@outlook.com>
2020-03-14 07:45:23 -07:00
Mark Dickinson e634a8ac1f
[3.8] bpo-39871: Fix possible SystemError in atan2, copysign and remainder (GH-18806) (GH-18989)
In math_2(), the first PyFloat_AsDouble() call should be checked
for failure before the second call.

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>.
(cherry picked from commit 5208b4b379)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-03-14 11:38:52 +00:00
Miss Islington (bot) f6bdac1bf7
bpo-39915: Ensure await_args_list is updated according to the order in which coroutines were awaited (GH-18927)
Create call objects with awaited arguments instead of using call_args which has only last call value.
(cherry picked from commit e553f204bf)

Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
2020-03-14 07:12:57 +00:00
Victor Stinner 03ac090c5f
bpo-39884: Add method name in "bad call flags" error (GH-18944) (GH-18956)
PyDescr_NewMethod() and PyCFunction_NewEx() now include the method
name in the SystemError "bad call flags" error message to ease debug.

(cherry picked from commit c7d2d69d95)
2020-03-12 13:37:02 +01:00
Serhiy Storchaka ab9c729121
[3.8] bpo-38643: Raise SystemError instead of crashing when PyNumber_ToBase is called with invalid base. (GH-18863). (GH-18954)
(cherry picked from commit e5ccc94bbb)
2020-03-12 09:30:56 +02:00
Miss Islington (bot) 60b1b5ac56
bpo-39847: EnterNonRecursiveMutex() uses GetTickCount64() (GH-18780)
The 32-bit (49-day) TickCount relied on in EnterNonRecursiveMutex can overflow
in the gap between the 'target' time and the 'now' time WaitForSingleObjectEx
returns, causing the loop to think it needs to wait another 49 days. This is
most likely to happen when the machine is hibernated during
WaitForSingleObjectEx.

This makes acquiring a lock/event/etc from the _thread or threading module
appear to never timeout.

Replace with GetTickCount64 - this is OK now Python no longer supports XP which
lacks it, and is in use for time.monotonic().

Co-authored-by: And Clover <and.clover@bromium.com>
(cherry picked from commit 64838ce717)

Co-authored-by: bobince <and+github@doxdesk.com>
2020-03-11 16:57:16 -07:00
Miss Islington (bot) cd07b4da65
bpo-39520: Fix un-parsing of ext slices with no dimensions (GH-18304)
(cherry picked from commit 185903de12)

Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
2020-03-11 13:18:01 -07:00
Miss Islington (bot) c22879914b
bpo-39916: Use os.scandir() as context manager in Path.glob(). (GH-18880)
(cherry picked from commit 704e2065f8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-03-11 10:07:04 -07:00
Miss Islington (bot) d01c5507e5
bpo-39930: Ensure vcruntime140.dll is included in all Windows packages (GH-18918)
Also adds GitHub CI test for Windows installer changes
(cherry picked from commit 2dd41740c9)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-03-11 04:38:18 -07:00
Miss Islington (bot) 212acf544a
bpo-38662: ensurepip invokes pip via runpy (GH-18901)
The ensurepip module now invokes pip via the runpy module.
Hence it is no longer tightly coupled with the internal API of the bundled
pip version, allowing easier updates to a newer pip version both
internally and for distributors.

This way, any changes to the internal pip API won't mean ensurepip needs to be
changed as well. Also, distributors can update their pip wheels independent on
CPython release schedule.

Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com>
Co-Authored-By: Miro Hrončok <miro@hroncok.cz>
(cherry picked from commit 88f82b2b9e)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2020-03-10 14:37:50 -07:00
Dong-hee Na caec8a0dfb
[3.8] bpo-39828: Fix json.tool to catch BrokenPipeError (GH-18779). (GH-18894)
(cherry picked from commit 700cb58730)

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

Automerge-Triggered-By: @vstinner
2020-03-10 01:14:08 -07:00
Miss Islington (bot) cadfe52a00
bpo-27115: Use Query subclass for IDLE editor Goto (GH-18871)
Replace tkinter tkSimpleDialog.askinteger with a standard IDLE query dialog.
The new box checks for positivity before returning.
(cherry picked from commit 363fab83b8)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-03-09 16:45:19 -07:00
Miss Islington (bot) 5854d451cb
bpo-36184: Port python-gdb.py to FreeBSD (GH-18873)
python-gdb.py now checks for "take_gil" function name to check if a
frame tries to acquire the GIL, instead of checking for
"pthread_cond_timedwait" which is specific to Linux and can be a
different condition than the GIL.
(cherry picked from commit 6d0ee60740)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-03-09 11:52:27 -07:00
Pablo Galindo 3ede1bc794
[3.8] bpo-39850: Add support for abstract sockets in multiprocessing (GH-18866) (GH-18876)
(cherry picked from commit 6012f30bef)
2020-03-09 14:48:03 +00:00
Miss Islington (bot) 0687bdf5de
bpo-39517: Allow runpy.run_path() to accept path-like objects (GH-18699)
(cherry picked from commit 0911ea5c17)

Co-authored-by: Maor Kleinberger <kmaork@gmail.com>
2020-03-08 13:59:59 -07:00
Miss Islington (bot) b2e8240261
bpo-39885: IDLE context menu clears selection (GH-18859)
Since clicking to get an IDLE context menu moves the cursor,
any text selection should be and now is cleared.
(cherry picked from commit 4ca060d8ad)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-03-08 12:47:05 -07:00
Miss Islington (bot) a5e821c726
bpo-39852: IDLE 'Go to line' deletes selection, updates status (GH-18801)
It appears standard that moving the text insert cursor away from a selection clears the
selection.  Clearing prevents accidental deletion of a possibly off-screen bit of text.
The update is for Ln and Col on the status bar.
(cherry picked from commit 2522db11df)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-03-08 11:49:44 -07:00
Miss Islington (bot) 928b4dd0ed
bpo-38894: Fix pathlib.Path.glob in the presence of symlinks and insufficient permissions (GH-18815)
Co-authored-by: Matt Wozniski <mwozniski@bloomberg.net>
(cherry picked from commit eb7560a73d)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-03-07 10:11:24 -08:00
Serhiy Storchaka 92b72788ec
[3.8] bpo-39889: Fix unparse.py for subscript. (GH-18824). (GH-18826)
(cherry picked from commit c4928fc1a8)
2020-03-07 18:55:32 +02:00
Miss Islington (bot) 6df0c47669
bpo-17422: slightly more precise language (GH-18682)
(cherry picked from commit e59334ebc9)

Co-authored-by: Caleb Donovick <cdonovick@users.noreply.github.com>
2020-03-06 10:26:52 -08:00
Miss Islington (bot) 0c71770eee
bpo-39868: Update Language Reference for PEP 572. (GH-18793)
(cherry picked from commit 8bae21962b)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2020-03-05 21:25:15 -08:00
Miss Islington (bot) 6b452ff97f
bpo-13487: Use sys.modules.copy() in inspect.getmodule() for thread safety. (GH-18786)
`list(sys.modules.items())` was apparently not immune to "dictionary
changed size during iteration" errors.

Tested internally using an integration test that has run into this a couple of times in the past two years.  With this patch applied, the test is no longer flaky.
(cherry picked from commit 85cf1d514b)

Co-authored-by: Gregory P. Smith <gps@google.com>
2020-03-04 17:04:38 -08:00
Miss Islington (bot) 6c8cc0dbfd
Fix misleading statement about mixed-type numeric comparisons (GH-18615) (#18773)
(cherry picked from commit 9f1cb1bb49)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2020-03-04 11:52:56 +00:00
Stefan Krah 5a92f42d87
bpo-39776: Lock ++interp->tstate_next_unique_id. (GH-18746) (#18746) (#18752)
- Threads created by PyGILState_Ensure() could have a duplicate tstate->id.

(cherry picked from commit b3b9ade4a3)
2020-03-03 09:18:55 +01:00
Miss Islington (bot) 0d20364b13
bpo-38597: Never statically link extension initialization code on Windows (GH-18724)
(cherry picked from commit ce3a498408)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-03-02 16:30:18 -08:00
Pablo Galindo 9ddcb914f9
[3.8] bpo-39778: Don't traverse weak-reference lists OrderedDict's tp_traverse and tp_clear (GH-18749) (GH-18756)
Objects do not own weak references to them directly through the __weakref__ list so these
do not need to be traversed by the GC.

(cherry picked from commit 0c2b509)
2020-03-02 23:55:20 +00:00
Miss Islington (bot) 7ad99821d8
bpo-38380: Update macOS & Windows builds to SQLite v3.31.1 (GH-18678)
Automerge-Triggered-By: @zooba
(cherry picked from commit 1382c3289b)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2020-03-02 07:02:03 -08:00
Miss Islington (bot) 43932dc1ea
bpo-39764: Make Task.get_stack accept ag_frame (GH-18669)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 4482337dec)

Co-authored-by: Lidi Zheng <scallopsky@gmail.com>
2020-03-02 05:03:50 -08:00
Miss Islington (bot) f28b0c74e5
bpo-38971: Open file in codecs.open() closes if exception raised. (GH-17666)
Open issue in the BPO indicated a desire to make the implementation of
codecs.open() at parity with io.open(), which implements a try/except to
assure file stream gets closed before an exception is raised.
(cherry picked from commit 2565edec2c)

Co-authored-by: Chris A <christopher.aporta@gmail.com>
2020-03-02 00:03:08 -08:00
Serhiy Storchaka 87a4cd5fbe
bpo-38410: Properly handle PySys_Audit() failures (GH-18658)
_PyEval_SetAsyncGenFinalizer() and _PyEval_SetAsyncGenFirstiter()
didn't include proper error handling for their PySys_Audit() calls.

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-03-02 09:58:48 +02:00
Serhiy Storchaka a7b8a969eb
[3.8] bpo-38913: Fix segfault in Py_BuildValue("(sGH-O)", ...) if entered with exception raised. (GH-18656). (GH-18732)
(cherry picked from commit 28d0bcac8b)
2020-03-02 09:54:43 +02:00
Pablo Galindo 12b714391e
[3.8] bpo-39815: add cached_property to all (GH-18726) (GH-18728)
Automerge-Triggered-By: @pablogsal.
(cherry picked from commit 217dce9ee6)

Co-authored-by: Hakan Çelik <hakancelik96@outlook.com>
2020-03-02 00:08:29 +00:00
Gregory P. Smith ce720d3e06
bpo-39769: Fix compileall ddir for subpkgs. (GH-18676) (GH-18718)
Fix compileall.compile_dir() ddir= behavior on sub-packages.

Fixes compileall.compile_dir's ddir parameter and compileall command
line flag `-d` to no longer write the wrong pathname to the generated
pyc file for submodules beneath the root of the directory tree being
compiled.  This fixes a regression introduced with Python 3.5.

Tests backported from GH 02673352b5, the
implementation is different due to intervening code changes.  But still
quiet simple.

Why was the bug ever introduced?  The refactoring to add parallel
execution kept the ddir -> dfile computations but discarded the results
instead of sending them to compile_file().  This fixes that.  Lack of tests
meant this went unnoticed.
2020-03-01 10:42:56 -08:00
Stefan Krah 4d7012410c
[3.8] bpo-39794: Add --without-decimal-contextvar (GH-18702)
(cherry picked from commit 815280eb16)
2020-02-29 22:16:32 +01:00
Miss Islington (bot) e4686b7979
bpo-39548: Fix handling of 'WWW-Authenticate' header for Digest Auth (GH-18338)
* bpo-39548: Fix handling of 'WWW-Authenticate' header for Digest authentication

 - The 'qop' value in the 'WWW-Authenticate' header is optional. The
   presence of 'qop' in the header should be checked before its value
   is parsed with 'split'.

Signed-off-by: Stephen Balousek <stephen@balousek.net>

* bpo-39548: Fix handling of 'WWW-Authenticate' header for Digest authentication

 - Add NEWS item

Signed-off-by: Stephen Balousek <stephen@balousek.net>

* Update Misc/NEWS.d/next/Library/2020-02-06-05-33-52.bpo-39548.DF4FFe.rst

Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
(cherry picked from commit 5e260e0fde)

Co-authored-by: Stephen Balousek <sbalousek@users.noreply.github.com>
2020-02-29 13:05:23 -08:00
Miss Islington (bot) 45c4112b72
bpo-39789: Update Windows release build machines to VS 2019 (GH-18695)
Also fixes some potential Nuget build issues.
(cherry picked from commit 03153dd145)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-02-28 16:41:03 -08:00
Miss Islington (bot) 7f53d87cb0
bpo-39718: add TYPE_IGNORE, COLONEQUAL to py38 changes in token (GH-18598)
(cherry picked from commit c2f7eb254b)

Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
2020-02-28 15:31:20 -08:00
Miss Islington (bot) 445152e0d3
bpo-13790: Change 'string' to 'specification' in format doc (GH-18690)
(cherry picked from commit 916895f939)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-02-28 12:06:53 -08:00
Miss Islington (bot) 846ca4961d
bpo-39781: Do not jump when select in IDLE codecontext (GH-18683)
Previously, the button-up part of selecting with a mouse was treated as a click
that meant 'jump' to this line, which modified the context and undid the selection
(cherry picked from commit c705fd1e89)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-02-28 10:43:25 -08:00
Miss Islington (bot) 1bbb81b251
bpo-38403: Update nuspec file for deprecated field and git repository (GH-18657)
(cherry picked from commit d644891970)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-02-25 12:24:48 -08:00
Łukasz Langa a0e59d3b04 Python 3.8.2
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl5UQfMACgkQsmmV4xAl
 BWgxYA//aEwIvrR4cxGFfO+W83rsde2CenAJyX2LZAy4hpAUUEzhELQsu/APjz4h
 I2vmH1PoUH4bDavI+5kUBxrJtuVhHf9rX1K4wF299ETG7tl/rlKRU563GPW5ytXo
 1eSlPQyMdSTdkD8dCg23kHZ344U5rKNTS9a+QnYYNRybtiR/pXQ/oG438wzKCHD2
 gI2N3sk8siGiMomqX9VIV3qFrtoVqgAgANOt30WWuTIa1UOdU3mf/QAc2rNbEjof
 sKmZz9h9M9gImZDB+vVh58KjGHTrEv4jO6Gqepqzt9cHbiYtDEpkYYLgIZnGgMDJ
 fJIzagZ/kJdOpsSws7TjZ/vMpgcjhImJSBiUGVYFXWWQTverG2p5S8c8/SThcehF
 bxy5c5tgWobosKfvdOB624VWa6jyjsQWFhVz3HK7+jPC/YKT2KtMF3f31IaLQ4Z5
 tJsykN+4+G26TQbwLaRZL6GtMpq5lvRFoaLkjnVV5PDS71F5ZXv4hbCufK3+ONKy
 UmbQay2xk2OH4DkR2VErJqDme8t0ajSnw0wksY3qZqQOptkfde1ppH2jbLbDZU3Y
 MEgIV7CkynfuYpNBtuOfAPoVy8eMZ8v5Na2UDwqKC4ntN7IWOeTqoCnDLoON5MQK
 LF/lGRTXkG87fpOr2izGM+XYQdww3jxzShflAL5FINJ4P4jE7S0=
 =0Eqs
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl5VCKEQHGx1a2FzekBs
 YW5nYS5wbAAKCRCyaZXjECUFaI8bD/9oqhsfi9A1JlsAIy0D3pZdYfRWebC/DUT0
 S7FkNuxIQpPPE9Ck/Paqsa/KCzUycTRYnZMh3Qkw/3wHuss8OKs1R0IsSBG2RFH/
 udefn8nzE8/rs9HgghF4qbDYokB5KO+lCJYxZzHyRs6y2QVtfzNnw9F6FYK0+CmG
 xZOFqLagYDE3MZlvRMjONgTp3+57pLTxqSM3K0mWgFFfgWZu9aZoYD0+E805eV8o
 tZPUgFgfvN/SZO9gBdW1XsPOTTgmhANt55PoMFVZ9GqQu06Qj5E8n6coD1uzZB49
 CBey5b19lSCmeEiSBJcSyg4Qha9RHPWcBwC5DGWtFzXfHpwe3UHfdF1gzpPx0+R6
 oZAOJ3/OrBJVmu66vjJhs2T1Vk565bX+V83Up/LgHe69353Fc8YILi19emxJhVOY
 CKUE2cvBoGfKCVJd/w+hiJO+ypR/1BOqVxivOQdPAoF2xFYp2q36BAddR5Gfz86w
 WZDf6hPjoKtcD3zSnyRDXf+fXeOTLl256Vzg11kSRdnsdsH5JkVAwjXTqxoTKTaA
 Hm3gmzH8PcMoVSi+pUJ1GZc8643z+QE21JDAbrOVzmTqz8qFSDfD8l5rM4bCi5m2
 ha9l3wOYunodBjAyisN8KQ0xfdTN/jtlzP4RYfAo2EbCGUK68iJ0CaP23I4+c31c
 rboFtgPqBw==
 =a8qT
 -----END PGP SIGNATURE-----

Merge tag 'v3.8.2' into 3.8

Python 3.8.2
2020-02-25 12:44:31 +01:00
Miss Islington (bot) daef21ce7d
bpo-30566: Fix IndexError when using punycode codec (GH-18632)
Trying to decode an invalid string with the punycode codec
shoud raise UnicodeError.

(cherry picked from commit ba22e8f174)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2020-02-25 06:42:39 +03:00
Łukasz Langa 7b3ab5921f
Python 3.8.2 2020-02-24 22:36:25 +01:00
Miss Islington (bot) c97fc564a6
bpo-39649: Remove obsolete check for `__args__` in bdb.Bdb.format_stack_entry (GH-18531)
Appears to be obsolete since 75bb54c3d8.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 4015d1cda3)

Co-authored-by: Daniel Hahler <git@thequod.de>
2020-02-23 19:33:07 -08:00
Miss Islington (bot) 973348427e
bpo-39654: Update pyclbr doc to reflect additional information returned (GH-18528)
Full nested function and class info makes it a module browser.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit aea045adb8)

Co-authored-by: Hakan Çelik <hakancelik96@outlook.com>
2020-02-23 18:07:33 -08:00
Miss Islington (bot) b19f7ecfa3
bpo-39681: Fix C pickle regression with minimal file-like objects (GH-18592) (#18630)
Fix a regression where the C pickle module wouldn't allow unpickling from a
file-like object that doesn't expose a readinto() method.
(cherry picked from commit 9f37872e30)

Co-authored-by: Antoine Pitrou <antoine@python.org>

Co-authored-by: Antoine Pitrou <pitrou@free.fr>
2020-02-23 23:53:24 +01:00
Pablo Galindo 13951c7f25
[3.8] bpo-39427: Document -X opt options in the CLI --help and the man page (GH-18131) (GH-18133)
https://bugs.python.org/issue39427

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

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-02-23 20:48:27 +00:00
Miss Islington (bot) 91ba44623e
bpo-17422: Language reference should specify restrictions on class namespace (GH-18559)
The language reference now specifies restrictions on class namespaces.  Adapted from a patch by Ethan Furman.
(cherry picked from commit fbe2e0bb8a)

Co-authored-by: ananthan-123 <ananthakrishnan15.2001@gmail.com>
2020-02-22 13:16:17 -08:00
Miss Islington (bot) 0c1827e70c
bpo-39382: Avoid dangling object use in abstract_issubclass() (GH-18530)
Hold reference of __bases__ tuple until tuple item is done with, because by
dropping the reference the item may be destroyed.
(cherry picked from commit 1c56f8ffad)

Co-authored-by: Yonatan Goldschmidt <yon.goldschmidt@gmail.com>
2020-02-22 05:34:06 -08:00
Miss Islington (bot) 44c690112d
bpo-39572: Document ’total’ flag of TypedDict (GH-18554)
(cherry picked from commit ab6423fe2d)

Co-authored-by: ananthan-123 <ananthakrishnan15.2001@gmail.com>
2020-02-18 21:24:51 -08:00
Miss Islington (bot) 5bf58cef15
bpo-39432: Implement PEP-489 algorithm for non-ascii "PyInit_*" symbol names in distutils (GH-18150) (GH-18546)
Make it export the correct init symbol also on Windows.

https://bugs.python.org/issue39432
(cherry picked from commit 9538bc9185)

Co-authored-by: Stefan Behnel <stefan_ml@behnel.de>
2020-02-18 14:14:43 +01:00
Łukasz Langa e40b7dc63b Python 3.8.2rc2
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl5LF7QACgkQsmmV4xAl
 BWjSog/9HCurfAaWfef71g8J7Mso8ITHKTu/jHWb2Duv+olySU2HC+NohxS4ZD+W
 kWsEGbFXavop2bgGXx+I5nEqY3dJ6v6KUQfbp5q/+Gn3WuUguSS0az86r4oBlHSq
 NJmLcQ6+MTq3k3seXJkiv/OmCtMPlgXQZ/n4X6BSRWRiLeD1CRPAdm1zeBpB65HB
 XtIlpKktIMl3fMxFlx9de/ZYG8xC10ZwxjNFmO0ZW5CFsqeMf45rN9+j2T6N8W8e
 0diV2UcLmNyG9asdqT2h6d/HB9qBScAK5yrP3Ivt9MneOrKSJW2VJGh0XWNlN6VM
 wN8keuKq0o+hz+U49vVJJTGLOLzn/etiJNGrhMacfdpfV1Ycu548sf1JHwfj/L/Y
 1YCbsEE8JTTluXUGkZedLDskCaZPKSrI1nySseZPlAIqaVkJHWSzAOzKidRaTV/Q
 FB3cRDYEa0eH9HqTCtAedN4Uwhwev2Yufh9NZ9oFWh7TI9QgX7WX0p92Ho7IrnEd
 NKdrmqL6nuJ/19yz63wHzXI/F4pc7+eFmUwv8Nlp+SnmywpqgTKEyzEI4It3Y4eC
 fGmGQkpWGWULkGDyEvX1ghphss/xQjeO3JeabP7rTZUxQQA8bT+l5DsIgiwiw9sj
 3FOFDwuHOPycSBovKPq9B14r0nypsHsysNfKtGWRu+HbOohUZDw=
 =F4Ea
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl5L0eUQHGx1a2FzekBs
 YW5nYS5wbAAKCRCyaZXjECUFaO9pEACgl8zL3+wA/sSNeqoAYVkA34bZ/JsKucOS
 y4na9Z0lFogV8OMeMNbIXeU0gLgkvn+EY3kPMn5NcUxQBKdiBiYsSanuaAjWMLPI
 w03uNpW6yTcMEnSZS+GHnXQT2bmofW3ORXxzEscgSaDf42AeJPuJdM/PZqG/pC3m
 tWma/XTqXMDwBm9cILFY0aI4o1NPZadtEDWIIwzYMMF8HbsuPsDR2cOoF/e79Ylc
 /Z3BCO1Vw0/GrXF3zC8l5uLallOXVoCKjRkDS9WfrrzCJ/94fTIdQpj6lUOn1dHU
 UPimdq9yPPTVqdmkLMMIv3d/GashIVTbvl1W3VT9yVNz5EqpEu3YIo05dMuTXTPa
 x1KAoq2VEB5J72rZ99k1NgB2L/k9CAoARznmH/NZTpqOW2Dd9eiGrxq1fWJjPJYC
 wW8LRqTSeUGcdluICt++UjtiMVnHeqUT3vlm0saCMdlOyfxqq20vA7sXJ3SvcjnJ
 hBOnX6R9Nur6Umwfs+Rsh0pvDpU4ljLCcWlFtESI5wJaQ/vM1a6OL9xcv5o0u+/t
 FmJdAZ4xfdUUF0itDRCC7+L2X62SJEHb6BCww6iVRgBu7w7BV+iK9l8CGWqGWqXD
 hnXgK6xbI0B1Nus3aQH/EFHxsNQRX19mScmOpbcOile+QdZ9F/sWqvoNxPKr+fDU
 FtpUX24PzQ==
 =5hsP
 -----END PGP SIGNATURE-----

Merge tag 'v3.8.2rc2' into 3.8

Python 3.8.2rc2
2020-02-18 13:00:35 +01:00
Miss Islington (bot) e412cbba52
[3.8] bpo-39546: argparse: Honor allow_abbrev=False for specified prefix_chars (GH-18337) (GH-18543)
When `allow_abbrev` was first added, disabling the abbreviation of
long options broke the grouping of short flags ([bpo-26967](https://bugs.python.org/issue26967)).  As a fix,
b1e4d1b603 (contained in v3.8) ignores `allow_abbrev=False` for a
given argument string if the string does _not_ start with "--"
(i.e. it doesn't look like a long option).

This fix, however, doesn't take into account that long options can
start with alternative characters specified via `prefix_chars`,
introducing a regression: `allow_abbrev=False` has no effect on long
options that start with an alternative prefix character.

The most minimal fix would be to replace the "starts with --" check
with a "starts with two prefix_chars characters".  But
`_get_option_tuples` already distinguishes between long and short
options, so let's instead piggyback off of that check by moving the
`allow_abbrev` condition into `_get_option_tuples`.





https://bugs.python.org/issue39546
(cherry picked from commit 8edfc47bae)


Co-authored-by: Kyle Meyer <kyle@kyleam.com>


https://bugs.python.org/issue39546



Automerge-Triggered-By: @encukou
2020-02-18 03:14:07 -08:00
Miss Islington (bot) 7fd752c1bc
bpo-39663: IDLE: Add additional tests for pyparse (GH-18536)
Test when find_good_parse_start should return 0.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit ffda25f6b8)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2020-02-17 19:05:39 -08:00
Łukasz Langa 777ba072d6
Python 3.8.2rc2 2020-02-17 23:45:14 +01:00
Dong-hee Na f64abd1056
[3.8] bpo-39453: Fix contains method of list to hold strong references (GH-18204) 2020-02-17 10:13:52 +01:00
Senthil Kumaran ea316fd215
Revert "[3.8] bpo-27657: Fix urlparse() with numeric paths (GH-16839)" (GH-18525)
This reverts commit 0f3187c1ce.

The change broke the backwards compatibility of parsing behavior in a
patch release of Python (3.8.1). A decision was taken to revert this
patch in 3.8.2.

In https://bugs.python.org/issue27657 it was decided that the previous
behavior like

>>> urlparse('localhost:8080')
ParseResult(scheme='', netloc='', path='localhost:8080', params='', query='', fragment='')

>>> urlparse('undefined:8080')
ParseResult(scheme='', netloc='', path='undefined:8080', params='', query='', fragment='')

needs to be preserved in patch releases as number of users rely upon it.

Explicitly mention the releases involved with the revert in NEWS.
Adopt the wording suggested by @ned-deily.
2020-02-16 13:47:21 -08:00
Miss Islington (bot) 28fc1bac0f
closes bpo-39619 Fix os.chroot on HP-UX 11.31 (GH-18495)
Setting `-D_XOPEN_SOURCE=700` on HP-UX causes system functions such as chroot to be undefined.  This change stops `_XOPEN_SOURCE` begin set on HP-UX

Co-authored-by: Benjamin Peterson <benjamin@python.org>
(cherry picked from commit a9edf44a2d)

Co-authored-by: Ian Norton <inorton@gmail.com>
2020-02-13 19:27:28 -08:00
Miss Islington (bot) 8dbdf5f275
[3.8] bpo-39606: allow closing async generators that are already closed (GH-18475) (GH-18501)
The fix for [bpo-39386](https://bugs.python.org/issue39386) attempted to make it so you couldn't reuse a
agen.aclose() coroutine object. It accidentally also prevented you
from calling aclose() at all on an async generator that was already
closed or exhausted. This commit fixes it so we're only blocking the
actually illegal cases, while allowing the legal cases.

The new tests failed before this patch. Also confirmed that this fixes
the test failures we were seeing in Trio with Python dev builds:
  https://github.com/python-trio/trio/pull/1396


https://bugs.python.org/issue39606
(cherry picked from commit 925dc7fb1d)


Co-authored-by: Nathaniel J. Smith <njs@pobox.com>


https://bugs.python.org/issue39606



Automerge-Triggered-By: @njsmith
2020-02-13 00:43:23 -08:00
Steve Dower a00b5be5f7
bpo-39184: Add audit events to functions in `fcntl`, `msvcrt`, `os`, `resource`, `shutil`, `signal`, `syslog` (GH-18407)
Co-authored-by: Saiyang Gou <gousaiyang@163.com>
2020-02-13 08:30:27 +00:00
Miss Islington (bot) 2076d4f97e
bpo-39474: Fix AST pos for expressions like (a)(b), (a)[b] and (a).b. (GH-18477)
(cherry picked from commit 6e619c48b8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-02-12 12:56:44 -08:00
Miss Islington (bot) ac6f4d2db7
bpo-21016: pydoc and trace use sysconfig (GH-18476)
bpo-21016, bpo-1294959: The pydoc and trace modules now use the
sysconfig module to get the path to the Python standard library, to
support uncommon installation path like /usr/lib64/python3.9/ on
Fedora.

Co-Authored-By: Jan Matějek <jmatejek@suse.com>
(cherry picked from commit 4fac7ed43e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-02-12 04:32:52 -08:00
Miss Islington (bot) efd878cdb4
bpo-39219: Fix SyntaxError attributes in the tokenizer. (GH-17828)
* Always set the text attribute.
* Correct the offset attribute for non-ascii sources.
(cherry picked from commit 0cc6b5e559)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-02-12 02:35:10 -08:00
Miss Islington (bot) ed4d263e87
bpo-39595: Improve zipfile.Path performance (GH-18406) (GH-18472)
* Improve zipfile.Path performance on zipfiles with a large number of entries.

* 📜🤖 Added by blurb_it.

* Add bpo to blurb

* Sync with importlib_metadata 1.5 (6fe70ca)

* Update blurb.

* Remove compatibility code

* Add stubs module, omitted from earlier commit

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit e5bd73632e)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-02-11 22:21:32 -05:00
Łukasz Langa 2cceef562a Python 3.8.2rc1
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl5BvZEACgkQsmmV4xAl
 BWhElA/+JjXT0JFCuPp3BfRO4U0MMSxYalgLzvIa3VVMcH1botZWJk2Hn5S3UZNu
 kaay08L0A0cFqU/Wly+RPmQRNOCwDbByHJWpDVKKoBGvR6jQYsDI7RQ4DXjdij8P
 CRSsgfIqt+3JoAvYkcbW8R/qdMQr9mNAdEvZimoV9ZnToP6RA6byPdwpcllNaXOe
 IxSMEPVHhsn6OvfA9B7c6lKa021lDqmDnk1/uA4rukkI7vJcClXaiMgogwFM/hct
 hcU1FfT2l7d9JawrGiv+zHJRs7KBD9f+pBsco6FBbijwlQ7aXKEoWfGWKvWUz2Fw
 GxH4h8i2mjvkfraARJdoHyc39CgGYqFPTBrwJC1KA4zs2KfDuhNzYuWMsXirdT6p
 IglBQ2pJ5kIxdItrhOAw9CpbxZmAIR8uSTzbWdKQRsPviQouURh/nTRpKeNErviM
 UkN1TNdS1zixjCE/6EG04nrEjjJr2/lmvKZ0Y+nGcYKrTXLJt1WKWCgwjBnv+t7i
 nNp3HqMmcekkX2pOIhHKn+zUhcl/bMax8tg9Q0+sAxSsVedA3PZDucVC43sv+1uY
 pbm8dXesCWE9bkDpNkeG06IYA/HHv1YB4l698MLC9of0vvAEWcqobArHwSm8+7bk
 Gz8EnSjEIQEeNAOS76yVAk0G4Go1kdvEgpsl5G0WovwepEVPINs=
 =sBHh
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl5CoCQQHGx1a2FzekBs
 YW5nYS5wbAAKCRCyaZXjECUFaIwsD/9ADDbV8PiyJV2BKOrGH14oGDQcOj/qU4ZT
 UJEJhCe0jHW/6fhk031lveKYeOwnuWu9h56JP5VfhnoRZEeFv8aY+i2xk4wEgzpA
 a+Ts2ZPIWFx4NDboBxhlxE4Dt1HhmvLUBM63dyH9fqMFHHagdnpwLkSWI2yFGK5u
 wVdfmO351G0PE9KUCD8QQOE802LfCoJbUo7Q1H20BqfxuUlLzm6VWDZzgjyLIgCV
 bXeu37rKDuoFo8hlsON42rI0OVQAso2CMLvdp/Q98cj8oqcpQ/RJZ2wfJ2CzmFy4
 fNi4dluQXGkkx+V6SLpFmRkNH1FEAHfz5Ha0p/V18mCwsWR3kgcWZ/UnUhm6RDsl
 2lHhURMdkDhgEHYFgeB51ZxnuogJ02uGixEUKjDecizadzd1BBpGZALMU8jIiRKC
 l5u+aMSbC2RyT84EyRAlb748g55x7bdGcE+axwyhxOF0gik4cGoDaF5wcnz3MSrT
 BjXmQ3gp/Z2vw95bmZ6UBHn/NCaZInsEMiscCwm/UwI54/qCwrh2UTIdkPEX+4zm
 C+g26Ypq/f8Ki9SXQlrCg8JFRDpKCBS94/L1f+enQgWO7Na5wtSNdDvMsroaDqqH
 MgZFjuUz7dI38xXRoUa1Jz+PQRAziB4qAF44f87gL7rHkZySX9lgKj8H+19kH0dZ
 SmAF5q6J3w==
 =6Yin
 -----END PGP SIGNATURE-----

Merge tag 'v3.8.2rc1' into 3.8

Python 3.8.2rc1
2020-02-11 13:37:54 +01:00
Miss Islington (bot) 021a5694ed
bpo-39600, IDLE: Remove duplicated font names (GH-18430)
In the font configuration window, remove duplicated font names.
(cherry picked from commit ed335cf53b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-02-10 13:38:30 -08:00
Łukasz Langa 8623e68ea8
Python 3.8.2rc1 2020-02-10 20:08:24 +01:00
Miss Islington (bot) dc56f5f488 bpo-39590: make deque.__contains__ and deque.count hold strong references (GH-18421) (GH-18423)
(cherry picked from commit c6dedde160)

Co-authored-by: sweeneyde <36520290+sweeneyde@users.noreply.github.com>

Co-authored-by: sweeneyde <36520290+sweeneyde@users.noreply.github.com>
2020-02-09 00:39:28 -08:00
Lysandros Nikolaou 8b9cebce09
[3.8] bpo-39579: Fix Attribute end_col_offset to point at the current node (GH-18405) (GH-18408)
(cherry picked from commit d2e1098641)





https://bugs.python.org/issue39579



Automerge-Triggered-By: @gvanrossum
2020-02-07 16:21:38 -08:00
Miss Islington (bot) 0d03a10282
bpo-39274: Ensure Fraction.__bool__() returns a bool (GH-18017)
Some numerator types used (specifically NumPy) decides to not
return a Python boolean for the "a != b" operation. Using the equivalent
call to bool() guarantees a bool return also for such types.
(cherry picked from commit 427c84f13f)

Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
2020-02-06 07:13:38 -08:00
Miss Islington (bot) 708f472dd9
bpo-38149: Call sys.audit() only once per call for glob.glob(). (GH-18360)
(cherry picked from commit 54b4f14712)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-02-06 00:45:18 -08:00
Miss Islington (bot) 6470a76430
bpo-39185 Add the d[etailed] and q[uiet] verbosity levels for msbuild (GH-17791)
(cherry picked from commit 89ae20b30e)

Co-authored-by: Anthony Shaw <anthony.p.shaw@gmail.com>
2020-02-04 16:48:01 -08:00
Miss Islington (bot) 3498ac55bc
bpo-39184: Add audit events to command execution functions in os and pty modules (GH-17824)
(cherry picked from commit 95f6001021)

Co-authored-by: Saiyang Gou <gousaiyang@163.com>
2020-02-04 16:32:32 -08:00
Miss Islington (bot) 30e769382d
closes bpo-39510: Fix use-after-free in BufferedReader.readinto() (GH-18295)
When called on a closed object, readinto() segfaults on account
of a write to a freed buffer:

    ==220553== Process terminating with default action of signal 11 (SIGSEGV): dumping core
    ==220553==  Access not within mapped region at address 0x2A
    ==220553==    at 0x48408A0: memmove (vg_replace_strmem.c:1272)
    ==220553==    by 0x58DB0C: _buffered_readinto_generic (bufferedio.c:972)
    ==220553==    by 0x58DCBA: _io__Buffered_readinto_impl (bufferedio.c:1053)
    ==220553==    by 0x58DCBA: _io__Buffered_readinto (bufferedio.c.h:253)

Reproducer:

    reader = open ("/dev/zero", "rb")
    _void  = reader.read (42)
    reader.close ()
    reader.readinto (bytearray (42)) GH-GH-GH- BANG!

The problem exists since 2012 when commit dc469454ec added code
to free the read buffer on close().

Signed-off-by: Philipp Gesang <philipp.gesang@intra2net.com>
(cherry picked from commit cb1c0746f2)

Co-authored-by: Philipp Gesang <phg@phi-gamma.net>
2020-02-04 13:41:55 -08:00
Miss Islington (bot) 02395fad8e
bpo-39450 Stripped whitespace before parsing the docstring in TestCase.shortDescription (GH-18175) (#18323)
(cherry picked from commit 032de7324e)

Co-authored-by: Steve Cirelli <scirelli+git@gmail.com>
2020-02-03 08:20:41 +00:00
Antoine Pitrou 1723687339
[3.8] bpo-39492: Fix a reference cycle between reducer_override and a Pickler instance (GH-18266) (#18316)
https://bugs.python.org/issue39492

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

Co-authored-by: Pierre Glaser <pierreglaser@msn.com>
2020-02-02 21:22:57 +01:00
Miss Islington (bot) 83d3202b92
bpo-38792: Remove IDLE shell calltip before new prompt. (GH-17150)
Previously, a calltip might be left after SyntaxError, KeyboardInterrupt, or Shell Restart.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Tal Einat <taleinat+github@gmail.com>
(cherry picked from commit bfdeaa37b3)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-01-30 18:14:16 -08:00
Miss Islington (bot) b841633cc2
bpo-39502: Skip test_zipfile.test_add_file_after_2107() on AIX (GH-18282)
Skip test_zipfile.test_add_file_after_2107() if time.localtime()
fails with OverflowError. It is the case on AIX 6.1 for example.
(cherry picked from commit c232c9110c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-01-30 07:05:08 -08:00
Steve Dower ad4a20b87d
[3.8] bpo-39401: Avoid unsafe DLL load on Windows 7 and earlier (GH-18231) (GH-18234)
https://bugs.python.org/issue39401



Automerge-Triggered-By: @zooba
2020-01-29 22:18:25 -08:00
Miss Islington (bot) 58076df0c5
bpo-39493: Fix definition of IO.closed in typing.py (GH-18265)
(cherry picked from commit 2e6569b669)

Co-authored-by: Shantanu <hauntsaninja@users.noreply.github.com>
2020-01-29 21:42:38 -08:00
Miss Islington (bot) 696d2324cf
bpo-39485: fix corner-case in method-detection of mock (GH-18255)
Replace check for whether something is a method in the mock module. The
previous version fails on PyPy, because there no method wrappers exist
(everything looks like a regular Python-defined function). Thus the
isinstance(getattr(result, '__get__', None), MethodWrapperTypes) check
returns True for any descriptor, not just methods.

This condition could also return erroneously True in CPython for
C-defined descriptors.

Instead to decide whether something is a method, just check directly
whether it's a function defined on the class. This passes all tests on
CPython and fixes the bug on PyPy.
(cherry picked from commit a327677905)

Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>

Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
2020-01-29 16:15:36 +00:00
Miss Islington (bot) 526523c193
bpo-39153: Clarify C API *SetItem refcounting semantics (GH-18220)
Some of the *SetItem methods in the C API steal a reference to the
given value. This annotates the better behaved ones to assure the
reader that these are not the ones with the inconsistent behaviour.

* 📜🤖 Added by blurb_it.

* make docs consistent with signature

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit e1e80002e2)

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
2020-01-29 03:29:35 -08:00
Miss Islington (bot) dbb37aac14
bpo-39439: Fix multiprocessing spawn path in a venv on Windows (GH-18158)
(cherry picked from commit 0be3246d4f)

Co-authored-by: Adam Meily <ameily@users.noreply.github.com>
2020-01-28 02:52:47 -08:00
Miss Islington (bot) 46735c7e10
bpo-39393: Misleading error message on dependent DLL resolution failure (GH-18093)
(cherry picked from commit 13c1c3556f)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-01-28 02:00:16 -08:00
Miss Islington (bot) 595b516965
bpo-38883: Don't use POSIX `$HOME` in `pathlib.Path.home/expanduser` on Windows (GH-17961)
In bpo-36264 os.path.expanduser was changed to ignore HOME on Windows.

Path.expanduser/home still honored HOME despite being documented as behaving the same
as os.path.expanduser. This makes them also ignore HOME so that both implementations
behave the same way again.
(cherry picked from commit c45a2aa9e2)

Co-authored-by: Christoph Reiter <reiter.christoph@gmail.com>
2020-01-28 01:59:43 -08:00
Miss Islington (bot) b487a8ed5b
bpo-39392: Turtle overlap fill depends on OS (GH-18223)
Whether or not overlap regions for self-intersecting polygons
or multiple shapes are filled depends on the operating system graphics,
typeof overlap, and number of overlaps.
(cherry picked from commit 2824c45a0a)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-01-27 15:47:08 -08:00
mbarkhau cf9d005547 [3.8] bpo-39390 shutil: fix argument types for ignore callback (GH-18122) 2020-01-28 00:46:29 +01:00
Miss Islington (bot) 7b57b15bd8
bpo-30780: Add IDLE configdialog tests (GH-3592)
Expose dialog buttons to test code and complete their test coverage.
Complete test coverage for highlights and keys tabs.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit dd023ad161)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2020-01-27 14:35:08 -08:00
Matthew Kokotovich 19be85c765 [3.8] bpo-39082: Allow AsyncMock to correctly patch static/class methods (GH-18190)
(cherry picked from commit 62865f4532)

Co-authored-by: Matthew Kokotovich <mkokotovich@gmail.com>
2020-01-26 15:30:27 +00:00
Miss Islington (bot) a5906b2bfc bpo-38473: Handle autospecced functions and methods used with attach_mock (GH-16784) (GH-18167)
If an autospecced object is attached using attach_mock the
child would be a function with mock object as attribute from
which signature has to be derived.

(cherry picked from commit 66b00a9d3a)

Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
2020-01-25 20:23:08 +05:30
Miss Islington (bot) a234492854
bpo-39388: IDLE: Fix bug when cancelling out of configdialog (GH-18068)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit d0d9fa8c5e)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2020-01-25 01:17:54 -08:00
Miss Islington (bot) ea4a61fec8
bpo-39430: Fix race condition in lazy imports in tarfile. (GH-18161)
Use `from ... import ...` to ensure module is fully loaded before accessing its attributes.
(cherry picked from commit 9017e0bd5e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-01-24 12:10:42 -08:00
Alex Rebert 5654f83b97 [3.8] bpo-35182: fix communicate() crash after child closes its pipes (GH-18117) (GH-18148)
When communicate() is called in a loop, it crashes when the child process
has already closed any piped standard stream, but still continues to be running

Co-authored-by: Andriy Maletsky <andriy.maletsky@gmail.com>.
(cherry picked from commit d3ae95e1e9)

Co-authored-by: Alex Rebert <alex@forallsecure.com>





https://bugs.python.org/issue35182
2020-01-23 15:31:29 -08:00
Miss Islington (bot) 993811ffe7
bpo-39421: Fix posible crash in heapq with custom comparison operators (GH-18118)
* bpo-39421: Fix posible crash in heapq with custom comparison operators

* fixup! bpo-39421: Fix posible crash in heapq with custom comparison operators

* fixup! fixup! bpo-39421: Fix posible crash in heapq with custom comparison operators
(cherry picked from commit 79f89e6e5a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-01-23 07:22:25 -08:00
Miss Islington (bot) 3b7618809d
bpo-39050: The Help button in IDLE's config menu works again (GH-17611)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 2e43b64c94)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-01-22 20:13:29 -08:00
Miss Islington (bot) ab0d8e356e
bpo-39389: gzip: fix compression level metadata (GH-18077)
As described in RFC 1952, section 2.3.1, the XFL (eXtra FLags) byte of a
gzip member header should indicate whether the DEFLATE algorithm was
tuned for speed or compression ratio. Prior to this patch, archives
emitted by the `gzip` module always indicated maximum compression.
(cherry picked from commit eab3b3f1c6)

Co-authored-by: William Chargin <wchargin@gmail.com>
2020-01-21 03:42:49 -08:00
Miss Islington (bot) 060ad2fc15
bpo-32989: IDLE - fix bad editor call of pyparse method (GH-5968)
Fix comments and add tests for editor newline_and_indent_event method.
Remove unused None default for function parameter of pyparse find_good_parse_start method
and code triggered by that default.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit ec64640a2c)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2020-01-21 02:29:39 -08:00
Miss Islington (bot) 5cadd3fe3a
bpo-39386: Prevent double awaiting of async iterator (GH-18081)
(cherry picked from commit a96e06db77)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2020-01-20 15:06:40 -08:00
Miss Islington (bot) 6aeed01901
Fix asyncio.get_event_loop() documentation (GH-18051)
Mention that the function implicitly creates new event loop only if called from the main thread.
(cherry picked from commit 2c49becc69)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2020-01-20 14:52:35 -08:00
Miss Islington (bot) 23793edf0d
bpo-35561: Supress valgrind false alarm on epoll_ctl(event) (GH-18060)
Update Misc/valgrind-python.supp to suppress the false alarm.
(cherry picked from commit d8ef64422a)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-01-19 14:44:35 -08:00
Karthikeyan Singaravelan 9955f33cdb [3.8] bpo-39033: Fix NameError in zipimport during hash validation (GH-17588) (GH-17642)
Fix `NameError` in `zipimport` during hash validation and add a regression test.

(cherry picked from commit 79f02fee1a)



https://bugs.python.org/issue39033
2020-01-14 03:39:19 -08:00
toonarmycaptain f1f0c58d38 [3.8] Fix typos in Misc/NEWS.d (GH-17930) 2020-01-13 00:56:26 +02:00
Miss Islington (bot) ef0af30e50
bpo-3530: Add advice on when to correctly use fix_missing_locations in the AST docs (GH-17172)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
(cherry picked from commit 6680f4a9f5)

Co-authored-by: Batuhan Taşkaya <47358913+isidentical@users.noreply.github.com>
2020-01-12 12:44:33 -08:00
Miss Islington (bot) 3043ec7d6a
bpo-38293: Allow shallow and deep copying of property objects (GH-16438)
Copying property objects results in a TypeError. Steps to reproduce:

```
>>> import copy
>>> obj = property()
>>> copy.copy(obj)
````

This affects both shallow and deep copying.
My idea for a fix is to add property objects to the list of "atomic" objects in the copy module.
These already include types like functions and type objects.

I also added property objects to the unit tests test_copy_atomic and test_deepcopy_atomic. This is my first PR, and it's highly likely I've made some mistake, so please be kind :)

https://bugs.python.org/issue38293
(cherry picked from commit 9f3fc6c5b4)

Co-authored-by: Guðni Natan Gunnarsson <1493259+GudniNatan@users.noreply.github.com>
2020-01-12 10:04:18 -08:00
Miss Islington (bot) 98b1c0c7ac bpo-39297: Update for importlib_metadata 1.4. (GH-17947) (GH-17952)
* bpo-39297: Update for importlib_metadata 1.4. Includes performance updates.

* 📜🤖 Added by blurb_it.

* Update blurb

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 136735c1a2)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-01-11 10:56:57 -05:00
Miss Islington (bot) 33e033da3c
bpo-39235: Fix end location for genexp in call args (GH-17925)
The fix changes copy_location() to require an extra node from which to extract the end location, and fixing all 5 call sites.

https://bugs.python.org/issue39235
(cherry picked from commit a796d8ef9d)

Co-authored-by: Guido van Rossum <guido@python.org>
2020-01-09 11:39:00 -08:00
Miss Islington (bot) b24e4fac03
bpo-39242: Updated the Gmane domain into news.gmane.io (GH-17903)
(cherry picked from commit 2e6a8efa83)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2020-01-08 07:48:33 -08:00
Miss Islington (bot) 39a5c889d3
bpo-38871: Fix lib2to3 for filter-based statements that contain lambda (GH-17780)
Correctly parenthesize filter-based statements that contain lambda
expressions in lib2to3.
(cherry picked from commit b821173b54)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2020-01-07 09:52:06 -08:00
Miss Islington (bot) bff48c6734 bpo-39198: Ensure logging global lock is released on exception in isEnabledFor (GH-17689) (GH-17897)
(cherry picked from commit 950c6795aa)
2020-01-07 17:03:23 +00:00
Miss Islington (bot) b2e281aaa2
bpo-39209: Manage correctly multi-line tokens in interactive mode (GH-17860)
(cherry picked from commit 5ec91f78d5)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-01-06 08:26:13 -08:00
Miss Islington (bot) 5ed9d60bc5 bpo-38907: In http.server script, restore binding to IPv4 on Windows. (GH-17851) (#17854)
(cherry picked from commit ee94bdb059)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2020-01-06 07:34:10 -05:00
Miss Islington (bot) 49c108c832
Fix constant folding optimization for positional only arguments (GH-17837)
(cherry picked from commit b121a4a45f)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2020-01-05 09:21:47 -08:00
Miss Islington (bot) 636a850ed8
bpo-39152: add missing ttk.Scale.configure return value (GH-17815)
tkinter.ttk.Scale().configure([name]) now returns a configuration tuple for name
or a list thereof for all options. Based on patch Giovanni Lombardo.
(cherry picked from commit 5ea7bb25e3)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-01-05 09:07:30 -08:00
Miss Islington (bot) 34aa3e71dc
bpo-39055: Reject a trailing \n in base64.b64decode() with validate=True. (GH-17616)
(cherry picked from commit b19c0d77e6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-01-05 04:36:48 -08:00
Miss Islington (bot) e1caa49f68
bpo-39056: Fix handling invalid warning category in the -W option. (GH-17618)
No longer import the re module if it is not needed.
(cherry picked from commit 41ec17e45d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-01-05 04:33:08 -08:00
Miss Islington (bot) fc84d501b9
bpo-39057: Fix urllib.request.proxy_bypass_environment(). (GH-17619)
Ignore leading dots and no longer ignore a trailing newline.
(cherry picked from commit 6a265f0d0c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-01-05 04:32:00 -08:00
Miss Islington (bot) 859525590c
Fix SystemError when nested function has annotation on positional-only argument (GH-17826)
(cherry picked from commit ec007cb43f)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2020-01-04 18:14:58 -08:00
Andrew Svetlov 867d8333ce
[3.8] bpo-39191: Don't spawn a task before failing (GH-17796) (GH-17820)
(cherry picked from commit 3a5de51159)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2020-01-04 11:49:11 +02:00
Miss Islington (bot) 1d5a7e5694 bpo-39142: Avoid converting namedtuple instances to ConvertingTuple. (GH-17773) (GH-17785)
(cherry picked from commit 46abfc1416)
2020-01-01 20:06:52 +00:00
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
Éric Araujo 9ee1b15614
Reorder entries in Misc/ACKS (GH-17663) (GH-17673) 2019-12-28 15:41:21 -05: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