[Bug 1990562] [NEW] attempting to diff static library files raises UnicodeDecodeError

Launchpad Bug Tracker 1990562 at bugs.launchpad.net
Thu Sep 22 17:54:04 UTC 2022


You have been subscribed to a public bug by Nick Rosbrook (enr0n):

In verbose mode, if files differ in share_files(), dhpython will try to
show a diff of the files. When these files are static libraries, this
raises a UnicodeDecodeError. For example, from a recent numpy build on
arm64[1]:

W: dh_python3 fs:146: Paths differ: debian/python3-numpy/usr/lib/python3.10/dist-packages/numpy/random/lib/libnpyrandom.a and debian/python3-numpy/usr/lib/python3/dist-packages/numpy/random/lib/libnpyrandom.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 0xf6 in position 75: invalid start byte
make[1]: *** [debian/rules:46: override_dh_python3] Error 1
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
make: *** [debian/rules:15: binary-arch] Error 2
dpkg-buildpackage: error: fakeroot debian/rules binary-arch subprocess returned exit status 2

There is already logic to skip this diff for .so files, so the same
should be done for .a files.

[1] https://launchpadlibrarian.net/624822201/buildlog_ubuntu-kinetic-
arm64.numpy_1%3A1.21.5-1build2_BUILDING.txt.gz

** Affects: dh-python (Ubuntu)
     Importance: Medium
         Status: Confirmed

-- 
attempting to diff static library files raises UnicodeDecodeError
https://bugs.launchpad.net/bugs/1990562
You received this bug notification because you are a member of Ubuntu Sponsors Team, which is subscribed to the bug report.



More information about the Ubuntu-sponsors mailing list