Package: src:sphinx-toolbox
Version: 4.3.0-1
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 sphinx-toolbox fails to build from source [1].
It fails with the following error: ModuleNotFoundError: No module named
'sre_parse'. Did you mean: 'argparse'?
This is because sre_parse was deprecated in python 3.11, and removed in
python 3.15.
I've added a patch that uses re._parser and re._constants instead. And
applied the fix in the sandbox [2], to be able to build the packages
that depend on sphinx-toolbox, 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/4545233/
[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 /\/\ /\ >< `/
From: Maximiliano Curia <[email protected]>
Date: Sun, 6 Sep 2026 14:33:12 +0200
Subject: Support Python 3.15
---
sphinx_toolbox/more_autodoc/regex.py | 80 ++++++++++++++++++++++++------------
1 file changed, 54 insertions(+), 26 deletions(-)
diff --git a/sphinx_toolbox/more_autodoc/regex.py b/sphinx_toolbox/more_autodoc/regex.py
index 675e7cd..0fd92d5 100644
--- a/sphinx_toolbox/more_autodoc/regex.py
+++ b/sphinx_toolbox/more_autodoc/regex.py
@@ -111,32 +111,60 @@ Usage
# stdlib
import itertools
import re
-import sre_parse
-from sre_constants import (
- ANY,
- AT,
- AT_BEGINNING,
- AT_BEGINNING_STRING,
- AT_BOUNDARY,
- AT_END,
- AT_END_STRING,
- AT_NON_BOUNDARY,
- BRANCH,
- CATEGORY,
- CATEGORY_DIGIT,
- CATEGORY_NOT_DIGIT,
- CATEGORY_NOT_SPACE,
- CATEGORY_NOT_WORD,
- CATEGORY_SPACE,
- CATEGORY_WORD,
- IN,
- LITERAL,
- MAX_REPEAT,
- MAXREPEAT,
- MIN_REPEAT,
- RANGE,
- SUBPATTERN
- )
+try:
+ import sre_parse
+ from sre_constants import (
+ ANY,
+ AT,
+ AT_BEGINNING,
+ AT_BEGINNING_STRING,
+ AT_BOUNDARY,
+ AT_END,
+ AT_END_STRING,
+ AT_NON_BOUNDARY,
+ BRANCH,
+ CATEGORY,
+ CATEGORY_DIGIT,
+ CATEGORY_NOT_DIGIT,
+ CATEGORY_NOT_SPACE,
+ CATEGORY_NOT_WORD,
+ CATEGORY_SPACE,
+ CATEGORY_WORD,
+ IN,
+ LITERAL,
+ MAX_REPEAT,
+ MAXREPEAT,
+ MIN_REPEAT,
+ RANGE,
+ SUBPATTERN
+ )
+except ImportError:
+ import re._parser as sre_parse # type: ignore[no-redef]
+ from re._constants import ( # type: ignore[no-redef]
+ ANY,
+ AT,
+ AT_BEGINNING,
+ AT_BEGINNING_STRING,
+ AT_BOUNDARY,
+ AT_END,
+ AT_END_STRING,
+ AT_NON_BOUNDARY,
+ BRANCH,
+ CATEGORY,
+ CATEGORY_DIGIT,
+ CATEGORY_NOT_DIGIT,
+ CATEGORY_NOT_SPACE,
+ CATEGORY_NOT_WORD,
+ CATEGORY_SPACE,
+ CATEGORY_WORD,
+ IN,
+ LITERAL,
+ MAX_REPEAT,
+ MAXREPEAT,
+ MIN_REPEAT,
+ RANGE,
+ SUBPATTERN
+ )
from textwrap import dedent
from typing import Any, Callable, List, Optional, Pattern, Tuple