aboutsummaryrefslogtreecommitdiff
path: root/debian/patches/apport-report.patch
blob: c715386d9dd1b21f659877048d7c92bb6a9c835f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Description: write apport reports the right way
Author: Brian Murray <brian@ubuntu.com>
Origin: vendor
Bug-Ubuntu: http://launchpad.net/bugs/1700810
Forwarded: not-needed
Last-Update: 2020-05-11
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
Index: aptdaemon-1.1.1+bzr982/aptdaemon/crash.py
===================================================================
--- aptdaemon-1.1.1+bzr982.orig/aptdaemon/crash.py
+++ aptdaemon-1.1.1+bzr982/aptdaemon/crash.py
@@ -69,9 +69,8 @@ def create_report(error, traceback, tran
         uid = os.path.basename(trans.tid)
 
     # Write report
-    report_path = apport.fileutils.make_report_path(report, uid)
-    if not os.path.exists(report_path):
-        report.write(open(report_path, 'wb'))
+    with apport.fileutils.make_report_file(report, uid) as f:
+        report.write(f)
 
 if __name__ == "__main__":
     apt_pkg.init_config()