Commit graph

108554 commits

Author SHA1 Message Date
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
Miss Islington (bot)
099e6a4096
bpo-30757: Improve "How to make stand-alone binaries" FAQ (GH-26309) (GH-26312)
Co-authored-by: denfromufa <denfromufa@users.noreply.github.com>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
(cherry picked from commit 2a1e6698b1)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-22 23:23:11 +01:00
Mariusz Felisiak
b21193dd1e
[3.9] Remove duplicate words in docs. (GH-26167) (GH-26297)
(cherry picked from commit b06ed1d883)
2021-05-22 21:56:19 +01:00
Miss Islington (bot)
11b5045b0c
bpo-8264: Document hasattr and getattr behavior for private attributes (GH-23513) (GH-26238)
Clarify ``getattr`` and ``setattr`` requirements for accessing name-mangled attributes

Co-Authored-By: Catalin Iacob <iacobcatalin@gmail.com>
(cherry picked from commit 2edaf6a4fb)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-05-22 12:06:46 +01:00
Miss Islington (bot)
a373c80811
Specify Python Cookbook edition for reference (GH-26301) (#26303)
(cherry picked from commit 604cd71e50)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-05-21 23:48:31 +01:00
Zackery Spytz
96c9961bfe
bpo-43556: Fix the attr names for ast.expr and ast.stmt in the docs (GH-24940) 2021-05-21 21:29:12 +01:00
Miss Islington (bot)
e10bd76d47
bpo-43927: Change 'IOError' to 'OSError' (GH-26289)
This is the last remaining instance, at least for this chapter, in 3.10 & 3.11.
(cherry picked from commit 2f47d8dcc7)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-05-21 11:17:10 -07:00
Miss Islington (bot)
bcd59134f5
[doc] Fix indentation in inspect documentation (GH-24846) (GH-26288)
(cherry picked from commit 642fdfdc04)

Co-authored-by: Numerlor <25886452+Numerlor@users.noreply.github.com>
2021-05-21 18:06:58 +01:00
Jakub Kulík
d3cc68900d
[3.9] bpo-43667: Fix broken Unicode encoding in non-UTF locales on Solaris (GH-25096) (GH-25847)
(cherry picked from commit 9032cf5cb1)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
2021-05-21 16:59:39 +02:00
Senthil Kumaran
0593ae84af
[3.9] bpo-43882 - Mention urllib.parse changes in Whats new section. (GH-26276)
* [3.9] bpo-43882 - Mention urllib.parse changes in Whats new section.

* Add the missing section.
2021-05-21 05:30:04 -07:00
Miss Islington (bot)
b9258b03b8
bpo-36160: Fix test_site so that it can run independently of other tests (GH-12131) (GH-26263)
(cherry picked from commit 1270ad6ec8)

Co-authored-by: native-api <vano@mail.mipt.ru>
2021-05-20 11:41:43 +01:00
Miss Islington (bot)
eecdc9e1f7
Update link in SECURITY.md (GH-21320) (GH-26260)
(cherry picked from commit 4d396e7d79)

Co-authored-by: Marcono1234 <Marcono1234@users.noreply.github.com>
2021-05-19 22:05:41 -04:00
Miss Islington (bot)
c87b81dcb2
bpo-43295: Fix error handling of datetime.strptime format string '%z' (GH-24627) (#25695)
Previously, `datetime.strptime` would match `'z'` with the format string `'%z'` (for UTC offsets), throwing an `IndexError` by erroneously trying to parse `'z'` as a timestamp. As a special case, `'%z'` matches the string `'Z'` which is equivalent to the offset `'+00:00'`, however this behavior is not defined for lowercase `'z'`.

This change ensures a `ValueError` is thrown when encountering the original example, as follows:

```
>>> from datetime import datetime
>>> datetime.strptime('z', '%z')
ValueError: time data 'z' does not match format '%z'
```

Automerge-Triggered-By: GH:pganssle
(cherry picked from commit 04f6fbb696)

Co-authored-by: Noor Michael <nsmichael31@gmail.com>

Co-authored-by: Noor Michael <nsmichael31@gmail.com>
2021-05-19 20:37:49 -04:00
Miss Islington (bot)
dc6526dfa2
[doc] Fix typo in asyncio-eventloop documentation (GH-22311) (GH-26257)
(cherry picked from commit b66a03a491)

Co-authored-by: Bruno <brunogeninatti@gmail.com>
2021-05-19 22:20:10 +01:00
Miss Islington (bot)
ab1c3d99f5
bpo-37741: make importlib.metadata docs discoverable through a module directive. (GH-25415) (GH-25417)
Automerge-Triggered-By: GH:jaraco
(cherry picked from commit 23acadcc1c)

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

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2021-05-19 17:06:55 -04:00
Miss Islington (bot)
9a75cc6044
bpo-40975: [doc] Identify AsyncExitStack.enter_async_context()/aclose() as coroutine methods (GH-20870) (GH-26255)
(cherry picked from commit c054e8f78f)

Co-authored-by: naglis <naglis@users.noreply.github.com>
2021-05-19 21:37:52 +01:00
Miss Islington (bot)
021169f768
Fix compiler warning for misleading guarding in the tkinter (GH-26244) (GH-26252)
The newest gcc emmits this warning:

```
/Modules/_tkinter.c:272:9: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
  272 |         if(tcl_lock)PyThread_acquire_lock(tcl_lock, 1); tcl_tstate = tstate; }
      |         ^~
/Modules/_tkinter.c:2869:5: note: in expansion of macro ‘LEAVE_PYTHON’
 2869 |     LEAVE_PYTHON
      |     ^~~~~~~~~~~~
/Modules/_tkinter.c:243:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
  243 |     (*(PyThreadState**)Tcl_GetThreadData(&state_key, sizeof(PyThreadState*)))
      |     ^
/Modules/_tkinter.c:272:57: note: in expansion of macro ‘tcl_tstate’
  272 |         if(tcl_lock)PyThread_acquire_lock(tcl_lock, 1); tcl_tstate = tstate; }
      |                                                         ^~~~~~~~~~
/Modules/_tkinter.c:2869:5: note: in expansion of macro ‘LEAVE_PYTHON’
 2869 |     LEAVE_PYTHON

```

that's because the macro packs together two statements at the same level
as the "if". The warning is misleading but is very noisy so it makes
sense to fix it.
(cherry picked from commit 95d04710c5)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-19 19:27:19 +01:00
Pablo Galindo
d4a9264ab8
[3.9] bpo-44168: Fix error message in the parser for keyword arguments for invalid expressions (GH-26210) (GH-26250)
(cherry picked from commit 33c0c90dea)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-19 19:26:59 +01:00
Miss Islington (bot)
509e1c9d35
Fix compiler warning in the xml module (GH-26245) (GH-26248)
The newest version of gcc complains about passing un-initialized arrays
as constant pointers:

```
/Modules/expat/xmltok_ns.c: In function ‘findEncodingNS’:
/Modules/expat/xmltok.h:272:10: warning: ‘buf’ may be used uninitialized [-Wmaybe-uninitialized]
  272 |   (((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim))
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Modules/expat/xmltok_ns.c:95:3: note: in expansion of macro ‘XmlUtf8Convert’
   95 |   XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1);
      |   ^~~~~~~~~~~~~~
/Modules/expat/xmltok.h:272:10: note: by argument 5 of type ‘const char *’ to ‘enum XML_Convert_Result(const ENCODING *, const char **, const char *, char **, const char *)’ {aka ‘enum XML_Convert_Result(const struct encoding *, const char **, const char *, char **, const char *)’}
  272 |   (((enc)->utf8Convert)(enc, fromP, fromLim, toP, toLim))
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Modules/expat/xmltok_ns.c:95:3: note: in expansion of macro ‘XmlUtf8Convert’
   95 |   XmlUtf8Convert(enc, &ptr, end, &p, p + ENCODING_MAX - 1);
      |   ^~~~~~~~~~~~~~
In file included from /Modules/expat/xmltok.c:1657:
/Modules/expat/xmltok_ns.c:92:8: note: ‘buf’ declared here
   92 |   char buf[ENCODING_MAX];

```
(cherry picked from commit be93f81e58)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-19 19:21:07 +01:00
Tal Einat
0bcd1515aa
[3.9] backport non-content changes to IDLE's help.html (GH-26239)
Followup to GH-25851 to synchonize with 3.10.
Signed-off-by: Tal Einat <532281+taleinat@users.noreply.github.com>
2021-05-19 07:59:38 -04:00
Miss Islington (bot)
74eb94af2b
bpo-35765: Clarify references to "object x" in the JSON tutorial (GH-22411) (GH-26219)
(cherry picked from commit 4fdcc39f71)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2021-05-19 09:59:36 +01:00
Miss Islington (bot)
5b5a10c874
bpo-44106: Purge unused sqlite3 doc includes (GH-26234)
(cherry picked from commit d798acc873)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-19 11:17:03 +03:00
Miss Islington (bot)
db20afe6c4
bpo-44106: Improve sqlite3 example database contents (GH-26027)
(cherry picked from commit 92d1064727)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-19 10:43:44 +03:00
Miss Islington (bot)
76ed53ca7b
bpo-30593: Doc'ed that executescript() disregards isolation level (GH-26220)
(cherry picked from commit 9014437573)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-19 10:32:45 +03:00
Ken Jin
632b4034ab
[3.9] bpo-42783: Documentation for asyncio.sleep(0) (GH-24002) (GH-24153)
Co-Authored-By: Simon Willison <swillison@gmail.com>
2021-05-18 23:31:27 +01:00