Package: reportbug
Version: 7.1.1
Severity: normal
Tags: patch

Dear Maintainer,

reportbug either still needs to depend on python, or its bug script
must be ported to python3. Otherwise it will fail if python2 is not
installed.

Untested patch attached (done using 2to3).
>From 5ba5586196275bec188fe4f473a1eba207506cb5 Mon Sep 17 00:00:00 2001
From: Nis Martensen <nis.marten...@web.de>
Date: Fri, 30 Dec 2016 14:11:24 +0100
Subject: [PATCH] Port bug script to python3

---
 share/script | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/share/script b/share/script
index e64c5e9..58eef25 100755
--- a/share/script
+++ b/share/script
@@ -1,4 +1,4 @@
-#! /usr/bin/python
+#! /usr/bin/python3
 # -*- python -*-
 
 import os
@@ -11,21 +11,21 @@ for var in ['EDITOR', 'PAGER', 'VISUAL', 'REPORTBUGEMAIL', 'DEBEMAIL', 'EMAIL',
             'DEBFULLNAME', 'DEBNAME', 'NAME', 'INTERFACE']:
     if var in os.environ:
         if not envprint:
-            print >> OUT, '** Environment settings:'
+            print('** Environment settings:', file=OUT)
             envprint = True
-        print >> OUT, '%s="%s"' % (var, os.environ[var])
+        print('%s="%s"' % (var, os.environ[var]), file=OUT)
 
 passwdre = re.compile(r'\s*(smtppasswd)\s+(.*)$')
 
 USERFILE = os.path.expanduser('~/.reportbugrc')
 if os.path.exists(USERFILE):
     if envprint:
-        print >> OUT
-    print >> OUT, '** %s:' % USERFILE
+        print(file=OUT)
+    print('** %s:' % USERFILE, file=OUT)
     for line in file(USERFILE):
         line = line.strip()
         if line and not line.startswith('#'):
             m = passwdre.match(line)
             if m:
                 line = '%s <omitted>' % m.group(1)
-            print >> OUT, line
+            print(line, file=OUT)
-- 
2.1.4

Reply via email to