Package: src:pyxdg
Version: 0.28-3 User: [email protected]
Usertags: python3.15
Tags: patch

Hi!

While rebuilding the python related packages against the Python 3.15rc1
version we found that pyxdg fails to build from source [1].
The upstream repository recently applied a fix that solves this problem
[2].

I applied the upstream fix in the sandbox [3] to be able to build the
packages that depend on pyxdg, please consider applying the patch to
support the upcoming 3.15 version.

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/artifact/4341416/
[2]: 
https://gitlab.freedesktop.org/xdg/pyxdg/-/commit/63033ac306aa26d32e1439417e59ae8f8a4c9820
[3]: 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 /\/\ /\ >< `/
From 63033ac306aa26d32e1439417e59ae8f8a4c9820 Mon Sep 17 00:00:00 2001
From: Sam James <[email protected]>
Date: Sat, 31 May 2025 18:54:51 +0100
Subject: [PATCH] Menu: handle Python 3.15 deprecations

* Unknown keyword args will be fatal, so drop lineno/col_offset that
  is unused
* Set body= immediately as a keyword
---
 xdg/Menu.py | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/xdg/Menu.py b/xdg/Menu.py
index 71f5e61..8e1595c 100644
--- a/xdg/Menu.py
+++ b/xdg/Menu.py
@@ -419,7 +419,6 @@ class Rule:
                     ctx=ast.Load()
                 )]
             ),
-            lineno=1, col_offset=0
         )
         ast.fix_missing_locations(tree)
         rule = Rule(type, tree)
@@ -763,12 +762,10 @@ class XMLMenuBuilder(object):
 
     def parse_rule(self, node):
         type = Rule.TYPE_INCLUDE if node.tag == 'Include' else Rule.TYPE_EXCLUDE
-        tree = ast.Expression(lineno=1, col_offset=0)
+        tree = ast.Expression(body=_ast_const('False'))
         expr = self.parse_bool_op(node, ast.Or())
         if expr:
             tree.body = expr
-        else:
-            tree.body = _ast_const('False')
         ast.fix_missing_locations(tree)
         return Rule(type, tree)
 
-- 
GitLab

Reply via email to