Package: src:psygnal
Version: 0.15.1-4
User: [email protected]
Usertags: python3.15
Tags: patch, ftbfs, forky, sid
Severity: important

Hi!

While rebuilding the python related packages against the Python 3.15rc2
version we found that psygnal fails to build from source [1].

The error is: error: Argument 1 to "_fmt_locals" has incompatible type
"FrameLocalsProxyType | dict[str, Any]"; expected "dict[Any, Any]"
[arg-type]

The fix is to widen `_fmt_locals()` to `Mapping`

I've applied this in the sandbox [2] to verify that it builds
successfully, please consider applying the patch to support the upcoming
3.15 version.

Setting the severity to important for now. Once Python 3.15 is released,
it will be added to python3-defaults and this bug will become release
critical.

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/4644593/
[2]: https://debusine.debian.net/debian/r-python-python3.15/

--
"Can you imagine what I would do if I could do all I can?" -- Sun Tzu
Saludos /\/\ /\ >< `/
Description: widen _fmt_locals() parameter type to Mapping
Forwarded: no
Author: Maximiliano Curia <[email protected]>
Index: psygnal/src/psygnal/_exceptions.py
===================================================================
--- psygnal.orig/src/psygnal/_exceptions.py
+++ psygnal/src/psygnal/_exceptions.py
@@ -9,7 +9,7 @@ from typing import TYPE_CHECKING
 import psygnal
 
 if TYPE_CHECKING:
-    from collections.abc import Container, Sequence
+    from collections.abc import Container, Mapping, Sequence
 
     from ._signal import SignalInstance
 
@@ -116,7 +116,9 @@ def _fmt_frame(fi: inspect.FrameInfo, wi
 
 
 def _fmt_locals(
-    f_locals: dict, exclude: Container[str] = ("self", "cls"), name_width: int = 20
+    f_locals: Mapping,
+    exclude: Container[str] = ("self", "cls"),
+    name_width: int = 20,
 ) -> str:
     lines = []
     for name, value in f_locals.items():

Reply via email to