Package: dh python
Version: 5.20220819
I am curently in the process of trying to fix numpy in raspbian bookworm.
Which had become uninstallable due to a dependency on libpython3.9. To
avoid a build-dependency loop, the first step of that process was doing
a build of numpy with nodoc and nocheck
While doing so I ran into the following error.
W: dh_python3 fs:146: Paths differ:
debian/python3-numpy/usr/lib/python3.10/dist-packages/numpy/core/lib/libnpymath.a
and
debian/python3-numpy/usr/lib/python3/dist-packages/numpy/core/lib/libnpymath.a
Traceback (most recent call last):
File "/usr/bin/dh_python3", line 284, in <module>
main()
File "/usr/bin/dh_python3", line 210, in main
fix_locations(package, interpreter, SUPPORTED, options)
File "/usr/share/dh-python/dhpython/fs.py", line 53, in fix_locations
share_files(srcdir, dstdir, interpreter, options)
File "/usr/share/dh-python/dhpython/fs.py", line 127, in share_files
share_files(fpath1, fpath2, interpreter, options)
File "/usr/share/dh-python/dhpython/fs.py", line 127, in share_files
share_files(fpath1, fpath2, interpreter, options)
File "/usr/share/dh-python/dhpython/fs.py", line 127, in share_files
share_files(fpath1, fpath2, interpreter, options)
File "/usr/share/dh-python/dhpython/fs.py", line 149, in share_files
fromlines = fp1.readlines()
File "/usr/lib/python3.10/codecs.py", line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd0 in position 75:
invalid continuation byte
Reading the code, this is clearly caused by applying diff code that
assumes text, presumablly in the encoding from the current locale
to arbitrary files, there is already code to exclude .so files from
the diff, but other files will be treated as text causing
dh-python
As a quick fix so I could proceed with what I'm doing I made it also
exclude .a files from the diffing, but throwing a text differ at arbitrary
files of arbitrary size does not seem a great idea to me.
Debdiff for the quick fix is attatched.
diff -Nru dh-python-5.20220819/debian/changelog
dh-python-5.20220819+rpi1/debian/changelog
--- dh-python-5.20220819/debian/changelog 2022-08-19 21:34:55.000000000
+0100
+++ dh-python-5.20220819+rpi1/debian/changelog 2022-08-25 21:47:15.000000000
+0100
@@ -1,3 +1,9 @@
+dh-python (5.20220819+rpi1) bookworm-staging; urgency=medium
+
+ * Don't attempt to diff .a files.
+
+ -- Peter Michael Green <[email protected]> Thu, 25 Aug 2022 20:47:15
+0000
+
dh-python (5.20220819) unstable; urgency=medium
* flit plugin: Explicitly install using the "deb_system" sysconfig scheme.
diff -Nru dh-python-5.20220819/dhpython/fs.py
dh-python-5.20220819+rpi1/dhpython/fs.py
--- dh-python-5.20220819/dhpython/fs.py 2022-08-19 21:34:55.000000000 +0100
+++ dh-python-5.20220819+rpi1/dhpython/fs.py 2022-08-25 21:46:56.000000000
+0100
@@ -144,7 +144,7 @@
else:
# The files differed so we cannot collapse them.
log.warn('Paths differ: %s and %s', fpath1, fpath2)
- if options.verbose and not i.endswith('.so'):
+ if options.verbose and not i.endswith('.so') and not
i.endswith('.a'):
with open(fpath1) as fp1:
fromlines = fp1.readlines()
with open(fpath2) as fp2: