Commit graph

111486 commits

Author SHA1 Message Date
Miss Islington (bot)
968b238b5e
[3.11] gh-93741: Add private C API _PyImport_GetModuleAttrString() (GH-93742) (GH-93792)
It combines PyImport_ImportModule() and PyObject_GetAttrString()
and saves 4-6 lines of code on every use.

Add also _PyImport_GetModuleAttr() which takes Python strings as arguments.
(cherry picked from commit 6fd4c8ec77)
(cherry picked from commit d42b3689f4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-06-16 00:19:29 -07:00
Miss Islington (bot)
e929dae42a
gh-93857: Fix broken audit-event targets in sqlite3 docs (GH-93859)
Corrected targets for the following audit-events:

- sqlite3.enable_load_extension => sqlite3.Connection.enable_load_extension
- sqlite3.load_extension => sqlite3.Connection.load_extension
(cherry picked from commit ce4d11f98b)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
2022-06-15 07:24:50 -07:00
Miss Islington (bot)
5dee1d840c
gh-87260: Update sqlite3 signature docs to reflect actual implementation (GH-93840)
Align the docs for the following methods with the actual implementation:

- sqlite3.complete_statement()
- sqlite3.Connection.create_function()
- sqlite3.Connection.create_aggregate()
- sqlite3.Connection.set_progress_handler()
(cherry picked from commit d31834688b)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
2022-06-15 03:46:33 -07:00
Erlend Egeberg Aasland
56ee410053
[3.10] gh-89018: Improve documentation of sqlite3 exceptions (GH-27645) (#93838)
- Order exceptions as in PEP 249
- Reword descriptions, so they match the current behaviour

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>.
(cherry picked from commit bb0b768946)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
2022-06-15 11:55:30 +02:00
Miss Islington (bot)
095d09c0a8
gh-93183: Adjust wording in socket docs (GH-93832)
package => packet

Co-authored-by: Victor Norman
(cherry picked from commit cdd3984307)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
2022-06-15 01:51:28 -07:00
Erlend Egeberg Aasland
8b36ce69ac
[3.10] gh-93795: Use test.support TESTFN/unlink in sqlite3 tests (GH-93796). (#93809) 2022-06-14 17:41:50 +02:00
Erlend Egeberg Aasland
2229d34a6e
[3.10] gh-79579: Improve DML query detection in sqlite3 (GH-93623) (#93801)
The fix involves using pysqlite_check_remaining_sql(), not only to check
for multiple statements, but now also to strip leading comments and
whitespace from SQL statements, so we can improve DML query detection.

pysqlite_check_remaining_sql() is renamed lstrip_sql(), to more
accurately reflect its function, and hardened to handle more SQL comment
corner cases.

(cherry picked from commit 46740073ef)
2022-06-14 15:05:36 +02:00
Miss Islington (bot)
f9585e2adc
gh-93353: Fix importlib.resources._tempfile() finalizer (GH-93377)
Fix the importlib.resources.as_file() context manager to remove the
temporary file if destroyed late during Python finalization: keep a
local reference to the os.remove() function. Patch by Victor Stinner.
(cherry picked from commit 443ca731d6)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-06-13 10:52:50 -07:00
Miss Islington (bot)
58277de8e6
Change list to view object (GH-93661)
(cherry picked from commit 5d8e7a1240)

Co-authored-by: Pamela Fox <pamela.fox@gmail.com>
2022-06-11 04:13:38 -07:00
Miss Islington (bot)
1190b63721
gh-92930: _pickle.c: Acquire strong references before calling save() (GH-92931)
(cherry picked from commit 4c496f1f11)

Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
2022-06-10 20:53:07 -07:00
Miss Islington (bot)
65e2a940fa
gh-92886: Fix tests that fail when running with optimizations (-O) in test_zipimport.py (GH-93236)
(cherry picked from commit 484a2357c8)

Co-authored-by: jackh-ncl <1750152+jackh-ncl@users.noreply.github.com>
2022-06-10 16:32:27 -07:00
Miss Islington (bot)
9fafc0acf7
gh-91317: Document that Path does not collapse initial // (GH-32193)
Documentation for `pathlib` says:

> Spurious slashes and single dots are collapsed, but double dots ('..') are not, since this would change the meaning of a path in the face of symbolic links:

However, it omits that initial double slashes also aren't collapsed.

Later, in documentation of `PurePath.drive`, `PurePath.root`, and `PurePath.name` it mentions UNC but:

- this abbreviation says nothing to a person who is unaware about existence of UNC (Wikipedia doesn't help either by [giving a disambiguation page](https://en.wikipedia.org/wiki/UNC))
- it shows up only if a person needs to use a specific property or decides to fully learn what the module provides.

For context, see the BPO entry.
(cherry picked from commit 78f1a43694)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2022-06-10 16:10:29 -07:00
Pablo Galindo Salgado
8f36c735b2
[3.10] gh-93671: Avoid exponential backtracking in deeply nested sequence patterns in match statements (GH-93680) (#93690)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>.
(cherry picked from commit 53a8b17895)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-06-10 19:34:15 +01:00
Steve Dower
9041b00283
bpo-42658: Use LCMapStringEx in ntpath.normcase to match OS behaviour for case-folding (GH-93674)
Co-authored-by: AN Long <aisk@users.noreply.github.com>
2022-06-10 17:36:02 +01:00
Miss Islington (bot)
a2695be91c
[3.10] Improve logging documentation with example and additional cookbook re… (GH-93644) (GH-93648)
(cherry picked from commit e974b3e333)

Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-06-10 16:31:00 +02:00
Miss Islington (bot)
5b2ad48431
gh-87961: Remove outdated notes from functions that aren't in the Limited API (GH-93581) (GH-93605)
Nowadays everything that *is* in the Limited API has a note added
automatically.
These notes could mislead people to think that these functions
could never be added to the limited API. Remove them.

(cherry picked from commit 2c3fe5eeb2)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2022-06-10 16:04:47 +02:00
Miss Islington (bot)
a0c7df0968
gh-90494: Reject 6th element of the __reduce__() tuple (GH-93609) (GH-93632)
copy.copy() and copy.deepcopy() now always raise a TypeError if
__reduce__() returns a tuple with length 6 instead of silently ignore
the 6th item or produce incorrect result.
(cherry picked from commit a365dd64c2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-06-10 15:59:39 +02:00
Miss Islington (bot)
2ad51c636a
gh-90549: Fix leak of global named resources using multiprocessing spawn (GH-30617)
Co-authored-by: XD Trol <milestonejxd@gmail.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
(cherry picked from commit 30610d2837)

Co-authored-by: Leo Trol <milestone.jxd@gmail.com>
2022-06-10 05:17:11 -07:00
Miss Islington (bot)
8d8251a9b1
gh-90763: Modernise xx template module initialisation (GH-93078)
Use C APIs such as PyModule_AddType instead of PyModule_AddObject.
Also remove incorrect module decrefs if module fails to initialise.
(cherry picked from commit a87c9b538f)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
2022-06-10 04:16:57 -07:00
Miss Islington (bot)
2139583bf9
Doc: Update references and examples of old, unsupported OSes and uarches (GH-92791) (GH-93639)
(cherry picked from commit a5ba0f4ebc)

Co-authored-by: CAM Gerlach <CAM.Gerlach@Gerlach.CAM>
2022-06-09 16:15:49 +02:00
Erlend Egeberg Aasland
9cc0afcb87
[3.10] gh-93421: Update sqlite3 cursor.rowcount only after SQLITE_DONE (GH-93526) (GH-93599)
(cherry picked from commit 875de61)
2022-06-08 13:31:14 +02:00
jacksonriley
6b9122483f
[3.10] Fix PurePath.relative_to links in the pathlib documentation (GH-93268) (GH-93590)
These are currently broken as they refer to :meth:`Path.relative_to` rather than :meth:`PurePath.relative_to`, and `relative_to` is a method on `PurePath`..
(cherry picked from commit 8ef7929baf)

Co-authored-by: jacksonriley <52106215+jacksonriley@users.noreply.github.com>

Backport of #93268
2022-06-07 14:58:43 -07:00
Miss Islington (bot)
b4fdd8ca29
gh-57539: Increase calendar test coverage (GH-93468) (GH-93565)
(cherry picked from commit f0d0be3493)

Co-authored-by: Sean Fleming
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2022-06-07 12:20:49 +02:00
Miss Islington (bot)
c7b5a2d5ea
gh-88831: In docs for asyncio.create_task, explain why strong references to tasks are needed (GH-93258) (GH-93567)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 75ceae05c1)

Co-authored-by: Andreas Grommek <76997441+agrommek@users.noreply.github.com>
2022-06-07 12:14:25 +02:00
Miss Islington (bot)
9204364e40
gh-92914: Round the allocated size for lists up to the even number (GH-92915) (GH-92942)
(cherry picked from commit 8a6af5a346)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-06-07 10:54:40 +02:00
Miss Islington (bot)
6b7b901ff2
gh-86986: bump min sphinx version to 3.2 (GH-93337) (GH-93562)
(cherry picked from commit 57e8ee7086)

Co-authored-by: Davide Rizzo <sorcio@gmail.com>
2022-06-07 10:24:54 +02:00
Pablo Galindo
2fe016fbba
Merge remote-tracking branch 'upstream/3.10' into 3.10 2022-06-06 18:14:33 +01:00
Miss Islington (bot)
386babebe9
gh-93391: fix typo in array docs (GH-93392) (GH-93395)
Fixes GH-93391

(cherry picked from commit fc694364cc)

Co-authored-by: ynfle <23086821+ynfle@users.noreply.github.com>
2022-06-06 19:14:04 +02:00
Pablo Galindo
1b7996cf73
Post 3.10.5 2022-06-06 18:13:35 +01:00
Miss Islington (bot)
ce057ae1e3
gh-93372: Fix typo in os.rename documentation (GH-93401) (GH-93404)
(cherry picked from commit e7aab7c92a)

Co-authored-by: Wei-Ting Yang <74453331+Yang-Wei-Ting@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-06-06 19:11:18 +02:00
Miss Islington (bot)
8dc8b27eb0
gh-83728: Add hmac.new default parameter deprecation (GH-91939) (GH-93545)
(cherry picked from commit 56b5daf159)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2022-06-06 19:10:15 +02:00
Julien Palard
632eef7b58
[3.10] gh-93108: Bump sphinx to fix rendering issue. (GH-93159)
Bug was visible on SysLogHandler:

bad: SysLogHandler(address='localhost', SYSLOG_UDP_PORT, ...
good: SysLogHandler(address=('localhost', SYSLOG_UDP_PORT), ...
2022-06-06 18:59:22 +02:00
Miss Islington (bot)
3d19051386
📝 Make sure the phrase "constant-time compare" actually appears in the docs (GH-93396) (#93400)
This is purely for SEO as this is the actual generic name for this kind of method and it currently does not appear in a Google search for "python constant time compare". Not creating an issue or setting this up for backports as its trivial (I think) and not a functional change.
(cherry picked from commit 8241a6971e)

Co-authored-by: Noah Kantrowitz <noah@coderanger.net>
2022-06-06 18:54:04 +02:00
Pablo Galindo
f377153967
Python 3.10.5 2022-06-06 12:53:30 +01:00
Miss Islington (bot)
fd247db57a
gh-93247: Fix assert function in asyncio locks test (GH-93248)
(cherry picked from commit 9081bbd036)

Co-authored-by: Cyker Way <cykerway@gmail.com>
2022-06-05 18:42:21 -07:00
Miss Islington (bot)
2f8aae38b9
gh-89973: Fix re.error in the fnmatch module. (GH-93072)
Character ranges with upper bound less that lower bound (e.g. [c-a])
are now interpreted as empty ranges, for compatibility with other glob
pattern implementations. Previously it was re.error.
(cherry picked from commit 0902c3d8ed)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-06-05 02:39:03 -07:00
Miss Islington (bot)
60adc4b92a
Fix missing word in sys.float_info docstring (GH-93489) (GH-93496)
(cherry picked from commit e12f34b6d8)

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2022-06-04 20:23:22 +01:00
Miss Islington (bot)
7b3cf3a288
gh-92886: Fix test that fails when running with -O in test_imaplib.py (GH-93237)
(cherry picked from commit 8150b8cf7f)

Co-authored-by: jackh-ncl <1750152+jackh-ncl@users.noreply.github.com>
2022-06-03 20:38:54 -07:00
Miss Islington (bot)
b382bf50c5
gh-93156 - fix negative indexing into absolute pathlib.PurePath().parents (GH-93273)
When a `_PathParents` object has a drive or a root, the length of the
object is *one less* than than the length of `self._parts`, which resulted
in an off-by-one error when `path.parents[-n]` was fed through to
`self._parts[:-n - 1]`. In particular, `path.parents[-1]` was a malformed
path object with spooky properties.

This is addressed by adding `len(self)` to negative indices.
(cherry picked from commit f32e6b48d1)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2022-06-03 14:53:00 -07:00
Miss Islington (bot)
9cdfd1b01a
test.pythoninfo: Fix typo, Py_REF_DEBUG => Py_TRACE_REFS (GH-93467)
(cherry picked from commit d8f40ead92)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-06-03 07:08:21 -07:00
Miss Islington (bot)
855be47a02
gh-93418: Fix an assert when an f-string expression is followed by an '=', but no closing brace. (gh-93419) (gh-93423)
(cherry picked from commit ee70c70aa9)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2022-06-01 21:04:43 -04:00
Miss Islington (bot)
0b7aae88d0
Remove the execution bit to some socket-related files. (GH-93368)
(cherry picked from commit 5247389369)

Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2022-06-01 00:31:31 -07:00
Miss Islington (bot)
694455d5ed
Remove VOC reference (93333)
VOC has been archived by the BeeWare project, and they are instead
embedding CPython, rather than transpiling to Java bytecode.
(cherry picked from commit bb900712a5)

Co-authored-by: Carl Bordum Hansen <carl@bordum.dk>
2022-05-31 10:49:14 -07:00
Miss Islington (bot)
372afb7a9b
Fix typo in Lib/idlelib/idle_test/test_parenmatch.py (GH-93332) (#93340)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 4f195f9db1)

Co-authored-by: luzpaz <luzpaz@users.noreply.github.com>
2022-05-29 23:03:11 -04:00
Miss Islington (bot)
aa06a84099
bpo-42272: fix misleading warning filter message/module docs (GH-23172)
* bpo-42272: improve message/module warning filter docs

"The Warnings Filter" section of the warnings module documentation
describes the message and module filters as "a string containing a
regular expression".  While that is true when they are arguments to the
filterwarnings function, it is not true when they appear in -W or
$PYTHONWARNINGS where they are matched literally (after stripping any
starting/ending whitespace).  Update the documentation to note when they
are matched literally.  Also clarify that module matches the
"fully-qualified module name", rather than "module name" which is
ambiguous.

skip news (since this is a doc fix)

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>

* bpo-42272: remove bad submodule warning filter doc

The `error:::mymodule[.*]` example in the "Describing Warning Filters"
section of the warnings module documentation does not behave as the
comment describes.  Since the module portion of the filter string is
interpreted literally, it would match a module with a fully-qualified
name that is literally `mymodule[.*]`.

Unfortunately, there is not a way to match '"module" and any subpackages
of "mymodule"' as documented, since the module part of a filter string
is matched literally.  Instead, update the filter and comment to match
only "mymodule".

skip news (since this is a doc fix)

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>

* bpo-42272: add warning filter doc changes to NEWS

Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
(cherry picked from commit 8136606769)

Co-authored-by: Kevin Locke <kevin@kevinlocke.name>
2022-05-29 19:03:15 -07:00
Éric
c649526f92
[3.10] gh-93217: fix some issues in man page and --help (GH-93219) (#93261) 2022-05-29 14:04:23 -04:00
Miss Islington (bot)
561c709af3
test.pythoninfo logs more build info (GH-93225) (#93256)
Log also test.support.check_sanitizer() values.
(cherry picked from commit 06dd26f89f)

Co-authored-by: Victor Stinner <vstinner@python.org>

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-05-29 10:22:35 +02:00
Miss Islington (bot)
738c730b5c
gh-92240 : Include release dates for "What's New In Python 3.X" (GH-92937)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
(cherry picked from commit 877ad7b3b2)

Co-authored-by: georgically <40323509+georgically@users.noreply.github.com>
2022-05-28 20:41:40 -07:00
Miss Islington (bot)
550c44b895
gh-92839: fixed typo in _bisectmodule.c (line 131) (GH-92849) (#93321) 2022-05-28 13:48:25 -05:00
Miss Islington (bot)
9912b3d989
gh-77024: test.support: Improve documentation (GH-92513)
This is a rework of GH-5774 on current main. I was a bit more
conservative in making changes than the original PR.

See @csabella's comments on issue GH-77024 and the discussion
on GH-5774 for explanations of several of the changes.

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
(cherry picked from commit 8995177030)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-05-27 12:25:21 -07:00