#1143300 django-dbbackup: FTBFS: dh_auto_test: error: pybuild --test -i python{version} -p "3.13 3.14" --system=custom --test-args="PYTHONPATH=. {interpreter} /usr/bin/django-admin test --settings=dbbackup.tests.settings dbbackup" --parallel=2 returned exit code 13

#1143300#5
Date:
2026-08-01 22:35:20 UTC
From:
To:
Dear maintainer:

During a rebuild of all packages in unstable, this package failed to build.

Below you will find the last part of the build log (probably the most
relevant part, but not necessarily). If required, the full build log
is available here:

https://people.debian.org/~sanvila/build-logs/202608/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you cannot reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:django-dbbackup, so that this is still
visible in the BTS web page for this package.

Thanks.
--------------------------------------------------------------------------------
[...]
 debian/rules clean
dh clean --buildsystem=pybuild
   dh_auto_clean -O--buildsystem=pybuild
I: pybuild base:385: python3.13 setup.py clean
/usr/lib/python3/dist-packages/setuptools/_distutils/dist.py:289: UserWarning: Unknown distribution option: 'tests_require'
  warnings.warn(msg)
/usr/lib/python3/dist-packages/setuptools/dist.py:759: SetuptoolsDeprecationWarning: License classifiers are deprecated.
!!

        ********************************************************************************
        Please consider removing the following classifiers in favor of a SPDX license expression:

        License :: OSI Approved :: BSD License

        See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.

[... snipped ...]

copying dbbackup/tests/testapp/blobs/test.txt.tar -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14_dbbackup/build/dbbackup/tests/testapp/blobs
creating /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14_dbbackup/build/dbbackup/tests/testapp/blobs/gpg
copying dbbackup/tests/testapp/blobs/gpg/pubring.gpg -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14_dbbackup/build/dbbackup/tests/testapp/blobs/gpg
copying dbbackup/tests/testapp/blobs/gpg/secring.gpg -> /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14_dbbackup/build/dbbackup/tests/testapp/blobs/gpg
   debian/rules override_dh_auto_test
make[1]: Entering directory '/<<PKGBUILDDIR>>'
dh_auto_test -- --system=custom --test-args="PYTHONPATH=. {interpreter} /usr/bin/django-admin test --settings=dbbackup.tests.settings dbbackup"
I: pybuild base:385: PYTHONPATH=. python3.13 /usr/bin/django-admin test --settings=dbbackup.tests.settings dbbackup
Creating test database for alias 'default'...
....INFO Quitting
INFO Quitting
INFO Quitting
...INFO Writing file to /tmp/foo.bak
.INFO Writing file to bar
.................ssssss........................................................................................./<<PKGBUILDDIR>>/dbbackup/db/sqlite.py:89: UserWarning: Error in db restore: UNIQUE constraint failed: django_migrations.id
  warnings.warn(f"Error in db restore: {err}")
/<<PKGBUILDDIR>>/dbbackup/db/sqlite.py:89: UserWarning: Error in db restore: index testapp_manytomanymodel_field_manytomanymodel_id_charmodel_id_69e4ee78_uniq already exists
  warnings.warn(f"Error in db restore: {err}")
/<<PKGBUILDDIR>>/dbbackup/db/sqlite.py:89: UserWarning: Error in db restore: UNIQUE constraint failed: testapp_textmodel.id
  warnings.warn(f"Error in db restore: {err}")
..ERROR Super msg
WARNING Super msg
.ERROR Super msg
................................ERROR Error sending data
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gnupg.py", line 166, in _copy_data
    outstream.write(data)
    ~~~~~~~~~~~~~~~^^^^^^
TypeError: a bytes-like object is required, not 'str'
E...ERROR Exception: Foo
  File "/<<PKGBUILDDIR>>/dbbackup/utils.py", line 119, in wrapper
    func(*args, **kwargs)
    ~~~~^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/dbbackup/tests/test_utils.py", line 82, in func
    raise Exception("Foo")

.ERROR Exception: Foo
  File "/<<PKGBUILDDIR>>/dbbackup/utils.py", line 119, in wrapper
    func(*args, **kwargs)
    ~~~~^^^^^^^^^^^^^^^^^
  File "/<<PKGBUILDDIR>>/dbbackup/tests/test_utils.py", line 92, in func
    raise Exception("Foo")

..ERROR Error sending data
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gnupg.py", line 166, in _copy_data
    outstream.write(data)
    ~~~~~~~~~~~~~~~^^^^^^
TypeError: a bytes-like object is required, not 'str'
E................sINFO Backing Up Database: file:memorydb_default?mode=memory&cache=shared
INFO Writing file to default-sbuild-2026-08-01-155350.dump.gz
.INFO Backing Up Database: file:memorydb_default?mode=memory&cache=shared
INFO Writing file to default-sbuild-2026-08-01-155350.dump.gz.gpg
.INFO Backing Up Database: file:memorydb_default?mode=memory&cache=shared
INFO Writing file to default-sbuild-2026-08-01-155350.dump
.INFO Backing Up Database: file:memorydb_default?mode=memory&cache=shared
INFO Writing file to default-sbuild-2026-08-01-155350.dump.gpg
.ssssssssINFO Writing file to sbuild-2026-08-01-155350.tar.gz
.INFO Writing file to sbuild-2026-08-01-155350.tar.gz.gpg
.INFO Writing file to sbuild-2026-08-01-155350.tar.gpg
.ssssss
======================================================================
ERROR: test_func (dbbackup.tests.test_utils.Compress_FileTest.test_func)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/dbbackup/tests/test_utils.py", line 152, in test_func
    compressed_file, filename = utils.encrypt_file(
                                ~~~~~~~~~~~~~~~~~~^
        inputfile=fd, filename="foo.txt"
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/<<PKGBUILDDIR>>/dbbackup/utils.py", line 181, in encrypt_file
    result = g.encrypt_file(
        inputfile,
    ...<2 lines>...
        always_trust=always_trust,
    )
  File "/usr/lib/python3/dist-packages/gnupg.py", line 2168, in encrypt_file
    self._handle_io(args, fileobj_or_path, result, passphrase=passphrase, binary=True)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/gnupg.py", line 1373, in _handle_io
    raise exc
  File "/usr/lib/python3/dist-packages/gnupg.py", line 166, in _copy_data
    outstream.write(data)
    ~~~~~~~~~~~~~~~^^^^^^
TypeError: a bytes-like object is required, not 'str'

======================================================================
ERROR: test_func (dbbackup.tests.test_utils.Encrypt_FileTest.test_func)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/<<PKGBUILDDIR>>/dbbackup/tests/test_utils.py", line 117, in test_func
    encrypted_file, filename = utils.encrypt_file(
                               ~~~~~~~~~~~~~~~~~~^
        inputfile=fd, filename="foo.txt"
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/<<PKGBUILDDIR>>/dbbackup/utils.py", line 181, in encrypt_file
    result = g.encrypt_file(
        inputfile,
    ...<2 lines>...
        always_trust=always_trust,
    )
  File "/usr/lib/python3/dist-packages/gnupg.py", line 2168, in encrypt_file
    self._handle_io(args, fileobj_or_path, result, passphrase=passphrase, binary=True)
    ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/gnupg.py", line 1373, in _handle_io
    raise exc
  File "/usr/lib/python3/dist-packages/gnupg.py", line 166, in _copy_data
    outstream.write(data)
    ~~~~~~~~~~~~~~~^^^^^^
TypeError: a bytes-like object is required, not 'str'
---------------------------------------------------------------------- Ran 201 tests in 0.240s FAILED (errors=2, skipped=21) Destroying test database for alias 'default'... Found 201 test(s). System check identified no issues (0 silenced). Name Datetime 2015-02-06-042810_foo.db 02/06/15 04:28:10 2015-02-06-042810_foo.db.gz 02/06/15 04:28:10 2015-02-06-042810_foo.db.gpg 02/06/15 04:28:10 2015-02-06-042810_foo.db.gz.gpg 02/06/15 04:28:10 2015-02-06-042810_foo.tar 02/06/15 04:28:10 2015-02-06-042810_foo.tar.gz 02/06/15 04:28:10 2015-02-06-042810_foo.tar.gpg 02/06/15 04:28:10 2015-02-06-042810_foo.tar.gz.gpg 02/06/15 04:28:10 2015-02-06-042810_bar.db 02/06/15 04:28:10 2015-02-06-042810_bar.db.gz 02/06/15 04:28:10 2015-02-06-042810_bar.db.gpg 02/06/15 04:28:10 2015-02-06-042810_bar.db.gz.gpg 02/06/15 04:28:10 2015-02-06-042810_bar.tar 02/06/15 04:28:10 2015-02-06-042810_bar.tar.gz 02/06/15 04:28:10 2015-02-06-042810_bar.tar.gpg 02/06/15 04:28:10 2015-02-06-042810_bar.tar.gz.gpg 02/06/15 04:28:10 E: pybuild pybuild:485: test: plugin custom failed with: exit code=1: PYTHONPATH=. python3.13 /usr/bin/django-admin test --settings=dbbackup.tests.settings dbbackup I: pybuild base:385: PYTHONPATH=. python3.14 /usr/bin/django-admin test --settings=dbbackup.tests.settings dbbackup Creating test database for alias 'default'... ....INFO Quitting INFO Quitting INFO Quitting ...INFO Writing file to /tmp/foo.bak .INFO Writing file to bar .................ssssss........................................................................................./<<PKGBUILDDIR>>/dbbackup/db/sqlite.py:89: UserWarning: Error in db restore: UNIQUE constraint failed: django_migrations.id warnings.warn(f"Error in db restore: {err}") /<<PKGBUILDDIR>>/dbbackup/db/sqlite.py:89: UserWarning: Error in db restore: index testapp_manytomanymodel_field_manytomanymodel_id_charmodel_id_69e4ee78_uniq already exists warnings.warn(f"Error in db restore: {err}") /<<PKGBUILDDIR>>/dbbackup/db/sqlite.py:89: UserWarning: Error in db restore: UNIQUE constraint failed: testapp_textmodel.id warnings.warn(f"Error in db restore: {err}") ..ERROR Super msg WARNING Super msg .ERROR Super msg ................................ERROR Error sending data Traceback (most recent call last): File "/usr/lib/python3/dist-packages/gnupg.py", line 166, in _copy_data outstream.write(data) ~~~~~~~~~~~~~~~^^^^^^ TypeError: a bytes-like object is required, not 'str' E...ERROR Exception: Foo File "/<<PKGBUILDDIR>>/dbbackup/utils.py", line 119, in wrapper func(*args, **kwargs) ~~~~^^^^^^^^^^^^^^^^^ File "/<<PKGBUILDDIR>>/dbbackup/tests/test_utils.py", line 82, in func raise Exception("Foo") .ERROR Exception: Foo File "/<<PKGBUILDDIR>>/dbbackup/utils.py", line 119, in wrapper func(*args, **kwargs) ~~~~^^^^^^^^^^^^^^^^^ File "/<<PKGBUILDDIR>>/dbbackup/tests/test_utils.py", line 92, in func raise Exception("Foo") ..ERROR Error sending data Traceback (most recent call last): File "/usr/lib/python3/dist-packages/gnupg.py", line 166, in _copy_data outstream.write(data) ~~~~~~~~~~~~~~~^^^^^^ TypeError: a bytes-like object is required, not 'str' E................sINFO Backing Up Database: file:memorydb_default?mode=memory&cache=shared INFO Writing file to default-sbuild-2026-08-01-155351.dump.gz .INFO Backing Up Database: file:memorydb_default?mode=memory&cache=shared INFO Writing file to default-sbuild-2026-08-01-155351.dump.gz.gpg .INFO Backing Up Database: file:memorydb_default?mode=memory&cache=shared INFO Writing file to default-sbuild-2026-08-01-155351.dump .INFO Backing Up Database: file:memorydb_default?mode=memory&cache=shared INFO Writing file to default-sbuild-2026-08-01-155351.dump.gpg .ssssssssINFO Writing file to sbuild-2026-08-01-155351.tar.gz .INFO Writing file to sbuild-2026-08-01-155351.tar.gz.gpg .INFO Writing file to sbuild-2026-08-01-155351.tar.gpg .ssssss ====================================================================== ERROR: test_func (dbbackup.tests.test_utils.Compress_FileTest.test_func) ---------------------------------------------------------------------- Traceback (most recent call last): File "/<<PKGBUILDDIR>>/dbbackup/tests/test_utils.py", line 152, in test_func compressed_file, filename = utils.encrypt_file( ~~~~~~~~~~~~~~~~~~^ inputfile=fd, filename="foo.txt" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/<<PKGBUILDDIR>>/dbbackup/utils.py", line 181, in encrypt_file result = g.encrypt_file( inputfile, ...<2 lines>... always_trust=always_trust, ) File "/usr/lib/python3/dist-packages/gnupg.py", line 2168, in encrypt_file self._handle_io(args, fileobj_or_path, result, passphrase=passphrase, binary=True) ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/gnupg.py", line 1373, in _handle_io raise exc File "/usr/lib/python3/dist-packages/gnupg.py", line 166, in _copy_data outstream.write(data) ~~~~~~~~~~~~~~~^^^^^^ TypeError: a bytes-like object is required, not 'str' ====================================================================== ERROR: test_func (dbbackup.tests.test_utils.Encrypt_FileTest.test_func) ---------------------------------------------------------------------- Traceback (most recent call last): File "/<<PKGBUILDDIR>>/dbbackup/tests/test_utils.py", line 117, in test_func encrypted_file, filename = utils.encrypt_file( ~~~~~~~~~~~~~~~~~~^ inputfile=fd, filename="foo.txt" ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ File "/<<PKGBUILDDIR>>/dbbackup/utils.py", line 181, in encrypt_file result = g.encrypt_file( inputfile, ...<2 lines>... always_trust=always_trust, ) File "/usr/lib/python3/dist-packages/gnupg.py", line 2168, in encrypt_file self._handle_io(args, fileobj_or_path, result, passphrase=passphrase, binary=True) ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3/dist-packages/gnupg.py", line 1373, in _handle_io raise exc File "/usr/lib/python3/dist-packages/gnupg.py", line 166, in _copy_data outstream.write(data) ~~~~~~~~~~~~~~~^^^^^^ TypeError: a bytes-like object is required, not 'str'
---------------------------------------------------------------------- Ran 201 tests in 0.238s FAILED (errors=2, skipped=21) Destroying test database for alias 'default'... Found 201 test(s). System check identified no issues (0 silenced). Name Datetime 2015-02-06-042810_foo.db 02/06/15 04:28:10 2015-02-06-042810_foo.db.gz 02/06/15 04:28:10 2015-02-06-042810_foo.db.gpg 02/06/15 04:28:10 2015-02-06-042810_foo.db.gz.gpg 02/06/15 04:28:10 2015-02-06-042810_foo.tar 02/06/15 04:28:10 2015-02-06-042810_foo.tar.gz 02/06/15 04:28:10 2015-02-06-042810_foo.tar.gpg 02/06/15 04:28:10 2015-02-06-042810_foo.tar.gz.gpg 02/06/15 04:28:10 2015-02-06-042810_bar.db 02/06/15 04:28:10 2015-02-06-042810_bar.db.gz 02/06/15 04:28:10 2015-02-06-042810_bar.db.gpg 02/06/15 04:28:10 2015-02-06-042810_bar.db.gz.gpg 02/06/15 04:28:10 2015-02-06-042810_bar.tar 02/06/15 04:28:10 2015-02-06-042810_bar.tar.gz 02/06/15 04:28:10 2015-02-06-042810_bar.tar.gpg 02/06/15 04:28:10 2015-02-06-042810_bar.tar.gz.gpg 02/06/15 04:28:10 E: pybuild pybuild:485: test: plugin custom failed with: exit code=1: PYTHONPATH=. python3.14 /usr/bin/django-admin test --settings=dbbackup.tests.settings dbbackup dh_auto_test: error: pybuild --test -i python{version} -p "3.13 3.14" --system=custom --test-args="PYTHONPATH=. {interpreter} /usr/bin/django-admin test --settings=dbbackup.tests.settings dbbackup" --parallel=2 returned exit code 13 make[1]: *** [debian/rules:10: override_dh_auto_test] Error 25 make[1]: Leaving directory '/<<PKGBUILDDIR>>' make: *** [debian/rules:6: binary] Error 2 dpkg-buildpackage: error: debian/rules binary subprocess failed with exit status 2 --------------------------------------------------------------------------------