| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
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.
|
|
|
|
| |
eval breaker (#113721)
|
|
|
|
| |
cmp (#113656)
|
|
|
| |
Add support for loading XML plists from a string value instead of a only bytes value.
|
|
|
|
|
| |
(#113731)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
It can only be a dict since Python 2.4.
|
|
|
| |
Explicitly open and close files instead of using FileType.
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
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
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
|
|
|
|
| |
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
|
|
| |
Co-authored-by: Xavier de Gaye <xdegaye@gmail.com>
|
|
|
|
|
| |
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
|
|
|
|
| |
(#113709)
|
|
|
|
| |
classes. (GH-113680)
|
|
|
|
|
|
|
| |
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
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'
|
|
|
|
| |
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`.
|
|
|
|
| |
cancelled (#113690)
|
| |
|
|
|
|
| |
returning a strong reference (#113697)
|
| |
|
|
|
|
|
| |
In `cmd.Cmd.do_help` call `inspect.cleandoc()`,
to clean indentation and remove leading/trailing empty
lines from a dosctring before printing.
|
|
|
| |
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
|
|
|
| |
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.
|
|
|
|
| |
(#113636)
|
|
|
|
|
| |
---------
Co-authored-by: Sam Gross <colesbury@gmail.com>
|
|
|
|
| |
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
|
|
|
| |
(#113675)
|
|
|
|
| |
API & Stable ABI translation strings (#113638)
|
| |
|
| |
|
| |
|
|
|
|
|
| |
builds. (GH-113298)
Co-authored-by: Ned Deily <nad@python.org>
|
|
|
|
| |
(GH-113645)
|
|
|
|
| |
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
|
|
|
| |
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
|
|
|
|
|
| |
_tkinter.c (GH-112893)
Fix undefined behavior warnings (UBSan -fsanitize=function).
|
|
|
|
|
| |
dictobject.c (#112892)
Fix undefined behavior warnings (UBSan -fsanitize=function).
|
|
|
|
|
|
|
|
|
|
| |
descrobject.c (GH-112861)
Fix undefined behavior warnings (UBSan -fsanitize=function), for example:
Python/generated_cases.c.h:3315:13: runtime error: call to function mappingproxy_dealloc through pointer to incorrect function type 'void (*)(struct _object *)'
descrobject.c:1160: note: mappingproxy_dealloc defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Python/generated_cases.c.h:3315:13 in
|
|
|
|
|
|
|
|
|
|
| |
listobject.c (GH-112820)
Fix undefined behavior warnings (UBSan -fsanitize=function), for example:
Objects/object.c:674:11: runtime error: call to function list_repr through pointer to incorrect function type 'struct _object *(*)(struct _object *)'
listobject.c:382: note: list_repr defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Objects/object.c:674:11 in
|
|
|
| |
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
|
|
|
|
| |
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
|
|
|
|
| |
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
| |
|
|
|
| |
Use module state structure for _testcapi.
|
|
|
|
|
|
|
| |
* gh-53502: Fixes for tests in gh-113363
* Use 32-bit compatible date in test_dump_naive_datetime_with_aware_datetime_option
* Saving non-aware datetimes will use the old behaviour regardless of the aware_datimetime setting
|
|
|
|
|
|
| |
aware datetime. (#113363)
* add options to loads and dumps aware datetime in plistlib
|