Commit graph

108578 commits

Author SHA1 Message Date
Miss Islington (bot)
0ff487b8ab
bpo-44287: asyncio test_popen() uses longer timeout (GH-26832)
Fix asyncio test_popen() of test_windows_utils by using a longer
timeout. Use military grade battle-tested test.support.SHORT_TIMEOUT
timeout rather than a hardcoded timeout of 10 seconds: it's 30
seconds by default, but it is made longer on slow buildbots.

WaitForMultipleObjects() timeout argument is in milliseconds.
(cherry picked from commit be1cb3214d)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-06-21 17:29:13 -07:00
Miss Islington (bot)
d881002fbd
bpo-13814: Explain why generators are not context managers (GH-26835)
Put entry in Design FAQ after a question about a context manager for assignment.
Original patch by Aidan Lowe.
(cherry picked from commit 51f45d085d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-06-21 18:03:06 -04:00
Miss Islington (bot)
67b3a99953
bpo-44395: Fix MIMEPart.as_string to pass unixfrom properly (GH-26685)
(cherry picked from commit 30f7a77f35)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2021-06-21 07:27:42 -07:00
Victor Stinner
83ad40efc3
bpo-44434: Don't call PyThread_exit_thread() explicitly (GH-26758) (GH-26825)
_thread.start_new_thread() no longer calls PyThread_exit_thread()
explicitly at the thread exit, the call was redundant.

On Linux with the glibc, pthread_cancel() loads dynamically the
libgcc_s.so.1 library. dlopen() can fail if there is no more
available file descriptor to open the file. In this case, the process
aborts with the error message:

"libgcc_s.so.1 must be installed for pthread_cancel to work"

pthread_cancel() unwinds back to the thread's wrapping function that
calls the thread entry point.

The unwind function is dynamically loaded from the libgcc_s library
since it is tightly coupled to the C compiler (GCC). The unwinder
depends on DWARF, the compiler generates DWARF, so the unwinder
belongs to the compiler.

Thanks Florian Weimer and Carlos O'Donell for their help on
investigating this issue.

(cherry picked from commit 45a78f906d)
2021-06-21 14:22:56 +02:00
Miss Islington (bot)
175e264d36
bpo-44469: Fix tests for "async with" with bad object (GH-26817)
Test for execution of the body was null. It would pass
even if the code which should be skipped was executed.
(cherry picked from commit 5d2b3a0d68)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-06-21 00:54:04 -07:00
Miss Islington (bot)
533bff4e9f
bpo-44426: Fix use of the C keyword 'default' as a variable name (GH-26798) (GH-26805)
(cherry picked from commit 291848195f)
2021-06-19 16:16:38 +01:00
Miss Islington (bot)
686c6f303a
bpo-44426: Use of 'complex' as a C variable name confuses Sphinx; change it to 'num'. (GH-26744) (GH-26761)
(cherry picked from commit 7247f6f433)
2021-06-16 20:13:53 +01:00
Ken Jin
c7e95715ec
[3.9] bpo-44392: Add Py_GenericAlias to C API docs (GH-26724) (GH-26757)
(cherry picked from commit 6773c3eaa7)
2021-06-16 08:34:52 -07:00
Miss Islington (bot)
8fe57aacc7
bpo-44422: Fix threading.enumerate() reentrant call (GH-26727) (GH-26738)
The threading.enumerate() function now uses a reentrant lock to
prevent a hang on reentrant call.
(cherry picked from commit 243fd01047)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-06-15 18:30:26 +02:00
Pablo Galindo
0d0a9eaa82
[3.9] bpo-44409: Fix error location in tokenizer errors that happen during initialization (GH-26712). (GH-26723)
(cherry picked from commit 507ed6fa1d)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-06-14 18:07:51 +01:00
Miss Islington (bot)
7f021952b2
bpo-38291: Remove mention of typing.io and typing.re again (GH-26113)
They were originally removed in GH-10173 per bpo-35089, but then
readded in GH-21574. Cf. bpo-38291 for decision to remove.
(cherry picked from commit 8a76683cfb)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2021-06-14 08:07:05 -07:00
Miss Islington (bot)
9ee8752162
Fix a potential reference-counting bug in long_pow (GH-26690) (#26702)
(cherry picked from commit 5924243199)

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

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
2021-06-13 08:42:43 +01:00
Miss Islington (bot)
a9e20cf7bb
bpo-40128: Fix IDLE autocomplete on macOS (GH-26672)
In particular, when running with tk8.6.8, as in PSF 3.9.

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

Co-authored-by: Kaustubh J <kaustubhkj@gmail.com>
2021-06-11 19:24:40 -04:00
Miss Islington (bot)
57b3ca7f0a
bpo-41299: Reduce lag in Windows threading timeouts by using a higher precision time source (GH-26568)
(cherry picked from commit 449e6f0ef3)

Co-authored-by: Ryan Hileman <lunixbochs@gmail.com>
2021-06-11 15:03:10 -07:00
Miss Islington (bot)
9580d3894a
bpo-44381: Windows build now allows enabling control flow guard (GH-26645)
(cherry picked from commit 5af56c6f2a)
2021-06-11 22:16:50 +01:00
Miss Islington (bot)
6df926f1c4
bpo-43318: Fix a bug where pdb does not always echo cleared breakpoints (GH-24646) (GH-26675)
(cherry picked from commit 4cb6ba1432)

Co-authored-by: huzhaojie <hu.zj@foxmail.com>
2021-06-11 17:18:49 +01:00
Ethan Furman
e9726314df
[Enum] improve pickle support (#26666)
search all bases for a __reduce__ style method; if a __new__ method is
found first the enum will be made unpicklable
2021-06-11 01:26:32 -07:00
Lysandros Nikolaou
3ce35bfbbe
[3.9] bpo-44385: Remove unused grammar rules (GH-26655) (GH-26659)
(cherry picked from commit e7b4644607)
2021-06-10 15:52:49 -07:00
Miss Islington (bot)
304ec53b53
bpo-44356: [Enum] allow multiple data-type mixins if they are all the same (GH-26649) (GH-26652)
This enables, for example, two base Enums to both inherit from `str`, and then both be mixed into the same final Enum:

    class Str1Enum(str, Enum):
        GH- some behavior here

    class Str2Enum(str, Enum):
        GH- some more behavior here

    class FinalStrEnum(Str1Enum, Str2Enum):
        GH- this now works
(cherry picked from commit 8a4f0850d7)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2021-06-10 15:03:29 -07:00
Miss Islington (bot)
175ebc60d5
bpo-37022: Fix bug where pdb's do_p/do_pp commands swallow exceptions from repr (GH-18180) (GH-26651)
(cherry picked from commit 6544b2532d)

Co-authored-by: Daniel Hahler <git@thequod.de>
2021-06-10 22:24:03 +01:00
Miss Islington (bot)
9b889433c7
bpo-33962: Use ttk spinbox for IDLE indent space config (GH-22954)
If ttk.Spinbox is not available (Tk < 8.5.9) use readonly ttk.Combobox.

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

Co-authored-by: Mark Roseman <mark@markroseman.com>
2021-06-10 12:40:39 -07:00
Miss Islington (bot)
865269458f
bpo-44363: Get test_capi passing with address sanitizer (GH-26639)
(cherry picked from commit 31aa0dbff4)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2021-06-10 05:01:22 -07:00
Miss Islington (bot)
d9f38d77c8
bpo-40468: Split IDLE settings General tab (GH-26621)
Replace it with Windows tab for Shell and Editor options
and Shell/Ed for options exclusive to one of them.

Create room for more options and make dialog shorter,
to better fit small windows.
(cherry picked from commit 275d5f7957)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-06-09 13:41:24 -07:00
Miss Islington (bot)
c8353239ed
bpo-40468: Factor out class ExtPage in idlelib.configdialog (GH-26618)
(cherry picked from commit 5571cabf1b)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-06-08 19:05:28 -07:00
Miss Islington (bot)
c03f0ab259
bpo-40468: Move IDLE helplist settings to extensions page of dialog. (GH-26593)
These are the settings that extend the help menu.  Moving them shortens the dialog and will help with it being too tall for small screens.
(cherry picked from commit ab36b9f834)
2021-06-08 17:26:56 -04:00
Batuhan Taskaya
87f502231c
[3.9] bpo-11105: reduce the recursion limit for tests. (GH-26605)
(cherry picked from commit e58d762c1f)

Co-authored-by: Batuhan Taskaya <batuhan@python.org>
2021-06-08 20:39:47 +03:00
Terry Jan Reedy
d5f8bd60e1
[3.9] bpo-44322: Document more SyntaxError details. (GH-26562)
1. SyntaxError args have a tuple of other attributes.
2. Attributes are adjusted for errors in f-string field expressions.
3. Compile() can raise SyntaxErrors.

(cherry picked from commit 67dfa6f2a5)
2021-06-06 22:57:53 -04:00
Miss Islington (bot)
8e2c0fd7ad
bpo-44320: Fix markup for W3C C14N test suite (GH-26556)
(cherry picked from commit 71be461704)

Co-authored-by: NAKAMURA Osamu <osamu0329nakamura@users.noreply.github.com>
2021-06-05 19:57:24 -07:00
Miss Islington (bot)
b3c50b29e1
bpo-38323: Skip SubprocessMultiLoopWatcherTest as they can hang the test suite (GH-26542)
(cherry picked from commit f171877ebe)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-06-04 16:59:55 -07:00
Miss Islington (bot)
ea298e1e33
bpo-44279: revert 'exceptions are raised' back to 'exceptions occur' (GH-26492) (GH-26539)
(cherry picked from commit dda9ecbfec)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2021-06-04 23:09:45 +01:00
Batuhan Taskaya
de58b319af
[3.9] bpo-11105: Do not crash when compiling recursive ASTs (GH-20594) (GH-26522)
When compiling an AST object with a direct / indirect reference
cycles, on the conversion phase because of exceeding amount of
calls, a segfault was raised. This patch adds recursion guards to
places for preventing user inputs to not to crash AST but instead
raise a RecursionError..
(cherry picked from commit f3491242e4)

Co-authored-by: Batuhan Taskaya <batuhan@python.org>
2021-06-03 22:22:34 +01:00
Gregory P. Smith
5a8ddcc452
[3.9] bpo-43776: Remove list call from args in Popen repr (GH-25338) (GH-26510)
Removes the `list` call in the Popen `repr`.

Current implementation:

For cmd = `python --version`,  with `shell=True`.

```bash
<Popen: returncode: None args: ['p', 'y', 't', 'h', 'o', 'n', ' ', '-', '-',...>
```

For `shell=False` and args=`['python', '--version']`, the output is correct:

```bash
<Popen: returncode: None args: ['python', '--version']>
```

With the new changes the `repr`  yields:

For cmd = `python --version`,  with `shell=True`:

```bash
<Popen: returncode: None args: 'python --version'>
```

For `shell=False` and args=`['python', '--version']`, the output:

```bash
<Popen: returncode: None args: ['python', '--version']>
```

Automerge-Triggered-By: GH:gpshead.
(cherry picked from commit db0c5b786d)

Co-authored-by: M. Kocher <michael.kocher@me.com>

Co-authored-by: M. Kocher <michael.kocher@me.com>
2021-06-02 21:15:26 -07:00
Miss Islington (bot)
5df4abd6b0
bpo-44022: Improve the regression test. (GH-26503)
It wasn't actually detecting the regression due to the
assertion being too lenient.
(cherry picked from commit e60ab843cb)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2021-06-02 21:10:22 -07:00
Joshua Root
991693a217
[3.9] bpo-43568: Relax distutils MACOSX_DEPLOYMENT_TARGET check (GH-25827) (GH-26001)
Only complain if the config target is >= 10.3 and the current target is
< 10.3. The check was originally added to ensure that incompatible
LDSHARED flags are not used, because '-undefined dynamic_lookup' is
used when building for 10.3 and later, and is not supported on older OS
versions. Apart from that, there should be no problem in general
with using an older target. In particular, this allows targeting macOS
11.0 when Python was built for a newer minor version like 11.3.

(manually cherry picked from part of commit 8703178)
2021-06-02 20:25:15 -04:00
Miss Islington (bot)
85b587a38d
bpo-44285: getpath.c: Assert that env_file is NULL during an error check (GH-26486) (GH-26496)
This was flagged by a static analyzer, but the logic of why this is NULL on error is hard to follow for humans as well.
(cherry picked from commit bdb56902a3)

Co-authored-by: stratakis <cstratak@redhat.com>
2021-06-03 01:50:55 +02:00
Irit Katriel
9a68862497
[3.9] bpo-44279: [doc] reword contextlib.suppress documentation (GH-26428) (GH-26481)
(cherry picked from commit 87272b70f1)

Co-authored-by: MapleCCC <littlelittlemaple@gmail.com>
2021-06-01 23:15:48 +01:00
Miss Islington (bot)
46b16d0bdb
bpo-44263: Fix _decimal and _testcapi GC protocol (GH-26464)
* _testcapi.heapgctype: implement a traverse function since the type
  is defined with Py_TPFLAGS_HAVE_GC.
* _decimal: PyDecSignalDictMixin_Type is no longer defined with
  Py_TPFLAGS_HAVE_GC since it has no traverse function.
(cherry picked from commit 142e5c5445)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-05-31 04:33:31 -07:00
Miss Islington (bot)
9bcb76c24f
bpo-44254: On Mac, remove disfunctional colors from turtledemo buttons (GH-26448)
On macOS, tk defers to system setting for button background when in normal state.
Give turtledemo button text a color that works on either light or dark background.
(cherry picked from commit af5a324843)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-05-29 04:16:34 -04:00
Miss Islington (bot)
7bd1304d49
bpo-44263: Mention PyType_Ready in the gc protocol warning (GH-26445)
(cherry picked from commit 43cf7c864a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-28 20:53:40 -07:00
Miss Islington (bot)
a30cbaee84
bpo-44263: Better explain the GC contract for PyType_FromSpecWithBases (GH-26442)
(cherry picked from commit 8b55bc3f93)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-28 20:20:54 -07:00
Miss Islington (bot)
d5b657b964
Fix dataclass comment typo _eq__ -> __eq__ (GH-26433) (GH-26437)
(cherry picked from commit 7e6f237569)

Co-authored-by: Sean Grady <vedicmonk@gmail.com>

Co-authored-by: Sean Grady <vedicmonk@gmail.com>
2021-05-28 21:07:39 -04:00
Miss Islington (bot)
8f8f2ea832
bpo-44249: Fix 3 README.rst typos (GH-26385)
(cherry picked from commit acac6c71ff)


Co-authored-by: Ayush Parikh <ayushparikh332@gmail.com>
2021-05-28 16:02:47 -04:00
Miss Islington (bot)
21a56a4bce
bpo-41611: IDLE: Catch TclError exceptions in AutoCompleteWindow.winconfig_event() (GH-26404)
Since the <Configure> event may occur after the
completion window is gone, catch potential
TclError exceptions when accessing acw.

(cherry picked from commit 4e2e5c1c4f)
2021-05-28 09:39:59 +03:00
Miss Islington (bot)
427232f9d2
bpo-43667: Add news fragment for Solaris changes (GH-26405) (GH-26410)
(cherry picked from commit 164a4f46d1)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
2021-05-27 19:23:51 +02:00
Miss Islington (bot)
65fb9a2701
bpo-41611: IDLE: fix freezing on completion on macOS (GH-26400)
(cherry picked from commit abc4bd5db9)

Co-authored-by: Tal Einat <532281+taleinat@users.noreply.github.com>
2021-05-27 08:08:00 -07:00
Miss Islington (bot)
bee66d3cb9
bpo-41147: [doc] contextlib.redirect_stdout() provides the new stream as context var (GH-21199) (GH-26380)
(cherry picked from commit 46db39d7bd)

Co-authored-by: Peter Law <PeterJCLaw@gmail.com>
2021-05-26 15:43:37 +01:00
Miss Islington (bot)
e7078ee116
Point to recent link to PyFLTK (GH-26315) (GH-26367)
(cherry picked from commit ee3d78ef73)

Co-authored-by: Mark <mark@qtrac.eu>

Co-authored-by: Mark <mark@qtrac.eu>
2021-05-25 18:03:43 -03:00
Miss Islington (bot)
8accb8c8cc
bpo-20408: Fix memoryview() signature in docs (GH-24431)
(cherry picked from commit d18e5dae91)

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-05-25 17:30:42 +03:00
Miss Islington (bot)
3af61a7176
bpo-43109: Fix --with-lto configure option on macOS (GH-26341) (GH-26343)
Allow --with-lto configure option to work with Apple-supplied Xcode or
Command Line Tools which do not provide llvm-ar.
(cherry picked from commit 59acfd4a09)

Co-authored-by: Ned Deily <nad@python.org>
2021-05-25 00:21:28 -04:00
Miss Islington (bot)
ab4da07923
[3.9] bpo-44195: Use 'TraversableResources' in the docs to match the implementation. (GH-26317) (GH-26335)
(cherry picked from commit 7148293d96)


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

Automerge-Triggered-By: GH:jaraco
2021-05-24 10:33:03 -07:00