Package: reportbug
Version: 6.6.6
Severity: minor
Tags: patch

Dear Maintainer,

reportbug exits with an uncatched exception and cryptic error when using
--draft= option with a non existing directory. 

$ reportbug --draft=/tmp/non-existing
  Traceback (most recent call last):
      File "/usr/bin/reportbug", line 2247, in <module>
      File "/usr/bin/reportbug", line 1062, in main
          print "The directory % does not exist; exiting." % options.draftpath
  TypeError: %d format: a number is required, not str

This is due to an error in format string.

The attached patch fixes the issue.

-- Package-specific info:
** Environment settings:

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.3.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=it_IT.UTF-8, LC_CTYPE=it_IT.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages reportbug depends on:
ii  apt               1.2.3
ii  python-reportbug  6.6.6
pn  python:any        <none>

reportbug recommends no packages.

Versions of packages reportbug suggests:
pn  claws-mail                         <none>
pn  debconf-utils                      <none>
pn  debsums                            <none>
pn  dlocate                            <none>
ii  emacs24-bin-common                 24.5+1-6+b1
ii  file                               1:5.25-2
ii  gnupg                              1.4.20-4
ii  nullmailer [mail-transport-agent]  1:1.13-1+b1
ii  python-gtk2                        2.24.0-4
pn  python-gtkspellcheck               <none>
pn  python-urwid                       <none>
pn  python-vte                         <none>
ii  xdg-utils                          1.1.1-1

Versions of packages python-reportbug depends on:
ii  apt               1.2.3
ii  file              1:5.25-2
ii  python-debian     0.1.27
ii  python-debianbts  2.6.0
pn  python:any        <none>

python-reportbug suggests no packages.

-- no debconf information
>From b48cb41ffa0c273d68956a874770b7b3e075e253 Mon Sep 17 00:00:00 2001
From: Gaetano Guerriero <>
Date: Tue, 1 Mar 2016 11:06:30 +0100
Subject: [PATCH] --draft= with missing directory was failing badly

 bin/reportbug | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/reportbug b/bin/reportbug
index 9b85860..4bbf57a 100755
--- a/bin/reportbug
+++ b/bin/reportbug
@@ -1059,7 +1059,7 @@ def main():
     if options.draftpath:
         options.draftpath = os.path.expanduser(options.draftpath)
         if not os.path.exists(options.draftpath):
-            print "The directory % does not exist; exiting." % options.draftpath
+            ewrite("The directory %s does not exist; exiting.\n" % options.draftpath)
     if options.mua and not options.template:

Reportbug-maint mailing list

Reply via email to