Your message dated Fri, 25 Nov 2022 17:11:14 +0200
with message-id <20221125151114.georz4f4oht4y...@haydn.kardiogramm.net>
and subject line Re: Bug#1018150: dh-python3 crashes on attempting to diff 
files that are not valid utf-8.
has caused the Debian Bug report #1018150,
regarding dh-python3 crashes on attempting to diff files that are not valid 
utf-8.
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
1018150: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1018150
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
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 <plugw...@raspbian.org>  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:

--- End Message ---
--- Begin Message ---
Version: 5.20220923

This is a dup of bug #1020528, and already fixed.

Thanks for the report, pity it was misfiled and not seen sooner.

SR

-- 
Stefano Rivera
  http://tumbleweed.org.za/
  +1 415 683 3272

--- End Message ---

Reply via email to