Commit graph

47518 commits

Author SHA1 Message Date
Nikita Sobolev
c1ff4cb98b
[3.10] bpo-46611: add coverage to instance and class checks in typing.py (GH-31078) (GH-31182)
(cherry picked from commit 067c03bf40)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-02-07 10:48:20 +02:00
Miss Islington (bot)
cb789944b2
Add more tests for variable substitution in generics (GH-31170)
(cherry picked from commit 3da5526136)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-02-06 12:15:29 -08:00
Miss Islington (bot)
c88407ccf5
bpo-46648: Skip test_urllib2.test_issue16464() (GH-31161)
POST requests to http://www.example.com/ fail randomly.
(cherry picked from commit 1578de2fcd)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-02-06 06:33:01 -08:00
Miss Islington (bot)
34895f694c
Optimize images by IMGbot (GH-21348)
Co-authored-by: ImgBotApp <ImgBotHelp@gmail.com>
(cherry picked from commit ba650af7d6)
2022-02-04 16:31:21 +09:00
Miss Islington (bot)
9ce0b00fb1
bpo-46588: fix typo in test_calltip.py (GH-31119)
(cherry picked from commit 222865daab)

Co-authored-by: Caio Agiani <agianicaio@gmail.com>
2022-02-03 21:11:15 -08:00
Miss Islington (bot)
4f76b3667d
bpo-46630: Fix initial focus of IDLE query dialogs (GH-31112)
On Windows, one had to Tab or click on the entry box
to get a cursor and be able to enter anything.
(cherry picked from commit d1df81a730)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-02-03 14:34:03 -08:00
Miss Islington (bot)
63523e7b2a
bpo-45975: IDLE - Remove extraneous parens (GH-31107)
mistakenly included in 3 files in previous PR
and backported both to 3.10 and 3.9.
(cherry picked from commit 916d0d822c)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-02-03 12:44:11 -08:00
Miss Islington (bot)
2ddc278875
bpo-45975: Use walrus operator for some idlelib while loops (GH-31083)
(cherry picked from commit 51a95be1d0)

Co-authored-by: Nick Drozd <nicholasdrozd@gmail.com>
2022-02-02 18:28:52 -08:00
Miss Islington (bot)
5765eaa136
bpo-46616: Ensures test_importlib.test_windows cleans up registry keys after completion (GH-31086)
(cherry picked from commit 89a0a90c2e)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-02-02 12:25:37 -08:00
Hugo van Kemenade
ba4d79af32
[3.10] bpo-45173: Note configparser deprecations will be removed in 3.12 (GH-31084)
Cherry-pick of [`b06e9ba`](https://github.com/python/cpython/pull/30952/commits/b06e9ba398fafe39028c3b2dc3943266a16b1416) from https://github.com/python/cpython/pull/30952.
2022-02-02 10:41:30 -08:00
Miss Islington (bot)
e480def027
Fix minor details in the Counter docs (GH-31029) (GH-31072) 2022-02-01 23:28:07 -06:00
Miss Islington (bot)
85b421fbff
bpo-44359: Fix test_ftplib unhandled thread exceptions (GH-31069)
test_ftplib now silently ignores socket errors to prevent logging
unhandled threading exceptions.
(cherry picked from commit 0611eafc70)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-02-01 18:12:27 -08:00
Miss Islington (bot)
7dee93c2d2
bpo-46591: Make About IDLE doc link label clickable (GH-30251)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 53c7808057)

Co-authored-by: Wes <5124946+wesinator@users.noreply.github.com>
2022-02-01 17:47:51 -08:00
Miss Islington (bot)
e5e1441d41
bpo-46487: Add get_write_buffer_limits to Write and _SSLProtocol transports (GH-30958)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 64568acbd8)

Co-authored-by: Emiya <importz750@gmail.com>
2022-02-01 11:30:03 -08:00
Miss Islington (bot)
8765b01bcf
[3.10] bpo-46584: remove check for py2.3 from ctypes/test_python_api (GH-31024) (GH-31054)
(cherry picked from commit 913e340a32)


Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-02-01 06:42:37 -08:00
Miss Islington (bot)
1dcd772804
bpo-44031: fix test_tabnanny failure in non-ascii CWD (GH-31014)
(cherry picked from commit 108e66b6d2)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-02-01 03:20:07 -08:00
Miss Islington (bot)
6a188d88c5
bpo-46482: add a test for typing.Annotation.__new__ (GH-30821)
(cherry picked from commit 4c0612ad00)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-02-01 02:27:36 -08:00
Miss Islington (bot)
34794517d1
bpo-46542: test_lib2to3 uses support.infinite_recursion() (GH-31035)
* bpo-46542: test_lib2to3 uses support.infinite_recursion()

Fix a Python crash in test_lib2to3 when using Python built in debug
mode: limit the recursion limit.

The test_all_project_files() test of test_lib2to3 now uses the
test.support.infinite_recursion() context manager when processing the
infinite_recursion.py file to prevent a crash when Python is built in
debug mode.

The two test_all_project_files() tests now use subTest() and log the
refactored/parsed filename (if test_lib2to3 is run in verbose mode).

* Update Lib/lib2to3/tests/data/infinite_recursion.py

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit ee0ac328d3)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-01-31 12:03:40 -08:00
Kumar Aditya
a5451c96a1
bpo-26552: Fixed case where failing asyncio.ensure_future did not close the coroutine (#30288) (#31003) 2022-01-28 22:57:18 -08:00
Miss Islington (bot)
315a60acd1
bpo-46560: Fix a typo in typing.ParamSpec's doc string (GH-30995)
(cherry picked from commit ffa505b580)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2022-01-28 10:36:16 -08:00
Miss Islington (bot)
95b70e2ccf
bpo-46530: add "thread_time" to test_time.test_get_clock_info (GH-30913)
(cherry picked from commit c27a33132b)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-01-28 08:56:50 -08:00
Miss Islington (bot)
20f5313667
bpo-46542: test_json uses support.infinite_recursion() (GH-30972)
Fix test_json tests checking for RecursionError: modify these tests
to use support.infinite_recursion().
(cherry picked from commit e7a6285f1b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-01-27 16:57:07 -08:00
Miss Islington (bot)
bfcb41420a
bpo-46539: Pass status of special typeforms to forward references (GH-30926)
Previously this didn't matter because there weren't any valid code paths
that could trigger a type check with a special form, but after the bug
fix for `Annotated` wrapping special forms it's now possible to annotate
something like `Annotated['ClassVar[int]', (3, 4)]`. This change would
also be needed for proposed future changes, such as allowing `ClassVar`
and `Final` to nest each other in dataclasses.
(cherry picked from commit ced50051bb)

Co-authored-by: Gregory Beauregard <greg@greg.red>
2022-01-27 08:48:08 -08:00
Miss Islington (bot)
486a4b3829
bpo-44734: Fix floating point precision in test_turtle (GH-30910)
(cherry picked from commit aa78287bc6)

Co-authored-by: Karolina Surma <33810531+befeleme@users.noreply.github.com>
2022-01-27 06:21:15 -08:00
Petr Viktorin
5c39e474db
[3.10] bpo-45703: Invalidate _NamespacePath cache on importlib.invalidate_cache (GH-29384) (GH-30922)
Consider the following directory structure:

    .
    └── PATH1
        └── namespace
            └── sub1
                └── __init__.py

And both PATH1 and PATH2 in sys path:

    $ PYTHONPATH=PATH1:PATH2 python3.11
    >>> import namespace
    >>> import namespace.sub1
    >>> namespace.__path__
    _NamespacePath(['.../PATH1/namespace'])
    >>> ...

While this interpreter still runs, PATH2/namespace/sub2 is created:

    .
    ├── PATH1
    │   └── namespace
    │       └── sub1
    │           └── __init__.py
    └── PATH2
        └── namespace
            └── sub2
                └── __init__.py

The newly created module cannot be imported:

    >>> ...
    >>> namespace.__path__
    _NamespacePath(['.../PATH1/namespace'])
    >>> import namespace.sub2
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ModuleNotFoundError: No module named 'namespace.sub2'

Calling importlib.invalidate_caches() now newly allows to import it:

    >>> import importlib
    >>> importlib.invalidate_caches()
    >>> namespace.__path__
    _NamespacePath(['.../PATH1/namespace'])
    >>> import namespace.sub2
    >>> namespace.__path__
    _NamespacePath(['.../PATH1/namespace', '.../PATH2/namespace'])

This was not previously possible.
2022-01-27 06:00:23 -08:00
Miss Islington (bot)
89db090295
bpo-44791: Fix substitution of ParamSpec in Concatenate with different parameter expressions (GH-27518)
* Substitution with a list of types returns now a tuple of types.
* Substitution with Concatenate returns now a Concatenate with
  concatenated lists of arguments.
* Substitution with Ellipsis is not supported.
(cherry picked from commit ecfacc362d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-01-27 05:01:24 -08:00
Miss Islington (bot)
2572c670d4
[3.10] bpo-23556: [doc] Fix inaccuracy in documentation for raise without args. Improve tests for context in nested except handlers. (GH-29236) (GH-30953)
(cherry picked from commit 08c0ed2d9c)


Co-authored-by: Kinshuk Dua <kinshukdua@gmail.com>

Automerge-Triggered-By: GH:iritkatriel
2022-01-27 02:51:06 -08:00
Miss Islington (bot)
b3cf525bd1
bpo-46496: news11-10 for bpo45296 (GH-30937)
(cherry picked from commit 9f0881476e)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-01-26 23:05:42 -05:00
Miss Islington (bot)
5acaad0b30
bpo-45296: Clarify close, quit, and exit in IDLE (GH-30936) (GH-30944)
In the File menu, 'Close' and 'Exit' are now 'Close Window' (the current
one) and 'Exit' is now 'Exit IDLE' (by closing all windows).
In Shell, 'quit()' and 'exit()' mean 'close Shell'.
If there are no other windows, this also exits IDLE.
(cherry picked from commit fcde0bc10d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-01-26 22:55:25 -05:00
Miss Islington (bot)
c730342005
bpo-46529: increase coverage of typing.Union.__repr__ method (GH-30911)
(cherry picked from commit d0c690b5f8)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-01-26 02:39:40 -08:00
Pablo Galindo Salgado
3fc8b74ace
[3.10] bpo-46091: Correctly calculate indentation levels for whitespace lines with continuation characters (GH-30130). (GH-30898)
(cherry picked from commit a0efc0c196)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-01-25 22:33:57 +00:00
Victor Stinner
4a57fa296b
[3.10] bpo-45382: test.pythoninfo logs more Windows versions (GH-30891)
Add the following info to test.pythoninfo:

* windows.ver: output of the shell "ver" command
* windows.version and windows.version_caption: output of the
  "wmic os get Caption,Version /value" command.

(cherry picked from commit b0898f4aa9)

* bpo-45382: test.pythoninfo: set wmic.exe encoding to OEM (GH-30890)

(cherry picked from commit cef0a5458f)
2022-01-25 21:20:34 +01:00
Miss Islington (bot)
75d88b91e6
bpo-41682: fixed flaky test test_sendfile_close_peer_in_the_middle_of_receiving (GH-30845) (#30860)
(cherry picked from commit 1c705fda8f)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-01-25 18:40:13 +01:00
Ken Jin
9a7d010467
[3.10] bpo-46445, bpo-46519: Re-import typing.NewType (GH-30886)
Partially reverts 65b88d5e01.
2022-01-25 23:31:12 +08:00
Miss Islington (bot)
41e0aead3d
bpo-46491: Allow Annotated on outside of Final/ClassVar (GH-30864)
We treat Annotated type arg as class-level annotation. This exempts it from checks against Final and ClassVar in order to allow using them in any nesting order.

Automerge-Triggered-By: GH:gvanrossum
(cherry picked from commit e1abffca45)

Co-authored-by: Gregory Beauregard <greg@greg.red>
2022-01-25 06:38:45 -08:00
Terry Jan Reedy
367a37a18c
[3.10] bpo-46496: Update IDLE News to 2021 Jan 24 (GH-30876)
Cherry picked from b1a3446f07
2022-01-25 03:28:29 -05:00
Miss Islington (bot)
ce79b504a7
bpo-41841: update idlelib News up to 3.10.0. (GH-30868) (GH-30870)
(cherry picked from commit 9d3c9788a6)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-01-25 02:02:02 -05:00
Miss Islington (bot)
894e8c1348
bpo-46503: Prevent an assert from firing when parsing some invalid \N sequences in f-strings. (GH-30865) (GH-30866)
* bpo-46503: Prevent an assert from firing.  Also fix one nearby tiny PEP-7 nit.

* Added blurb.
(cherry picked from commit 0daf72194b)

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

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2022-01-24 22:13:11 -05:00
Nikita Sobolev
eaeb994680
[3.10] bpo-46416: Allow direct invocation of Lib/test/test_typing.py (GH-30641) (GH-30697)
Use `__name__`
(cherry picked from commit 2792d6d18e)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-01-25 00:18:38 +08:00
Miss Islington (bot)
b2c7fe1f61
Improve grouper() recipe to demonstrate all forms of zip() (GH-30837) (GH-30840) 2022-01-23 16:02:31 -06:00
Irit Katriel
e3ade66ec5
bpo-41403: Improve error message for invalid mock target (GH-30833) (GH-30834)
(cherry picked from commit f7955a82e3)
2022-01-23 19:34:43 +00:00
Jason R. Coombs
a7a4ca4f06
[3.10] bpo-46474: Avoid REDoS in EntryPoint.pattern (sync with importlib_metadata 4.10.1) (GH-30803) (GH-30827)
(cherry picked from commit 51c3e28c8a)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2022-01-23 10:17:27 -05:00
Pablo Galindo Salgado
633db1c4eb
[3.10] bpo-46240: Correct the error for unclosed parentheses when the tokenizer is not finished (GH-30378). (GH-30819)
(cherry picked from commit 70f415fb8b)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-01-23 03:10:37 +00:00
Miss Islington (bot)
f66ef3eab6
bpo-46266: Add calendar day of week constants to __all__ (GH-30412) (GH-30424)
(cherry picked from commit e5894ca8fd)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-01-23 02:00:11 +01:00
Miss Islington (bot)
486b4d3d8e
bpo-41682: Skip unstable test_asyncio sendfile test on Windows (GH-30801) (GH-30812)
(cherry picked from commit 1ded8ed8e8)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-01-23 01:58:16 +01:00
Miss Islington (bot)
83aef4d340
bpo-43118: Fix bug in inspect.signature around 'base.__text_signature__' (GH-30285) (#30765)
(cherry picked from commit 881a763cfe)

Co-authored-by: Weipeng Hong <hongweichen8888@sina.com>

Co-authored-by: Weipeng Hong <hongweichen8888@sina.com>
2022-01-22 09:28:48 -08:00
Miss Islington (bot)
6111d5dee2
bpo-46425: fix direct invocation of asyncio tests (GH-30725) (#30782)
(cherry picked from commit 5a5340044c)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-01-22 14:29:51 +02:00
Miss Islington (bot)
90e2998db7
[3.10] bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777) (#30784)
* bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777)

* bpo-46469: Make asyncio generic classes return GenericAlias

* 📜🤖 Added by blurb_it.

* Update Misc/NEWS.d/next/Library/2022-01-22-05-05-08.bpo-46469.plUab5.rst

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit ea5b96842e)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>

* Fix tests

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2022-01-22 14:28:51 +02:00
Miss Islington (bot)
d4a9e34401
bpo-46442: improve and rename testExceptionCleanupNames (GH-30758)
The test tested that explicitly deleting the local variable bound to the exception
did not cause problems, but it did not test what it actually claimed to test, i.e.
that the variable is deleted automatically.
(cherry picked from commit 82c53229e1)

Co-authored-by: Yellow Dusk <yellow.dusk1590@fastmail.com>
2022-01-21 23:34:29 -08:00
Miss Islington (bot)
46e6aad129
bpo-46445: Cover multiple inheritance of TypedDict in test_typing (GH-30719)
(cherry picked from commit 65b88d5e01)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-01-21 14:37:52 -08:00