[Reportbug-commits] [SCM] Reportbug - reports bugs in the Debian distribution branch, master, updated. 4.0-29-gb92ef3b
Sandro Tosi
morph at debian.org
Sun Apr 5 19:26:23 UTC 2009
The following commit has been merged in the master branch:
commit 7becc78ac54a2720da592edf9d2f62e5b5ff8bbf
Author: Luca Bruno <lethalman88 at gmail.com>
Date: Fri Mar 27 23:34:19 2009 +0100
stronger check when opening files; Closes: #521496
diff --git a/debian/changelog b/debian/changelog
index 44e5a54..3c5f865 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -22,6 +22,9 @@ reportbug (4.1) UNRELEASED; urgency=low
* reportbug/debianbts.py
- use ui proper functions instead of ewrite; thanks to Jan Hauke Rahm for
the report; Closes: #521113
+ * reportbug/utils.py
+ - stronger check when opening files; thanks to Carl Chenet for the report
+ and patch; Closes: #521496
* reportbug/ui/gtk2_ui.py
- added VTE to handle bugscripts and mutt
- support for spell checking in the bug report editor
diff --git a/reportbug/bugreport.py b/reportbug/bugreport.py
index 09d5287..16df399 100644
--- a/reportbug/bugreport.py
+++ b/reportbug/bugreport.py
@@ -137,7 +137,7 @@ class bugreport(object):
cores = utils.get_cpu_cores()
if cores > 1:
kinfo += ['SMP w/%d CPU cores' % cores]
- else:
+ elif cores == 1:
kinfo += ['SMP w/1 CPU core']
if 'PREEMPT' in un[3]:
kinfo += ['PREEMPT']
diff --git a/reportbug/utils.py b/reportbug/utils.py
index ce7e79d..f191ce2 100644
--- a/reportbug/utils.py
+++ b/reportbug/utils.py
@@ -426,13 +426,13 @@ class AvailDB(object):
self.fp.close()
def get_dpkg_database():
- if os.path.exists(STATUSDB):
+ try:
fp = open(STATUSDB)
if fp:
return AvailDB(fp=fp)
-
- print >> sys.stderr, 'Unable to open', STATUSDB
- sys.exit(1)
+ except IOError:
+ print >> sys.stderr, 'Unable to open', STATUSDB
+ sys.exit(1)
def get_avail_database():
#print >> sys.stderr, 'Searching available database'
@@ -654,10 +654,12 @@ def get_debian_release_info():
dists = [(x[0], x[2]) for x in dists]
debvers = dists[0][1]
- if os.path.exists('/etc/debian_version'):
+ try:
fob = open('/etc/debian_version')
verfile = fob.readline().strip()
fob.close()
+ except IOError:
+ print >> sys.stderr, 'Unable to open /etc/debian_version'
if verfile:
debinfo += 'Debian Release: '+verfile+'\n'
@@ -706,7 +708,12 @@ def generate_blank_report(package, pkgversion, severity, justification,
def get_cpu_cores():
cpucount = 0
- fob = open('/proc/cpuinfo')
+ try:
+ fob = open('/proc/cpuinfo')
+ except IOError:
+ print >> sys.stderr, 'Unable to open /proc/cpuinfo'
+ return 0
+
for line in fob:
if line.startswith('processor'):
cpucount += 1
--
Reportbug - reports bugs in the Debian distribution
More information about the Reportbug-commits
mailing list