Commit graph

112046 commits

Author SHA1 Message Date
Miss Islington (bot)
5252ad2b64
GH-92892: Add section about variadic functions to ctypes documentation (GH-99529)
On some platforms, and in particular macOS/arm64, the calling
convention for variadic arguments is different from the regular
calling convention. Add a section to the documentation to document
this.
(cherry picked from commit bc3a11d21d)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2022-11-22 10:57:45 -08:00
Miss Islington (bot)
fa6cc9e6df
[3.10] gh-99146 struct module documentation should have more predictable examples/warnings (GH-99141) (GH-99703)
gh-99146 struct module documentation should have more predictable examples/warnings (GH-99141)

* nail down a couple examples to have more predictable output

* update a number of things, but this is really just a stash...

* added an applications section to describe typical uses for native and machine-independent formats

* make sure all format strings use a format prefix character

* responding to comments from @gpshead. Not likely finished yet.

* This got more involved than I expected...

* respond to several PR comments
* a lot of wordsmithing
* try and be more consistent in use of ``x`` vs ``'x'``
* expand examples a bit
* update the "see also" to be more up-to-date
* original examples relied on import * so present all examples as if

* reformat based on @gpshead comment (missed before)

* responding to comments

* missed this

* one more suggested edit

* wordsmithing
(cherry picked from commit 22d91c16bb)

Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>

Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
2022-11-22 18:17:18 +00:00
Serhiy Storchaka
400d41b8ea
[3.10] gh-99645: Fix a bug in handling class cleanups in unittest.TestCase (GH-99646) (GH-99699)
Now addClassCleanup() uses separate lists for different TestCase subclasses,
and doClassCleanups() only cleans up the particular class.

(cherry picked from commit c2102136be)
2022-11-22 19:11:57 +02:00
Serhiy Storchaka
190331ed28
[3.10] Add more details in test_unittest (GH-99626). (GH-99692)
(cherry picked from commit 653e563d80)
2022-11-22 17:13:37 +02:00
Ronald Oussoren
1c5e860292
[3.10] GH-97001: Release GIL in termios extension (GH-99503) (#99680)
Without releasing the GIL calls to termios APIs might block the entire interpreter..
(cherry picked from commit 959ba45d75)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2022-11-22 12:33:32 +01:00
Miss Islington (bot)
99e852c28f
gh-99341: Cover type ignore nodes when incrementing line numbers (GH-99422)
(cherry picked from commit 1acdfec359)

Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
2022-11-22 03:06:26 -08:00
Miss Islington (bot)
37dbbb208f
gh-99578: Fix refleak in _imp.create_builtin() (GH-99642)
Fix a reference bug in _imp.create_builtin() after the creation of
the first sub-interpreter for modules "builtins" and "sys".
(cherry picked from commit cb2ef8b2ac)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-11-21 03:44:56 -08:00
Miss Islington (bot)
101dfaedb2
[3.10] GH-95815: Document less specific error for os.remove (GH-99571) (#99639)
GH-95815: Document less specific error for os.remove (GH-99571)

os.remove can raise PermissionError instead of IsADirectoryError,
when the object to be removed is a directory (in particular on
macOS).

This reverts a change done in GH-14262.
(cherry picked from commit 1cae31d26b)


Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2022-11-21 12:05:32 +01:00
Pablo Galindo Salgado
ad47c7d926
[3.10] gh-99581: Fix a buffer overflow in the tokenizer when copying lines that fill the available buffer (GH-99605). (#99630) 2022-11-20 22:30:15 +00:00
Miss Islington (bot)
88b101ff52
[3.10] gh-98086: Now `patch.dict` can decorate async functions (GH-98095) (GH-99366)
gh-98086: Now ``patch.dict`` can decorate async functions (GH-98095)
(cherry picked from commit 67b4d2772c)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Chris Withers <chris@withers.org>
2022-11-20 21:36:57 +05:30
Serhiy Storchaka
42b7b2179e
[3.10] gh-78453: Move Unicode C API tests from test_unicode to test_capi.test_unicode (GH-99431). (GH-99617)
(cherry picked from commit 06d4e02c3b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-11-20 12:45:50 +02:00
Stanley
90850faa01
[3.10] Remove trailing space to fix azure failures (#99611) 2022-11-19 21:01:35 -08:00
Stanley
4572c98ad2
[3.10] gh-85073: Add some missing links to source (GH-99363) (#99589)
(cherry picked from commit 27d8dc2c9d)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2022-11-19 06:44:52 -08:00
Miss Islington (bot)
731a747a91
Doc: Replace question mark with fullstop (GH-99558)
The sentence "Set the LC_CTYPE locale to the user preferred locale." should end with a period
instead of a question mark.
(cherry picked from commit 0e09d2cc59)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2022-11-18 11:34:17 -08:00
Miss Islington (bot)
e470803295
gh-87604: Avoid publishing list of active per-interpreter audit hooks via the gc module (GH-99373)
(cherry picked from commit 4e4b13e8f6)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-11-15 12:52:14 -08:00
Kamil Turek
bc2cdfc815
[3.10] gh-92119: ctypes: Print exception class name instead of its representation (GH-98302) (#99452)
gh-92119: ctypes: Print exception class name instead of its representation (#98302)

(cherry picked from commit b9dedfe61d)
2022-11-13 15:55:58 -08:00
Miss Islington (bot)
14c13955c5
gh-99275: Fix SystemError in ctypes during __initsubclass__ (GH-99283)
(cherry picked from commit 343eb0f94b)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-13 11:40:18 -08:00
Miss Islington (bot)
5324893599
gh-99392: Fix sqlite3 converter recipes (GH-99393)
(cherry picked from commit dfc1b17a23)

Co-authored-by: naglis <827324+naglis@users.noreply.github.com>
2022-11-12 11:47:59 -08:00
Miss Islington (bot)
535027f470
bpo-34272: Reorganize C API tests. (GH-8551)
Move some C API tests into Lib/test/test_capi/.
(cherry picked from commit f883b7f8ee)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-11-12 09:36:49 -08:00
Miss Islington (bot)
8d27e6294b
gh-80448: argparse: Fix IndexError on store_true action (GH-15656)
(cherry picked from commit e02cc6d42a)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-11-11 18:16:18 -08:00
Miss Islington (bot)
ad5159b7de
gh-87604: Clarify in docs that sys.addaudithook is not for sandboxes (GH-99372)
(cherry picked from commit c3c3871415)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-11-11 05:41:41 -08:00
Miss Islington (bot)
5612471501
gh-98366: use sphinx.locale._ as gettext() in pyspecific.py (GH-98437)
fix(doc-tools): use sphinx.locale._ as gettext() for backward-compatibility in pyspecific.py

[why] spinix 5.3 changed locale.translators from a defaultdict(gettext.NullTranslations) to a dict, which leads to failure of pyspecific.py. Use sphinx.locale._ as gettext to fix the issue.
(cherry picked from commit d26ee8a0a5)

Co-authored-by: Wei-Hsiang (Matt) Wang <mattwang44@gmail.com>
2022-11-10 17:32:30 -08:00
Miss Islington (bot)
f7d3b18ed5
GH-99183: Document behavior of count() for empty substrings (GH-99339)
(cherry picked from commit 2f4af2d99c)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2022-11-10 13:27:42 -08:00
Jason R. Coombs
9a5ca31af0
[3.10] gh-99130: Apply bugfixes from importlib_metadata 4.11.4. (#99132) 2022-11-10 16:59:38 +01:00
Miss Islington (bot)
e6f066af2e
gh-74044: inspect.signature for wrappers around decorated bound methods (GH-736)
(cherry picked from commit dbf2faf579)

Co-authored-by: Anton Ryzhov <anton@ryzhov.me>
2022-11-10 04:59:25 -08:00
Miss Islington (bot)
ee405e3b23
gh-99320: remove tests for old-style class from test_complex (GH-99321)
(cherry picked from commit 26726c7649)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-10 03:19:30 -08:00
Miss Islington (bot)
bec131759e
gh-99238: clarify the type of the env dict. (GH-99253)
(cherry picked from commit 2eee9d9cd7)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2022-11-08 13:08:08 -08:00
Miss Islington (bot)
b51c2832f0
Fix broken link in asyncio-subprocesses doc (GH-99214)
GH- Fix broken link in Doc/library/asyncio-subprocess.rst

This is a trivial fix in documentation to fix a broken link.

There is a broken link in [Doc/library/asyncio-subprocess.rst](https://docs.python.org/3/library/asyncio-subprocess.htmlGH-asyncio.subprocess.Process) for the function ``wait_for``:

![image](https://user-images.githubusercontent.com/37690409/200388894-fb6b7c42-b2cc-49ec-a239-e3472890db1f.png)

I suppose this refers to the function ``asyncio.wait_for`` which is not clear in the docs.

This PR fixes the link and the result looks like the following:

![image](https://user-images.githubusercontent.com/37690409/200389483-b4a92105-7d2c-4285-b0fc-78a6dc0be39c.png)
(cherry picked from commit acf4d5d5bd)

Co-authored-by: Mikael Koli <koli.mikael@gmail.com>
Automerge-Triggered-By: GH:AlexWaygood
2022-11-08 08:33:28 -08:00
Miss Islington (bot)
9bb8e18ca4
[3.11] gh-98433: Fix quadratic time idna decoding. (GH-99092) (GH-99222)
There was an unnecessary quadratic loop in idna decoding. This restores
the behavior to linear.

(cherry picked from commit d315722564)

(cherry picked from commit a6f6c3a3d6)

Co-authored-by: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2022-11-07 19:23:16 -08:00
Miss Islington (bot)
e7781fd695
gh-99124: use concrete exception types in test_builtin (GH-99125)
(cherry picked from commit c32bc1bffd)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-07 18:30:38 -08:00
Miss Islington (bot)
a5d3e1dd04
gh-98513: Test abstract methods of some collections types (GH-98516)
(cherry picked from commit a309ad9f76)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-07 18:19:33 -08:00
Miss Islington (bot)
d2cb0f9117
[3.10] gh-96746: Docs: Clear up Py_TPFLAGS_DISALLOW_INSTANTIATION inheritance (GH-99002) (GH-99213)
gh-96746: Docs: Clear up Py_TPFLAGS_DISALLOW_INSTANTIATION inheritance (GH-99002)

The flag is not inherited, but its effect -- a NULL tp_new -- is.

Drop hints for people who come here wanting to “disallow instantiation”.
(cherry picked from commit 1438b77997)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2022-11-07 19:56:21 +01:00
Miss Islington (bot)
6b46cb4d33
doc: Formatting and typo fixes (GH-98974)
(cherry picked from commit 728e42fcf5)

Co-authored-by: jmcb <joelsgp@protonmail.com>
2022-11-07 09:14:28 -08:00
Miss Islington (bot)
eb0e942ca8
bpo-38523: ignore_dangling_symlinks does not apply recursively (GH-22937)
(cherry picked from commit 5ff81da6d3)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2022-11-07 04:08:39 -08:00
Miss Islington (bot)
ea2316a220
[3.10] [ GH-99155: Fix NormalDist pickle with 0 and 1 protocols (GH-99156). (GH-99188) (GH-99190) 2022-11-07 04:16:54 -06:00
Miss Islington (bot)
1b5a62b88a
gh-96055: Update faulthandler to emit proper unexpect signal number (gh-99162)
(cherry picked from commit f626b7b504)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2022-11-06 22:05:20 -08:00
Erlend E. Aasland
0d5b25bd87
[3.10] gh-99086: Fix implicit int compiler warning in configure check for PTHREAD_SCOPE_SYSTEM (GH-99085) (#99119)
(cherry picked from commit 12078e78f6)

Co-authored-by: Sam James <sam@cmpct.info>

Co-authored-by: Sam James <sam@cmpct.info>
2022-11-06 22:39:34 +01:00
Miss Islington (bot)
8eb4e2ce3f
gh-94286 Fix documentation of print default param (GH-94297)
(cherry picked from commit 2db55e0c00)

Co-authored-by: Nouran Ali <nouranalimohammed@gmail.com>
2022-11-06 12:23:01 -08:00
Miss Islington (bot)
cd6fe96689
gh-99051: remove duplicated test from test_weakref (GH-99052)
(cherry picked from commit 8463cb55da)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-06 11:50:12 -08:00
Miss Islington (bot)
380b12e435
gh-83004: Clean up refleak in _pickle initialisation (GH-98841)
(cherry picked from commit d3b82b4463)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-11-06 06:44:28 -08:00
Miss Islington (bot)
70006d6a5f
gh-83004: Clean up refleak in _zoneinfo initialisation (GH-98842)
(cherry picked from commit 31f2f6568d)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-11-06 06:38:26 -08:00
Miss Islington (bot)
92cc215518
test_typing: use all pickle protocols (GH-99154)
(cherry picked from commit a0bc75e2fd)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-06 04:15:29 -08:00
Miss Islington (bot)
982273ae79
gh-99134: Update bundled pip to 22.3.1 (gh-99135)
Update bundled pip to 22.3.1
(cherry picked from commit 47ab8480e7)

Co-authored-by: Paul Moore <p.f.moore@gmail.com>
2022-11-05 12:00:12 -07:00
Miss Islington (bot)
ae5317d309
[3.11] gh-90867: test.support.wait_process() uses LONG_TIMEOUT (GH-99071) (GH-99098)
The test.support.wait_process() function now uses a timeout of
LONG_TIMEOUT seconds by default, instead of SHORT_TIMEOUT.  It
doesn't matter if a Python buildbot is slower, it only matters that
the process completes. The timeout should just be shorter than
"forever".

(cherry picked from commit a9a8c87126)

Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit f09da28768)
2022-11-04 08:20:35 -07:00
Miss Islington (bot)
0f45b2edac
minor edits to locale doc (GH-98537)
(cherry picked from commit c0bf7607a1)

Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
2022-11-04 06:12:47 -07:00
Miss Islington (bot)
3a7e9ea090
Docs: add named to the list of styles in the sqlite3.paramstyle attr docs (GH-99078)
(cherry picked from commit 016c7d37b6)

Co-authored-by: Nick Pope <nick@nickpope.me.uk>
2022-11-03 16:31:33 -07:00
Miss Islington (bot)
8d44f36a4a
gh-83004: Clean up refleak in _io initialisation (GH-98840)
(cherry picked from commit 1208037246)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-11-03 07:58:44 -07:00
Serhiy Storchaka
22bbb0c4c7
[3.10] gh-98740: Fix validation of conditional expressions in RE (GH-98764) (GH-99046)
In very rare circumstances the JUMP opcode could be confused with the
argument of the opcode in the "then" part which doesn't end with the
JUMP opcode. This led to incorrect detection of the final JUMP opcode
and incorrect calculation of the size of the subexpression.

NOTE: Changed return value of functions _validate_inner() and
_validate_charset() in Modules/_sre/sre.c.  Now they return 0 on success,
-1 on failure, and 1 if the last op is JUMP (which usually is a failure).
Previously they returned 1 on success and 0 on failure.
(cherry picked from commit e9ac890c02)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-11-03 12:18:50 +02:00
Miss Islington (bot)
27dc6dbafe
gh-98512: Add more tests for ValuesView (GH-98515)
(cherry picked from commit 29e027c3e6)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-11-02 19:33:01 -07:00
Miss Islington (bot)
b9e621b9f4
gh-65002: Make note that null bytes are used to pad bytes (GH-98635)
(cherry picked from commit 8cd21c2c5d)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2022-11-02 19:24:15 -07:00