Commit graph

111076 commits

Author SHA1 Message Date
Miss Islington (bot)
42f87d435e
bpo-45863: tarfile: don't zero out header fields unnecessarily (GH-29693)
Numeric fields of type float, notably mtime, can't be represented
exactly in the ustar header, so the pax header is used. But it is
helpful to set them to the nearest int (i.e. second rather than
nanosecond precision mtimes) in the ustar header as well, for the
benefit of unarchivers that don't understand the pax header.

Add test for tarfile.TarInfo.create_pax_header to confirm correct
behaviour.
(cherry picked from commit bf2d44ffb0)

Co-authored-by: Joshua Root <jmr@macports.org>
2022-02-09 09:31:12 -08:00
Miss Islington (bot)
d29bbc22b0
bpo-46685: cover TypeError of ForwardRef(1) in test_typing (GH-31223)
(cherry picked from commit d2d1d49eac)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-02-09 07:12:17 -08:00
Miss Islington (bot)
c2735b75af
bpo-46678: Fix Invalid cross device link in Lib/test/support/import_helper.py (GH-31204) (GH-31207)
In `Lib/test/support/import_helper.py`, the function `make_legacy_pyc` makes a call to `os.rename` which can fail when the source and target live on different devices. This happens (for example) when `PYTHONPYCACHEPREFIX` is set to a directory anywhere on disk, while a ramdisk is mounted on `/tmp` (the latter of which is the default on various Linux distros). Replacing `os.rename` with `shutil.move` fixes this.

Automerge-Triggered-By: GH:brettcannon
(cherry picked from commit da576e0829)

Co-authored-by: Jason Wilkes <notarealdeveloper@gmail.com>
2022-02-08 13:04:05 -08:00
Pablo Galindo Salgado
5b58db7529
[3.10] bpo-46521: Fix codeop to use a new partial-input mode of the parser (GH-31010). (GH-31213)
(cherry picked from commit 69e10976b2)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-02-08 12:25:15 +00:00
Gregory Beauregard
cbdcae5ab9
[3.10] bpo-46676: Make ParamSpec args and kwargs equal to themselves (GH-31203) (GH-31210)
(cherry picked from commit c8b62bbe46)

Co-authored-by: Gregory Beauregard <greg@greg.red>
2022-02-08 10:41:13 +02:00
Miss Islington (bot)
9539400390
[3.10] bpo-46648: Rewrite test_urllib2.test_issue16464() with a local HTTP server (GH-31186) (GH-31189)
Re-enable test_issue16464() of test_urllib2, move it to urllib2_localnet
and use the local HTTP server rather than an external HTTP server.
(cherry picked from commit 8e98175a03)


Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-02-07 12:15:22 -08:00
Miss Islington (bot)
9c45390208
bpo-46638: Makes registry virtualisation setting stable when building MSIX packages (GH-31130)
(cherry picked from commit 3a5afc14e1)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-02-07 09:31:32 -08:00
Gregory Beauregard
e2eeffefed
[3.10] bpo-46655: allow stringized TypeAlias with get_type_hints (GH-31156). (#31175)
(cherry picked from commit 77b025be4a)

Co-authored-by: Gregory Beauregard <greg@greg.red>
2022-02-07 08:21:56 -08:00
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)
3ceff9968b
bpo-40479: Fix undefined behavior in Modules/_hashopenssl.c (GH-31153)
va_end() must be called before returning.
(cherry picked from commit 59e004af63)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2022-02-07 00:05:29 -08: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
Terry Jan Reedy
5603db43ba
[3.10] bpo-46609: Update asyncio-task coroutine doc (GH-31132)
@coroutine in removed in 3.11, not 3.10.
2022-02-04 14:59:23 -05:00
Miss Islington (bot)
7b5b23c31d
bpo-46629: Update classicAppCompat.sccd for new signing certificate (GH-31111)
(cherry picked from commit 9b4e3d94a5)

Co-authored-by: Steve Dower <steve.dower@python.org>
2022-02-04 08:34:12 -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)
91e8889044
bpo-14916: use specified tokenizer fd for file input (GH-31006)
@pablogsal, sorry i failed to rebase to main, so i recreated https://github.com/python/cpython/pull/22190GH-issuecomment-1024633392

> PyRun_InteractiveOne\*() functions allow to explicitily set fd instead of stdin.
but stdin was hardcoded in readline call.

> This patch does not fix target file for prompt unlike original bpo one : prompt fd is unrelated to tokenizer source which could be read only. It is more of a bugfix regarding the docs :  actual documentation say "prompt the user" so one would expect prompt to go on stdout not a file for both PyRun_InteractiveOne\*() and PyRun_InteractiveLoop\*().

Automerge-Triggered-By: GH:pablogsal
(cherry picked from commit 89b13042fc)

Co-authored-by: Paul m. p. P <mail.peny@free.fr>
2022-02-03 15:32:22 -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)
ff6948b128
bpo-45773: Remove invalid peephole optimizations (GH-31066)
(cherry picked from commit e0433c1e70)

Co-authored-by: Brandt Bucher <brandt@python.org>
2022-02-03 07:54:51 -08:00
Raymond Hettinger
a77de58108
Add recipe for subslices (GH-31095) 2022-02-03 02:12:08 -06:00
Gregory P. Smith
f5ebec4d3e
[3.10] bpo-46576: bpo-46524: Disable compiler optimization within test_peg_generator. (GH-31015) (GH-31089)
Disable compiler optimization within test_peg_generator.

This speed up test_peg_generator by always disabling compiler
optimizations by using -O0 or equivalent when the test is building its
own C extensions.

A build not using --with-pydebug in order to speed up test execution
winds up with this test taking a very long time as it would do
repeated compilation of parser C code using the same optimization
flags as CPython was built with.

This speeds the test up 6-8x on gps-raspbian.

Also incorporate's GH-31017's win32 conditional and flags.

Co-authored-by: Kumar Aditya kumaraditya303.
(cherry picked from commit 164a017e13)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2022-02-02 20:02:59 -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`](b06e9ba398) 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
Ned Deily
519eb6ad74
bpo-45925: Update macOS installer to SQLite 3.37.2 (GH-30921) (GH-31057)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2022-02-01 11:29:02 -05: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
Steve Dower
4d191fcde4
bpo-45925: Update Windows installer to SQLite 3.37.2 (GH-30485)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-01-28 17:13:22 +00: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)
a8912a0f8d
bpo-29844: Remove obsolete paragraph from Tools/msi/README.txt (GH-29141)
(cherry picked from commit 098a33f6a6)
2022-01-27 10:59:20 -06: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)
1ecc98dedb
bpo-42982: Improve the text on suggested number of iterations of PBKDF2 (GH-24276)
Less specific number wording (as there is no one right number - the old 100k is too big for some applications and woefully small for others). We now link to NIST SP 800-132 to tell people what to read in there on how to decide for their application.

Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google]
(cherry picked from commit 897ce90187)

Co-authored-by: Illia Volochii <illia.volochii@gmail.com>
2022-01-27 01:01:30 -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
Pablo Galindo Salgado
c7af838805
[3.10] bpo-46502: Remove "How do I tell incomplete input" from FAQ (GH-30925) (GH-30933)
Since,

- Py_CompileString no longer allows to distinguish "incomplete input"
  from "invalid input"
- there is no alternative solution available from the Python C API
  due to how the new parser works (rewritten in 3.9)
- the only supported way is to manually import the codeop module from C
  and use its API as IDLE does, and accept its own complications

it is desirable to remove this Q&A from the official FAQ..
(cherry picked from commit f0a648152f)

Co-authored-by: Mateusz Łoskot <mateusz@loskot.net>

Co-authored-by: Mateusz Łoskot <mateusz@loskot.net>
2022-01-27 00:16:50 +00:00
Miss Islington (bot)
171fdf2162
bpo-38472: setup.py uses LC_ALL=C to check the C compiler (GH-30929)
Fix GCC detection in setup.py when cross-compiling. The C compiler is
now run with LC_ALL=C. Previously, the detection failed with a German
locale.
(cherry picked from commit a9503ac394)

Co-authored-by: Victor Stinner <vstinner@python.org>
2022-01-26 15:49:53 -08:00