Skip to content

[pull] master from pythonnet:master#1

Open
pull[bot] wants to merge 1119 commits into
vvolis:masterfrom
pythonnet:master
Open

[pull] master from pythonnet:master#1
pull[bot] wants to merge 1119 commits into
vvolis:masterfrom
pythonnet:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented Jan 11, 2021

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull Bot added ⤵️ pull merge-conflict Resolve conflicts manually labels Jan 11, 2021
filmor and others added 28 commits July 11, 2022 16:55
Fixed a leak in `NewReference.Move`
also fixed issues with xml docs in the code

implements #1876
There are small typos in:
- pythonnet/__init__.py
- tests/test_import.py

Fixes:
- Should read `splitted` rather than `splited`.
- Should read `loaded` rather than `laoded`.

Signed-off-by: Tim Gates <tim.gates@iress.com>
…ng sequence protocol to (#1902)

.NET arrays when the target .NET type is `System.Object`. The conversion is still attempted when the
target type is a `System.Array`

fixes #1900
- Supports loading without explicitly specifying the runtime config now
- Exposes information on the loaded runtime
Config-less CoreCLR and improved runtime load message
Implicit float conversion in function calls
filmor and others added 30 commits April 18, 2026 19:56
* Use uss instead of rss to get more precise memory readings

* Rework memory usage tracking to use .NET and Python memory tracing

* Use 75% threshold in all cases

* Up to 90% :(
Bumps [actions/upload-pages-artifact](https://github.com/actions/upload-pages-artifact) from 4 to 5.
- [Release notes](https://github.com/actions/upload-pages-artifact/releases)
- [Commits](actions/upload-pages-artifact@v4...v5)

---
updated-dependencies:
- dependency-name: actions/upload-pages-artifact
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Updates the requirements on [furo](https://github.com/pradyunsg/furo) to permit the latest version.
- [Release notes](https://github.com/pradyunsg/furo/releases)
- [Changelog](https://github.com/pradyunsg/furo/blob/main/docs/changelog.md)
- [Commits](pradyunsg/furo@2022.09.15...2025.12.19)

---
updated-dependencies:
- dependency-name: furo
  dependency-version: 2025.12.19
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Adjust test_import to always trigger error-case
* Ensure that names are added to __all__ exactly once
* Add context manager protocol for .NET IDisposable types

---------

Co-authored-by: den-run-ai <macmone@Deniss-Air.hsd1.ca.comcast.net>
Co-authored-by: Benedikt Reinartz <filmor@gmail.com>
* Fix MethodBinding/OverloadMapper memory leak (#691)

MethodBinding and OverloadMapper held PyObject `target` references that
were not disposed during tp_clear, leaving Python-side refcount drops to
wait on the multi-hop .NET finalizer chain. They also shared the same
C# PyObject instance across mp_subscript/Overloads paths, so freeing one
could free the underlying Python object out from under the others.

- ExtensionType: add virtual OnClear() hook called from tp_clear before
  the GCHandle is released, letting subclasses eagerly drop owned
  Python references.
- MethodBinding/OverloadMapper: override OnClear to dispose `target`.
  (`targetType` is intentionally not disposed since Python types are
  long-lived and tracked by other caches.)
- Take an independent INCREF'd PyObject copy at every site that hands a
  shared target into a new MethodBinding or OverloadMapper, so each
  wrapper owns its own reference.

Result: the three _does_not_leak_memory tests drop from ~485 MB delta
to ~10 KB delta on Python 3.14.

* Tighten leak-test threshold to 10% to actually fail the bug

The previous 90% threshold (0.9 MB/iter against a 1 MB allocation)
documented the issue but did not reproduce it: master leaks
~600-765 KB/iter, which the 0.9 MB threshold accepts as passing.

Drop the threshold to 10% (104 KB/iter). On the 2026-05-09 verification
run with Python 3.14 GIL on linux-aarch64:

  Without fix (master):   ~572-765 KB/iter (FAIL)
  With fix (this branch): ~-500 B/iter     (PASS)

Margin is roughly 6x in either direction across .NET 8 and .NET 10, so
the threshold cleanly separates buggy from fixed states without being
sensitive to GC noise.

* Bugfix and improvements

- Handle the `PyType` reference in `OverloadMapper` and `MethodBinding` in the
  same way as the object reference
- Unconditionally store the `PyType` of the object
- Introduce `NewReference` helper function for the object and type
  passing
- Fix the remaining missing reference count bump for the type
  (`MethodObject`)
- As the count is now correct, `Dispose` the type as well

---------

Co-authored-by: Benedikt Reinartz <filmor@gmail.com>
…2723)

Bumps the uv group with 1 update in the / directory: [urllib3](https://github.com/urllib3/urllib3).


Updates `urllib3` from 2.6.3 to 2.7.0
- [Release notes](https://github.com/urllib3/urllib3/releases)
- [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst)
- [Commits](urllib3/urllib3@2.6.3...2.7.0)

---
updated-dependencies:
- dependency-name: urllib3
  dependency-version: 2.7.0
  dependency-type: indirect
  dependency-group: uv
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
* Update NUnit

* Drop some obsolete comments and reenable some tests
- Catch exceptions in TrySet/DeleteMember
- Convert the exceptions into Python exceptions
- Add tests for the remaining cases
- Add a note on why the field has to be lazily initialized (general
  issue with derived classes)
The dynamic getter swallowed any exception from TryGetMember and
returned default to Python with the prior AttributeError still set,
so user code observed a misleading AttributeError instead of the real
failure.

Set a Python exception in the catch arm. We use RuntimeError with the
message string rather than Converter.ToPython(e) because wrapping the
CLR exception object can trigger type initialisation that re-enters
this same slot on the live dynamic object, producing infinite
recursion.

Mirrors the symmetry already present in the setter (#2706 review,
@lostmsu) and adds a regression test alongside the existing
ThrowingSetDynamicObject coverage.
- Cache HasClrMember reflection per (Type, name) so tp_getattro_dlr_proxy
  / tp_setattro_dlr_proxy avoid repeated GetMember() calls on every
  attribute access of DLR-aware objects.

- Mirror tp_setattro_dlr_proxy's catch arm to the getter's safer
  SetError(RuntimeError, e.Message) shape instead of SetError(Exception),
  keeping both slots re-entry-safe on live dynamic objects.

Related to #2706.
Implement support for DLR get/set
Bump idna from 3.13 to 3.15 in the uv group across 1 directory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⤵️ pull merge-conflict Resolve conflicts manually

Projects

None yet

Development

Successfully merging this pull request may close these issues.