attempting to diff static library files raises UnicodeDecodeError

Bug #1990562 reported by Nick Rosbrook
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dh-python (Debian)
Fix Released
Unknown
dh-python (Ubuntu)
Fix Released
Medium
Unassigned
numpy (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

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

Tags: ftbfs
Revision history for this message
Nick Rosbrook (enr0n) wrote :
Changed in dh-python (Ubuntu):
importance: Undecided → Medium
status: New → In Progress
assignee: nobody → Nick Rosbrook (enr0n)
Nick Rosbrook (enr0n)
Changed in dh-python (Ubuntu):
status: In Progress → Confirmed
assignee: Nick Rosbrook (enr0n) → nobody
Changed in dh-python (Debian):
status: Unknown → New
Changed in dh-python (Debian):
status: New → Fix Released
Graham Inggs (ginggs)
tags: added: ftbfs
Revision history for this message
Stefano Rivera (stefanor) wrote :

This bug was fixed in the package dh-python - 5.20220923

---------------
dh-python (5.20220923) unstable; urgency=medium

  [ Stefano Rivera ]
  * Run Python test suite with nose2. (closes: 1018338)
  * Don't attempt to diff static libs (.a), thanks Nick Rosbrook.
    (closes: 1020528)

  [ Debian Janitor ]
  * Bump debhelper from old 12 to 13.
    + Drop check for DEB_BUILD_OPTIONS containing "nocheck", since debhelper now
      does this.
  * Remove constraints unnecessary since buster (oldstable):
    + dh-python: Drop versioned constraint on python3 in Replaces.

  [ Stuart Prescott ]
  * pyproject plugin: Make the package's entry points available in the PATH
    when running the package's test suite, so that tests using the entry
    points can be run.

 -- Stefano Rivera <email address hidden> Fri, 23 Sep 2022 09:47:57 +0200

Changed in dh-python (Ubuntu):
status: Confirmed → Fix Released
Revision history for this message
Graham Inggs (ginggs) wrote :
Changed in numpy (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.