summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* gh-113688: fix dtrace build on Solaris (#113814)Jakub Kulík2024-01-081-2/+2
| | | (the gcmodule -> gc refactoring broke it)
* GH-113528: Move a few misplaced pathlib tests (#113527)Barney Gale2024-01-082-86/+86
| | | | | | | `PurePathBase` does not define `__eq__()`, and so we have no business checking path equality in `test_eq_common` and `test_equivalences`. The tests only pass at the moment because we define the test class's `__eq__()` for use elsewhere. Also move `test_parse_path_common` into the main pathlib test suite. It exercises a private `_parse_path()` method that will be moved to `PurePath` soon. Lastly move a couple more tests concerned with optimisations and path normalisation.
* Minor algebraic simplification for the totient() recipe (gh-113822)Raymond Hettinger2024-01-081-1/+1
|
* gh-113755: Fully adapt gcmodule.c to Argument Clinic (#113756)Erlend E. Aasland2024-01-083-28/+175
| | | | | | | Adapt the following functions to Argument Clinic: - gc.set_threshold - gc.get_referrers - gc.get_referents
* gh-113787: Fix refleaks in test_capi (gh-113816)neonene2024-01-082-3/+2
| | | Fix refleaks and a typo.
* gh-113391: fix outdated PyObject_HasAttr docs (#113420)Sergey B Kirpichev2024-01-081-3/+2
| | | | | After #53875: PyObject_HasAttr is not an equivalent of hasattr. PyObject_HasAttrWithError is; it already has the note.
* gh-110721: Remove unused code from suggestions.c after moving PyErr_Display ↵Pablo Galindo Salgado2024-01-0812-225/+117
| | | | to use the traceback module (#113712)
* gh-74678: Increase base64 test coverage (GH-21913)Zackery Spytz2024-01-081-0/+3
| | | | | | Ensure the character y is disallowed within an Ascii85 5-tuple. Co-authored-by: Lee Cannon <leecannon@leecannon.xyz>
* gh-80109: Fix io.TextIOWrapper dropping the internal buffer during write() ↵Zackery Spytz2024-01-084-8/+24
| | | | | | | (GH-22535) io.TextIOWrapper was dropping the internal decoding buffer during read() and write() calls.
* gh-73965: Move PYTHON_HISTORY into the correct usage section (#113798)Hugo van Kemenade2024-01-081-1/+1
| | | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-73965: New environment variable PYTHON_HISTORY (#13208)Zackery Spytz2024-01-077-3/+50
| | | | | | | | It can be used to set the location of a .python_history file --------- Co-authored-by: Levi Sabah <0xl3vi@gmail.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* gh-112795: Allow `/` folder in a zipfile (#112932)AN Long2024-01-073-1/+16
| | | | | | Allow extraction (no-op) of a "/" folder in a zipfile, they are commonly added by some archive creation tools. Co-authored-by: Erlend E. Aasland <erlend@python.org> Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-89532: Remove LibreSSL workarounds (#28728)Rami2024-01-066-6330/+7
| | | | | | Remove LibreSSL specific workaround ifdefs from `_ssl.c` and delete the non-version-specific `_ssl_data.h` file (relevant for OpenSSL < 1.1.1, which we no longer support per PEP 644). Co-authored-by: Christian Heimes <christian@python.org> Co-authored-by: Gregory P. Smith <greg@krypto.org>
* GH-113528: Deoptimise `pathlib._abc.PurePathBase.relative_to()` (#113529)Barney Gale2024-01-062-2/+5
| | | | | Replace use of `_from_parsed_parts()` with `with_segments()` in `PurePathBase.relative_to()`, and move the assignment of `_drv`, `_root` and `_tail_cached` slots into `PurePath.relative_to()`.
* GH-113528: Deoptimise `pathlib._abc.PurePathBase.parent` (#113530)Barney Gale2024-01-062-42/+63
| | | | | Replace use of `_from_parsed_parts()` with `with_segments()`, and move assignments to `_drv`, `_root`, _tail_cached` and `_str` slots into `PurePath`.
* GH-113528: Deoptimise `pathlib._abc.PurePathBase.name` (#113531)Barney Gale2024-01-062-7/+25
| | | | | Replace usage of `_from_parsed_parts()` with `with_segments()` in `with_name()`, and take a similar approach in `name` for consistency's sake.
* GH-113528: Slightly improve `pathlib.Path.glob()` tests for symlink loop ↵Barney Gale2024-01-061-9/+14
| | | | | | | | | handling (#113763) Slightly improve `pathlib.Path.glob()` tests for symlink loop handling When filtering results, ignore paths with more than one `linkD/` segment, rather than all paths below the first `linkD/` segment. This allows us to test that other paths under `linkD/` are correctly returned.
* GH-113528: Split up pathlib tests for invalid basenames. (#113776)Barney Gale2024-01-061-4/+31
| | | | | | Split test cases for invalid names into dedicated test methods. This will make it easier to refactor tests for invalid name handling in ABCs later. No change of coverage, just a change of test suite organisation.
* GH-113528: pathlib ABC tests: add repr to dummy path classes. (#113777)Barney Gale2024-01-061-0/+6
| | | | | The `DummyPurePath` and `DummyPath` test classes are simple subclasses of `PurePathBase` and `PathBase`. This commit adds `__repr__()` methods to the dummy classes, which makes debugging test failures less painful.
* gh-107901: synthetic jumps which are not at end of loop no longer check the ↵Irit Katriel2024-01-067-53/+108
| | | | eval breaker (#113721)
* gh-111488: Changed error message in case of no 'in' keyword after 'for' in ↵Grigoriev Semyon2024-01-065-1592/+1820
| | | | cmp (#113656)
* gh-113537: support loads str in plistlib.loads (#113582)AN Long2024-01-064-3/+24
| | | Add support for loading XML plists from a string value instead of a only bytes value.
* gh-113729: Fix IDLE's Help -> "IDLE Help" menu bug in 3.12.1 and 3.11.7 ↵Ronald Oussoren2024-01-065-20/+26
| | | | | (#113731) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* gh-113750: Fix object resurrection in free-threaded builds (gh-113751)Sam Gross2024-01-063-6/+14
| | | | | | | | | gh-113750: Fix object resurrection on free-threaded builds This avoids the undesired re-initializing of fields like `ob_gc_bits`, `ob_mutex`, and `ob_tid` when an object is resurrected due to its finalizer being called. This change has no effect on the default (with GIL) build.
* GH-113568: Stop raising deprecation warnings from pathlib ABCs (#113757)Barney Gale2024-01-055-24/+46
|
* gh-113360: Fix the documentation of module's attribute __test__ (GH-113393)Serhiy Storchaka2024-01-051-3/+3
| | | It can only be a dict since Python 2.4.
* gh-85567: Fix resouce warnings in pickle and pickletools CLIs (GH-113618)Serhiy Storchaka2024-01-053-13/+30
| | | Explicitly open and close files instead of using FileType.
* GH-113568: Stop raising auditing events from pathlib ABCs (#113571)Barney Gale2024-01-055-35/+64
| | | | | Raise auditing events in `pathlib.Path.glob()`, `rglob()` and `walk()`, but not in `pathlib._abc.PathBase` methods. Also move generation of a deprecation warning into `pathlib.Path` so it gets the right stack level.
* gh-113688: Split up gcmodule.c (gh-113715)Sam Gross2024-01-059-1960/+2031
| | | | | This splits part of Modules/gcmodule.c of into Python/gc.c, which now contains the core garbage collection implementation. The Python module remain in the Modules/gcmodule.c file.
* gh-112532: Tag mimalloc heaps and pages (#113742)Sam Gross2024-01-057-16/+35
| | | | | | | | | | | | | | | | | | | | | * gh-112532: Tag mimalloc heaps and pages Mimalloc pages are data structures that contain contiguous allocations of the same block size. Note that they are distinct from operating system pages. Mimalloc pages are contained in segments. When a thread exits, it abandons any segments and contained pages that have live allocations. These segments and pages may be later reclaimed by another thread. To support GC and certain thread-safety guarantees in free-threaded builds, we want pages to only be reclaimed by the corresponding heap in the claimant thread. For example, we want pages containing GC objects to only be claimed by GC heaps. This allows heaps and pages to be tagged with an integer tag that is used to ensure that abandoned pages are only claimed by heaps with the same tag. Heaps can be initialized with a tag (0-15); any page allocated by that heap copies the corresponding tag. * Fix conversion warning
* gh-101100: Fix Sphinx warnings in `library/pyclbr.rst` (#113739)Hugo van Kemenade2024-01-053-50/+58
| | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-80532: Do not set ipv6type when cross-compiling (#17956)Zackery Spytz2024-01-053-2/+3
| | | Co-authored-by: Xavier de Gaye <xdegaye@gmail.com>
* gh-101100: Fix Sphinx warnings for 2.6 deprecations and removals (#113725)Hugo van Kemenade2024-01-058-57/+57
| | | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* gh-113703: Correctly identify incomplete f-strings in the codeop module ↵Pablo Galindo Salgado2024-01-053-2/+11
| | | | (#113709)
* GH-113486: Do not emit spurious PY_UNWIND events for optimized calls to ↵Mark Shannon2024-01-056-28/+64
| | | | classes. (GH-113680)
* gh-113320: Reduce the number of dangerous `getattr()` calls when ↵Alex Waygood2024-01-053-20/+68
| | | | | | | constructing protocol classes (#113401) - Only attempt to figure out whether protocol members are "method members" or not if the class is marked as a runtime protocol. This information is irrelevant for non-runtime protocols; we can safely skip the risky introspection for them. - Only do the risky getattr() calls in one place (the runtime_checkable class decorator), rather than in three places (_ProtocolMeta.__init__, _ProtocolMeta.__instancecheck__ and _ProtocolMeta.__subclasscheck__). This reduces the number of locations in typing.py where the risky introspection could go wrong. - For runtime protocols, if determining whether a protocol member is callable or not fails, give a better error message. I think it's reasonable for us to reject runtime protocols that have members which raise strange exceptions when you try to access them. PEP-544 clearly states that all protocol member must be callable for issubclass() calls against the protocol to be valid -- and if a member raises when we try to access it, there's no way for us to figure out whether it's a callable member or not!
* gh-112532: Isolate abandoned segments by interpreter (#113717)Sam Gross2024-01-047-76/+102
| | | | | | | | | | | | | | | * gh-112532: Isolate abandoned segments by interpreter Mimalloc segments are data structures that contain memory allocations along with metadata. Each segment is "owned" by a thread. When a thread exits, it abandons its segments to a global pool to be later reclaimed by other threads. This changes the pool to be per-interpreter instead of process-wide. This will be important for when we use mimalloc to find GC objects in the `--disable-gil` builds. We want heaps to only store Python objects from a single interpreter. Absent this change, the abandoning and reclaiming process could break this isolation. * Add missing '&_mi_abandoned_default' to 'tld_empty'
* GH-113225: Speed up `pathlib.Path.glob()` (#113226)Barney Gale2024-01-042-1/+8
| | | | Use `os.DirEntry.path` as the string representation of child paths, unless the parent path is empty, in which case we use the entry `name`.
* gh-113538: Don't error in stream reader protocol callback when task is ↵Guido van Rossum2024-01-043-7/+21
| | | | cancelled (#113690)
* gh-113569: Display calls in Mock.assert_has_calls failure when empty (GH-113573)wookie1842024-01-043-18/+28
|
* gh-113696: Docs: Annotate PyObject_CallOneArg and PyObject_CallNoArgs as ↵Jamie Phan2024-01-041-0/+7
| | | | returning a strong reference (#113697)
* GH-113689: Fix broken handling of invalid executors (GH-113694)Brandt Bucher2024-01-042-2/+4
|
* gh-52161: Enhance Cmd support for docstrings (#110987)Filip Łapkiewicz2024-01-032-1/+4
| | | | | In `cmd.Cmd.do_help` call `inspect.cleandoc()`, to clean indentation and remove leading/trailing empty lines from a dosctring before printing.
* Document the `co_lines` method on code objects (#113682)Alex Waygood2024-01-036-12/+51
| | | Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* gh-113258: Write frozen modules to the build tree on Windows (GH-113303)Itamar Oren2024-01-035-56/+61
| | | This ensures the source directory is not modified at build time, and different builds (e.g. different versions or GIL vs no-GIL) do not have conflicts.
* gh-113603: Compiler no longer tries to maintain the no-empty-block invariant ↵Irit Katriel2024-01-033-78/+52
| | | | (#113636)
* gh-111926: Set up basic sementics of weakref API for freethreading (gh-113621)Donghee Na2024-01-031-19/+37
| | | | | --------- Co-authored-by: Sam Gross <colesbury@gmail.com>
* gh-101100: Fix Sphinx warnings for removed dead batteries (#113669)Hugo van Kemenade2024-01-0319-53/+53
| | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* `functools.partial` docs: Use the more common spelling for "referenceable" ↵Rodrigo Girão Serrão2024-01-031-1/+1
| | | | (#113675)
* gh-113637: Let c_annotations.py to handle the spacing of Limited/Unstable ↵Ege Akman2024-01-033-12/+14
| | | | API & Stable ABI translation strings (#113638)