Package: src:python-fissix
Version: 24.4.24-4
User: [email protected]
Usertags: python3.15
Tags: patch, ftbfs, forky, sid
Hi!
While rebuilding the python related packages against the Python 3.15rc1
version we found that python-fissix fails to build from source [1].
It fails with the DeprecationWarning: os.path.commonprefix() is
deprecated. Use os.path.commonpath() for longest path prefix.
As the error message suggests, the fix is to replace commonprefix for
commonpath.
I applied the fix in the sandbox [2] to be able to build the packages
that depend on python-fissix, 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/4431487/
[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: Replace deprecated os.path.commonprefix with os.path.commonpath
Author: Maximiliano Curia <[email protected]>
--- a/fissix/main.py
+++ b/fissix/main.py
@@ -295,15 +295,16 @@ def main(fixer_pkg, args=None):
else:
requested = avail_fixes.union(explicit)
fixer_names = requested.difference(unwanted_fixes)
- input_base_dir = os.path.commonprefix(args)
+ try:
+ input_base_dir = os.path.commonpath(args)
+ except ValueError:
+ input_base_dir = ""
if (
input_base_dir
and not input_base_dir.endswith(os.sep)
and not os.path.isdir(input_base_dir)
):
# One or more similar names were passed, their directory is the base.
- # os.path.commonprefix() is ignorant of path elements, this corrects
- # for that weird API.
input_base_dir = os.path.dirname(input_base_dir)
if options.output_dir:
input_base_dir = input_base_dir.rstrip(os.sep)