#1094336 dput: backtrace for "uploading ... to ... not allowed"

Package:
dput
Source:
dput
Submitter:
Chris Hofstaedtler
Date:
2025-01-27 10:36:03 UTC
Severity:
normal
#1094336#5
Date:
2025-01-27 10:32:07 UTC
From:
To:
Hi,

dput currently prints a distracting backtrace (with colors and some parts in
bold) when an upload to a host is not allowed because a distribution name
mismatch.

It'd be better if it printed the error message and no backtrace.

Example output:


% dput pdns-recursor_4.8.8-1+deb12u1_source.changes
Trying to upload package to ssh-upload
Checking signature on .changes
gpg: /home/ch/Debian/pdns-recursor_4.8.8-1+deb12u1_source.changes: Valid signature from 5C13D6DB93052E03
Checking signature on .dsc
gpg: /home/ch/Debian/pdns-recursor_4.8.8-1+deb12u1.dsc: Valid signature from 5C13D6DB93052E03
Traceback (most recent call last):
  File "/usr/bin/dput", line 33, in <module>
    sys.exit(load_entry_point('dput==1.2.4', 'console_scripts', 'execute-dput')())
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/share/dput/dput/dput.py", line 1530, in main
    files_to_upload = verify_files(
            changes_file_directory, changes_file_name, host,
    ...<3 lines>...
            options.allow_unsigned_uploads,
            options.debug)
  File "/usr/share/dput/dput/dput.py", line 438, in verify_files
    raise dputhelper.DputUploadFatalException((
    ...<2 lines>...
            ).format(**vars()))
dput.helper.dputhelper.DputUploadFatalException: Error: uploading files for distribution bookworm-security to ssh-upload not allowed.

(Note that "dput.helper.dputhelper.DputUploadFatalException" is in bold purple,
various parts of the backtrace are in red, etc.)

I would have expected it to look like this:

% dput pdns-recursor_4.8.8-1+deb12u1_source.changes
Trying to upload package to ssh-upload
Checking signature on .changes
gpg: /home/ch/Debian/pdns-recursor_4.8.8-1+deb12u1_source.changes: Valid signature from 5C13D6DB93052E03
Checking signature on .dsc
gpg: /home/ch/Debian/pdns-recursor_4.8.8-1+deb12u1.dsc: Valid signature from 5C13D6DB93052E03
Error: uploading files for distribution bookworm-security to ssh-upload not allowed.


Thanks,
Chris