Commit Graph

50011 Commits

Author SHA1 Message Date
Senthil Kumaran
c9864121cb
gh-99352: Ensure HTTPSConnection is available before exercising https tests. (#103828)
gh-99352: Ensure HTTPSConnection is available before exercising https
tests.

This will fix the buildbot issue mentioned in

https://github.com/python/cpython/pull/99353
2023-04-25 18:02:27 -07:00
Juhi Chandalia
86aa8a5e98
GH-103804: Add test for dis.findlinestarts (#103806) 2023-04-25 22:23:35 +01:00
Carl Meyer
ef25febcf2
gh-87729: specialize LOAD_SUPER_ATTR_METHOD (#103809) 2023-04-25 17:45:51 +00:00
Samuel Sloniker
32bea69b89
gh-51574: Make tempfile.mkdtemp() always return absolute paths (#94612)
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2023-04-25 16:05:59 +00:00
Petr Viktorin
c8c3956d90
gh-102950: Adjust tarfile filter tests for systems that don't set the sticky bit (GH-103831)
Also remove expilcit `type=tarfile.DIRTYPE`, the slash at the end is
enough.
2023-04-25 12:56:01 +00:00
Prince Roshan
b934f97850
gh-103636: add enums for days and months in calendar module (GH-103642)
Convert day contants to a Day enum, and add a Month enum.
2023-04-24 19:51:27 -07:00
Allan Lago
3df3b91e6a
gh-82814: fix shutil access error on WSL (#103790)
gh-82814: Adds `errno.EACCES` to the list of ignored errors on
`_copyxattr`.  EPERM and EACCES are different constants but
in general should be treated the same.

News entry authored by: Gregory P. Smith <greg@krypto.org>
2023-04-25 00:45:38 +00:00
Rodolfo M. Pereira
8291ae31dd
GH-103805: Lib test f541 linting issue fix (#103812)
This PR makes some minor linting adjustments to the Lib/test module
caught by [ruff](https://github.com/charliermarsh/ruff). The adjustments
are all related to the `F541 f-string without any placeholders` issue.

Issue: https://github.com/python/cpython/issues/103805

<!-- gh-issue-number: gh-103805 -->
* Issue: gh-103805
<!-- /gh-issue-number -->

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-04-24 23:24:49 +00:00
Eric Snow
df3173d28e
gh-101659: Isolate "obmalloc" State to Each Interpreter (gh-101660)
This is strictly about moving the "obmalloc" runtime state from
`_PyRuntimeState` to `PyInterpreterState`.  Doing so improves isolation
between interpreters, specifically most of the memory (incl. objects)
allocated for each interpreter's use.  This is important for a
per-interpreter GIL, but such isolation is valuable even without it.

FWIW, a per-interpreter obmalloc is the proverbial
canary-in-the-coalmine when it comes to the isolation of objects between
interpreters.  Any object that leaks (unintentionally) to another
interpreter is highly likely to cause a crash (on debug builds at
least).  That's a useful thing to know, relative to interpreter
isolation.
2023-04-24 17:23:57 -06:00
jb2170
d94b3a6f45
gh-103673: Add missing ForkingUnixStreamServer and ForkingUnixDatagramServer socketservers (#103674)
sockserver gains ForkingUnixStreamServer and ForkingUnixDatagramServer classes for consistency with all of the others. Ironically these existed but were buried in our test suite.

Addresses #103673 

<!-- gh-issue-number: gh-103673 -->
* Issue: gh-103673
<!-- /gh-issue-number -->

---------

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-04-24 22:35:52 +00:00
Carl Meyer
0dc8b50d33
gh-87729: add LOAD_SUPER_ATTR instruction for faster super() (#103497)
This speeds up `super()` (by around 85%, for a simple one-level
`super().meth()` microbenchmark) by avoiding allocation of a new
single-use `super()` object on each use.
2023-04-24 22:22:14 +00:00
Łukasz Langa
22bed58e53
gh-103791: Make contextlib.suppress also act on exceptions within an ExceptionGroup (#103792)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2023-04-24 22:17:02 +00:00
Shantanu
ae25855045
gh-103492: Clarify SyntaxWarning with literal comparison (#103493) 2023-04-24 15:42:57 -06:00
Irit Katriel
1c01f8d797
gh-101517: fix line number propagation in code generated for except* (#103550) 2023-04-24 21:58:51 +01:00
Itamar Ostricher
518050ced1
gh-103780: Use patch instead of mock in asyncio unix events test (#103782) 2023-04-24 20:12:48 +00:00
JosephSBoyle
04ea04807d
gh-102498 Clean up unused variables and imports in the email module (#102482)
* Clean up unused variables and imports in the email module

* Remove extra newline char

* Remove superflous dict+unpacking syntax

* Remove unused 'msg' var

* Clean up unused variables and imports in the email module

* Remove extra newline char

* Remove superflous dict+unpacking syntax

* Remove unused 'msg' var

---------

Co-authored-by: Barry Warsaw <barry@python.org>
2023-04-24 19:19:28 +00:00
Nikita Sobolev
58b6be3791
gh-99184: Bypass instance attribute access in repr of weakref.ref (#99244) 2023-04-24 12:57:36 -06:00
Lysandros Nikolaou
cb157a1a35
GH-103727: Avoid advancing tokenizer too far in f-string mode (GH-103775) 2023-04-24 12:30:21 -06:00
Terry Jan Reedy
ab25c7e311
Revert "Add tests for empty range equality (#103751)" (#103770)
This reverts commit dca27a69a8.
Added tests are redundant with existing tests.
2023-04-24 14:29:57 -04:00
Nikita Sobolev
3d29edaf0a
gh-103746: Test types.UnionType and Literal types together (#103747) 2023-04-24 10:55:16 -06:00
Brett Simmers
b7f4811c88
gh-103091: Add PyUnstable_Type_AssignVersionTag (#103095) 2023-04-24 10:07:47 -06:00
Kirill
dca27a69a8
Add tests for empty range equality (#103751) 2023-04-24 10:32:15 -04:00
Christopher Chavez
014f131934
Change 'dependant' to 'dependent' (#103745)
The word 'dependent' is both an adjective and a noun. A 'dependant' is a British alternative spelling for the noun form. In idlelib.sidebar, 'OS-dependant' is an adjective and clearly wrong. In 'Using', 'dependant' as a noun would be acceptable in Britain, but we use American spellings in Python docs.
https://www.merriam-webster.com/words-at-play/spelling-variants-dependent-vs-dependant
2023-04-24 09:40:30 -04:00
Petr Viktorin
af53046995
gh-102950: Implement PEP 706 – Filter for tarfile.extractall (#102953) 2023-04-24 10:58:06 +02:00
Tian Gao
36860134a9
gh-103285: Rewrite _splitlines_no_ff to improve performance (#103307) 2023-04-23 23:03:49 -06:00
Christopher Chavez
f0ed293f6a
gh-103685: Fix tkinter.Menu.index() for Tk 8.7 (#103686)
---------

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2023-04-23 21:31:44 -04:00
Nikita Sobolev
bd2dca035a
gh-103668: Run pyugrade on idlelib (#103671)
---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-04-23 19:25:08 -04:00
Ankit Kumar Pandey
7255bbd4a1
gh-103724: Add test case if no arg as provided in os.register_at_fork (gh-103725) 2023-04-23 17:14:14 -06:00
James Hilton-Balfe
730bbddfdf
gh-101688: Implement types.get_original_bases (#101827)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-04-23 20:24:30 +01:00
Lysandros Nikolaou
05b3ce7339
GH-103718: Correctly cache and restore f-string buffers when needed (GH-103719) 2023-04-23 13:06:10 -06:00
Nikita Sobolev
5041c2ba6e
gh-103592: Add tests of Literal with Enum and Union of Literals (#103706) 2023-04-23 11:50:23 -06:00
Ankit Kumar Pandey
777bdff0ec
gh-103716: Add test support requires fork in simple_subprocess (gh-103717)
add requires fork as test case depends on this
2023-04-23 11:19:16 -06:00
Adrian Garcia Badaracco
0056701aa3
GH-103699: Add __orig_bases__ to various typing classes (#103698)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-04-23 08:33:39 -06:00
Dan Hemberger
e38bebb9ee
gh-81403: Fix for CacheFTPHandler in urllib (#13951)
bpo-37222: Fix for CacheFTPHandler in urllib

A call to FTP.ntransfercmd must be followed by FTP.voidresp to clear
the "end transfer" message. Without this, the client and server get
out of sync, which will result in an error if the FTP instance is
reused to open a second URL. This scenario occurs for even the most
basic usage of CacheFTPHandler.

Reverts the patch merged as a resolution to bpo-16270 and adds a test
case for the CacheFTPHandler in test_urllib2net.py.

Co-authored-by: Senthil Kumaran <senthil@python.org>
2023-04-22 21:41:23 -07:00
Nikita Sobolev
0fd3891758
gh-102310: Change error range for invalid bytes literals (#103663) 2023-04-22 18:08:27 -06:00
Randy
7bf94568a9
gh-68654: Clarify subdirectories used by pkgutil.extend_path (#103701)
Clarify sub directories used by pkgutil.extend_path in the docs and the docstring
2023-04-22 17:33:50 -06:00
Eddie Elizondo
ea2c001650
gh-84436: Implement Immortal Objects (gh-19474)
This is the implementation of PEP683

Motivation:

The PR introduces the ability to immortalize instances in CPython which bypasses reference counting. Tagging objects as immortal allows up to skip certain operations when we know that the object will be around for the entire execution of the runtime.

Note that this by itself will bring a performance regression to the runtime due to the extra reference count checks. However, this brings the ability of having truly immutable objects that are useful in other contexts such as immutable data sharing between sub-interpreters.
2023-04-22 13:39:37 -06:00
Jason R. Coombs
916de04fd1
gh-103661: Apply bugfix from importlib_metadata 6.5.1 and restore test. (#103681) 2023-04-22 13:52:51 -04:00
Eric Wieser
3d2a46845b
gh-83791: Raise TypeError for len(memoryview_0d) (#18463)
Changes the behaviour of `len` on a zero-dimensional `memoryview` to raise `TypeError`. Previously, `len` would return `1`.
2023-04-22 17:32:47 +01:00
Paul Moore
b2862950dc
gh-103559: Update bundled pip version to 23.1.1 (gh-103560)
* Update bundled pip version to 23.1
* Update to pip 23.1.1
2023-04-22 12:19:23 +01:00
Nikita Sobolev
6b58d419a1
gh-103556: [inspect.Signature] disallow pos-or-kw params without default after pos-only with default (#103557) 2023-04-21 23:45:10 -06:00
Jason R. Coombs
dc328d398d
gh-103661: Skip failing test on Windows. (#103662) 2023-04-21 11:30:30 -04:00
Jason R. Coombs
3e0fec7e07
Sync with importlib_metadata 6.5 (GH-103584) 2023-04-20 22:12:48 -04:00
Wheeler Law
5c00a6224d
gh-99352: Respect http.client.HTTPConnection.debuglevel in urllib.request.AbstractHTTPHandler (#99353)
* bugfix: let the HTTP- and HTTPSHandlers respect the value of http.client.HTTPConnection.debuglevel

* add tests

* add news

* ReSTify NEWS and reword a bit.

* Address Review Comments.

* Use mock.patch.object instead of settting the module level value.
* Used test values to assert the debuglevel.

---------

Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Senthil Kumaran <senthil@python.org>
2023-04-20 19:04:25 -07:00
Eric Snow
6be7aee18c
gh-98040: Move the Single-Phase Init Tests Out of test_imp (gh-102561)
I recently added some tests to test_imp, but @warsaw is removing that file in gh-98573. The tests are worth keeping so here I'm moving them to test_import.
2023-04-19 16:09:35 -06:00
Alexander Belopolsky
2b1260c557
gh-83861: Fix datetime.astimezone() method (GH-101545) 2023-04-19 14:02:29 -07:00
Pablo Galindo Salgado
5f7d68e48d
gh-102856: Skip test_mismatched_parens in WASI builds (#103633) 2023-04-19 11:53:34 -06:00
Pablo Galindo Salgado
1ef61cf71a
gh-102856: Initial implementation of PEP 701 (#102855)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
Co-authored-by: Marta Gómez Macías <mgmacias@google.com>
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
2023-04-19 11:18:16 -05:00
Irit Katriel
d1e4917e06
gh-102778: IDLE - make sys.last_exc available in Shell after traceback (#103314)
---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-04-19 01:05:52 -04:00
Ethan Furman
700ec657c8
gh-103596: [Enum] do not shadow mixed-in methods/attributes (GH-103600)
For example:

    class Book(StrEnum):
        title = auto()
        author = auto()
        desc = auto()

    Book.author.desc is Book.desc

but

    Book.author.title() == 'Author'

is commonly expected.  Using upper-case member names avoids this confusion and possible performance impacts.

Co-authored-by: samypr100 <3933065+samypr100@users.noreply.github.com>
2023-04-18 16:19:23 -07:00