Commit graph

108518 commits

Author SHA1 Message Date
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
Miss Islington (bot)
c17ba233b3
bpo-41963: document that ConfigParser strips off comments (GH-26197) (GH-26213)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Laura Gutierrez Funderburk <58710704+lgfunderburk@users.noreply.github.com>
Co-authored-by: Jürgen Gmach <juergen.gmach@googlemail.com>

(cherry picked from commit 02ee819126)
2021-05-18 18:44:48 +02:00
Irit Katriel
c05d8a6b67
bpo-25872: Add unit tests for linecache and threading (GH-25913) (GH-26211)
(cherry picked from commit 115dea9e26)

Co-authored-by: uniocto <serit142sa33go@gmail.com>
2021-05-18 15:25:38 +01:00
Miss Islington (bot)
049c4125f8
bpo-43650: Fix MemoryError on zip.read in shutil._unpack_zipfile for large files (GH-25058)
`shutil.unpack_archive()` tries to read the whole file into memory, making no use of any kind of smaller buffer. Process crashes for really large files: I.e. archive: ~1.7G, unpacked: ~10G. Before the crash it can easily take away all available RAM on smaller systems. Had to pull the code form `zipfile.Zipfile.extractall()` to fix this

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

Co-authored-by: Igor Bolshakov <ibolsch@gmail.com>
2021-05-17 10:34:39 -07:00
Miss Islington (bot)
2057ce8749
[3.9] bpo-44145: Release the GIL around HMAC_Update. (GH-26157) (GH-26188)
It was always meant to be released for parallelization.
This now matches the other similar code in the module.

Thanks michaelforney for noticing!
(cherry picked from commit c10392e7dd)


Co-authored-by: Gregory P. Smith <greg@krypto.org>

Automerge-Triggered-By: GH:gpshead
2021-05-17 01:07:49 -07:00
Miss Islington (bot)
2f9ebe6fd0
[doc] Fix typo in os module (GH-24464)
Automerge-Triggered-By: GH:iritkatriel
(cherry picked from commit fdc7e52f5f)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2021-05-16 17:00:12 -07:00
Miss Islington (bot)
f84ef3cd25
fix docstring typo in bdb.py (GH-22323) (#26180)
(cherry picked from commit be54fb5ae7)

Co-authored-by: flizzywine <1041958497@qq.com>
2021-05-17 00:43:26 +01:00
Miss Islington (bot)
ea33d204ce
[3.9] Fix typo in comment (GH-26162) (GH-26165)
(cherry picked from commit de367378f6)


Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>

Automerge-Triggered-By: GH:iritkatriel
2021-05-16 11:08:10 -07:00
Miss Islington (bot)
d43e1cbcc1
Remove a redundant assignment in Tools/unittestgui/unittestgui.py (GH-21438) (#26169)
(cherry picked from commit a42d98ed91)

Co-authored-by: Serhii Hidenko <shidenko97@gmail.com>
2021-05-16 17:17:55 +01:00
Miss Islington (bot)
925cb85e9e
bpo-44114: Fix dictkeys_reversed and dictvalues_reversed function signatures (GH-26062) (GH-26093)
These are passed and called as PyCFunction, however they are defined here without the (ignored) args parameter.

This works fine in some C compilers, but fails in webassembly or anything else that has strict function pointer call type checking.
(cherry picked from commit ab383eb6f0)

Co-authored-by: Joe Marshall <joe.marshall@nottingham.ac.uk>

Co-authored-by: Joe Marshall <joe.marshall@nottingham.ac.uk>
2021-05-16 17:34:43 +03:00
Miss Islington (bot)
376740110e
bpo-32133: Improve numbers docs (GH-26124) (GH-26147) 2021-05-15 10:28:05 -07:00
Antoine Pitrou
b30b25b266
[3.9] bpo-37788: Fix reference leak when Thread is never joined (GH-26103) (GH-26142)
When a Thread is not joined after it has stopped, its lock may remain in the _shutdown_locks set until interpreter shutdown.  If many threads are created this way, the _shutdown_locks set could therefore grow endlessly.  To avoid such a situation, purge expired locks each time a new one is added or removed..
(cherry picked from commit c10c2ec7a0)

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

Automerge-Triggered-By: GH:pitrou
2021-05-15 02:51:20 -07:00
Miss Islington (bot)
fa9de0c383
bpo-44072: fix Complex, Integral docs for ** (GH-25986)
In numbers module docstrings and docs.
(cherry picked from commit 4aa63d65a9)

Co-authored-by: Rory Yorke <rory.yorke@gmail.com>
2021-05-14 15:25:43 -07:00
Miss Islington (bot)
c90642b0d4
bpo-43729: Clarify comment in tutorial example (GH-25191) (GH-26137)
(cherry picked from commit 07797121cc)

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

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-14 13:06:34 -07:00
Miss Islington (bot)
41ed452a91
Subprocess Protocols Documentation (GH-20950) (GH-26134)
Should be "Subprocess Protocol instances" not "Datagram Protocol instances"
(cherry picked from commit 2918846a4f)

Co-authored-by: kudavid <67070184+kudavid@users.noreply.github.com>

Co-authored-by: kudavid <67070184+kudavid@users.noreply.github.com>
2021-05-14 10:23:03 -07:00
Miss Islington (bot)
9bc96c0146
[doc] Fix typos in cgi.rst (GH-24766) (GH-26131)
(cherry picked from commit 19d839ae20)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
2021-05-14 18:13:40 +01:00
Erlend Egeberg Aasland
64a31c5c2f
[3.9] sqlite3 test suite now works with SQLITE_DQS=0 (GH-26032). (GH-26128)
(cherry picked from commit be7e467bcf)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-15 01:50:03 +09:00
Miss Islington (bot)
f3007ea9ad
Update doc as relative import can be used with star import (GH-25667) (GH-26122)
(cherry picked from commit 3d4b5f1019)

Co-authored-by: Saiyang Gou <gousaiyang@163.com>

Co-authored-by: Saiyang Gou <gousaiyang@163.com>
2021-05-14 07:25:40 -07:00
Miss Islington (bot)
f38296feaa
Updated code example for asyncio.gather (GH-20604) (GH-26120)
The previous example did not fully showcase the interest of using gather.

Here the example showcases "the result is an aggregate list of returned values".
(cherry picked from commit 56b8ea65d2)

Co-authored-by: josephernest <nouvellecollection@gmail.com>

Co-authored-by: josephernest <nouvellecollection@gmail.com>
2021-05-13 23:07:31 -07:00
Miss Islington (bot)
133013e8a1
bpo-28146: Fix a confusing error message in str.format() (GH-24213)
Automerge-Triggered-By: GH:pitrou
(cherry picked from commit 4aeee0b47b)

Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
2021-05-13 14:35:30 -07:00
Miss Islington (bot)
04c4610194
bpo-44114: Remove redundant cast. (GH-26098)
(cherry picked from commit e0c614e5fd)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2021-05-13 14:07:16 -07:00
Miss Islington (bot)
04ce4c7736
bpo-44125: Fix "make patchcheck" on non-English locale (GH-26102)
The patch from [bpo-44074]() does not account for a possibly non-English locale and blindly greps for "HEAD branch" in a possibly localized text.

Automerge-Triggered-By: GH:pitrou
(cherry picked from commit 1aa3530314)

Co-authored-by: Antoine Pitrou <antoine@python.org>
2021-05-13 11:14:23 -07:00
Ken Jin
9b90ce6850
[3.9] Revert "[3.9] bpo-38908: Fix issue when non runtime_protocol does not raise TypeError (GH-26067)" (GH-26077)
Reverts python/cpython#26075

Automerge-Triggered-By: GH:gvanrossum
2021-05-12 10:44:14 -07:00
Ken Jin
88136bbd05
[3.9] bpo-38908: Fix issue when non runtime_protocol does not raise TypeError (GH-26067) (GH-26075)
(cherry picked from commit c40486a)

Co-authored-by: Yurii Karabas 1998uriyyo@gmail.com

Automerge-Triggered-By: GH:gvanrossum
2021-05-12 10:04:43 -07:00
Miss Islington (bot)
1be9396061
bpo-25479: add unit test for __subclasshook__ in test_abc.py (GH-24034) (GH-26063)
Co-authored-by: Szymon Trapp
(cherry picked from commit 5010c044c7)

Co-authored-by: Karl Dubost <karl+github@la-grange.net>
2021-05-12 14:45:18 +01:00
Miss Islington (bot)
ada9cdb941
bpo-40640: doc -- add missing ... in example of Continue (GH-26055) (GH-26058)
Co-authored-by: Chas Belov <59780179+ChasBelov@users.noreply.github.com>
(cherry picked from commit 6574334a68)
2021-05-12 11:28:10 +01:00
Steve Dower
0cb9775a85
bpo-44061: Fix pkgutil.iter_modules regression when passed a pathlib.Path object (GH-25964) (GH-26052)
Co-authored-by: Miguel Brito <5544985+miguendes@users.noreply.github.com>
2021-05-12 11:48:50 +02:00
Erlend Egeberg Aasland
6c190b5ae5
[3.9] bpo-28528: Fix pdb.checkline() attribute error when 'curframe' is None (GH-25438) (GH-26053)
Co-authored-by: Thomas Kluyver <takowl@gmail.com>
(cherry picked from commit 8563a7052c)

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

Automerge-Triggered-By: GH:iritkatriel
2021-05-12 02:04:10 -07:00
Miss Islington (bot)
7d38b04b61
Fix import of HTTPError (GH-22304) (GH-26048)
Import HTTPError from urllib.error instead of urllib.request.
(cherry picked from commit 5fedf71439)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2021-05-11 16:18:23 -07:00
Jero Bado
37a9d43dd2
Fix typo in blurb entry (GH-26043) 2021-05-11 15:28:57 -07:00
Miss Islington (bot)
c9049cf0aa
bpo-10548: expectedFailure does not apply to fixtures (GH-23201) (#26045)
(cherry picked from commit 23ae2c3bac)

Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
2021-05-11 23:23:54 +01:00
Miss Islington (bot)
390bfe0445
bpo-23750: Document os-system, subprocess. Patch by Martin Panter. (GH-26016) (GH-26041)
* Document os-system, subprocess Patch

* Update Doc/library/os.rst

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
(cherry picked from commit 5f2eb87f28)

Co-authored-by: uniocto <serit142sa33go@gmail.com>

Co-authored-by: uniocto <serit142sa33go@gmail.com>
2021-05-11 13:55:24 -07:00
Miss Islington (bot)
bde14f7fbd
bpo-25821: Fix inaccuracy in threading.enumerate/is_alive documentation (GH-23192) (#26036)
(cherry picked from commit 12e7d10dfd)

Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
2021-05-11 19:19:42 +01:00
Miss Islington (bot)
1d8c18019d
Doc: http.server: directory is not a class attribute, but an argument. (GH-26017) (GH-26030)
* Doc: http.server: directory is not a class attribute, but an argument.
(cherry picked from commit d1b81574ed)

Co-authored-by: Julien Palard <julien@palard.fr>

Co-authored-by: Julien Palard <julien@palard.fr>
2021-05-10 18:59:22 -07:00
Steve Dower
b4884083ae
bpo-44070: Clarify NEWS message to specify the version when the behaviour was introduced (GH-26029) 2021-05-11 00:39:17 +01:00
Steve Dower
23822e2c65
bpo-44070: No longer eagerly makes import filenames absolute, except for extension modules (GH-26025) 2021-05-10 23:45:50 +01:00
Miss Islington (bot)
fbd9b9939c
bpo-44074: let patchcheck infer the base branch name (GH-25991)
(cherry picked from commit 21fbbb98ba)

Co-authored-by: Leonardo Lai <leonardo.lai@live.com>
2021-05-10 11:58:45 -07:00