Merge lp:~bdrung/apport/cleanup into lp:~apport-hackers/apport/trunk
- cleanup
- Merge into trunk
Proposed by
Benjamin Drung
Status: | Needs review |
---|---|
Proposed branch: | lp:~bdrung/apport/cleanup |
Merge into: | lp:~apport-hackers/apport/trunk |
Diff against target: |
404 lines (+80/-74) 15 files modified
apport/__init__.py (+3/-3) apport/crashdb_impl/launchpad.py (+1/-1) apport/fileutils.py (+3/-3) apport/hookutils.py (+9/-9) apport/packaging.py (+5/-5) apport/report.py (+1/-1) apport/sandboxutils.py (+23/-17) apport/ui.py (+15/-15) backends/packaging-apt-dpkg.py (+5/-5) data/package_hook (+6/-6) setup.py (+2/-2) test/test_apport_valgrind.py (+1/-1) test/test_fileutils.py (+3/-3) test/test_signal_crashes.py (+2/-2) test/test_ui.py (+1/-1) |
To merge this branch: | bzr merge lp:~bdrung/apport/cleanup |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Apport upstream developers | Pending | ||
Review via email: mp+389618@code.launchpad.net |
Commit message
Description of the change
This merge request pulls the commits from the Ubuntu package that fixes pep8 and pycodestyle issues. It also logs the package versions installed in the sandbox.
To post a comment you must log in.
Unmerged revisions
- 3284. By Benjamin Drung
-
Log package versions installed in sandbox
- 3283. By Benjamin Drung
-
Fix pep8 errors regarding ambiguous variables
Import changes from apport 2.20.11-0ubuntu42 (from Brian Murray).
- 3282. By Benjamin Drung
-
Resolve pycodestyle issues
Import changes from apport 2.20.11-0ubuntu7 (from Brian Murray).
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'apport/__init__.py' | |||
2 | --- apport/__init__.py 2015-08-10 08:01:38 +0000 | |||
3 | +++ apport/__init__.py 2020-08-20 16:32:50 +0000 | |||
4 | @@ -64,9 +64,9 @@ | |||
5 | 64 | 64 | ||
6 | 65 | memstat = {} | 65 | memstat = {} |
7 | 66 | with open('/proc/self/status') as f: | 66 | with open('/proc/self/status') as f: |
11 | 67 | for l in f: | 67 | for line in f: |
12 | 68 | if l.startswith('Vm'): | 68 | if line.startswith('Vm'): |
13 | 69 | (field, size, unit) = l.split() | 69 | (field, size, unit) = line.split() |
14 | 70 | memstat[field[:-1]] = int(size) / 1024. | 70 | memstat[field[:-1]] = int(size) / 1024. |
15 | 71 | 71 | ||
16 | 72 | sys.stderr.write('Size: %.1f MB, RSS: %.1f MB, Stk: %.1f MB @ %s\n' % | 72 | sys.stderr.write('Size: %.1f MB, RSS: %.1f MB, Stk: %.1f MB @ %s\n' % |
17 | 73 | 73 | ||
18 | === modified file 'apport/crashdb_impl/launchpad.py' | |||
19 | --- apport/crashdb_impl/launchpad.py 2019-04-01 21:59:51 +0000 | |||
20 | +++ apport/crashdb_impl/launchpad.py 2020-08-20 16:32:50 +0000 | |||
21 | @@ -968,7 +968,7 @@ | |||
22 | 968 | hdr['Subscribers'] = 'apport' | 968 | hdr['Subscribers'] = 'apport' |
23 | 969 | hdr['Tags'] += ' need-duplicate-check' | 969 | hdr['Tags'] += ' need-duplicate-check' |
24 | 970 | if 'DuplicateSignature' in report and 'need-duplicate-check' not in hdr['Tags']: | 970 | if 'DuplicateSignature' in report and 'need-duplicate-check' not in hdr['Tags']: |
26 | 971 | hdr['Tags'] += ' need-duplicate-check' | 971 | hdr['Tags'] += ' need-duplicate-check' |
27 | 972 | 972 | ||
28 | 973 | # if we have checkbox submission key, link it to the bug; keep text | 973 | # if we have checkbox submission key, link it to the bug; keep text |
29 | 974 | # reference until the link is shown in Launchpad's UI | 974 | # reference until the link is shown in Launchpad's UI |
30 | 975 | 975 | ||
31 | === modified file 'apport/fileutils.py' | |||
32 | --- apport/fileutils.py 2018-07-02 08:46:13 +0000 | |||
33 | +++ apport/fileutils.py 2020-08-20 16:32:50 +0000 | |||
34 | @@ -314,9 +314,9 @@ | |||
35 | 314 | return [] | 314 | return [] |
36 | 315 | 315 | ||
37 | 316 | mismatches = [] | 316 | mismatches = [] |
41 | 317 | for l in out.splitlines(): | 317 | for line in out.splitlines(): |
42 | 318 | if l.endswith('FAILED'): | 318 | if line.endswith('FAILED'): |
43 | 319 | mismatches.append(l.rsplit(':', 1)[0]) | 319 | mismatches.append(line.rsplit(':', 1)[0]) |
44 | 320 | 320 | ||
45 | 321 | return mismatches | 321 | return mismatches |
46 | 322 | 322 | ||
47 | 323 | 323 | ||
48 | === modified file 'apport/hookutils.py' | |||
49 | --- apport/hookutils.py 2019-05-16 18:48:29 +0000 | |||
50 | +++ apport/hookutils.py 2020-08-20 16:32:50 +0000 | |||
51 | @@ -608,9 +608,9 @@ | |||
52 | 608 | env['XDG_CONFIG_HOME'] = '/nonexisting' | 608 | env['XDG_CONFIG_HOME'] = '/nonexisting' |
53 | 609 | gsettings = subprocess.Popen(['gsettings', 'list-recursively', schema], | 609 | gsettings = subprocess.Popen(['gsettings', 'list-recursively', schema], |
54 | 610 | env=env, stdout=subprocess.PIPE) | 610 | env=env, stdout=subprocess.PIPE) |
56 | 611 | for l in gsettings.stdout: | 611 | for line in gsettings.stdout: |
57 | 612 | try: | 612 | try: |
59 | 613 | (schema_name, key, value) = l.split(None, 2) | 613 | (schema_name, key, value) = line.split(None, 2) |
60 | 614 | value = value.rstrip() | 614 | value = value.rstrip() |
61 | 615 | except ValueError: | 615 | except ValueError: |
62 | 616 | continue # invalid line | 616 | continue # invalid line |
63 | @@ -618,9 +618,9 @@ | |||
64 | 618 | 618 | ||
65 | 619 | gsettings = subprocess.Popen(['gsettings', 'list-recursively', schema], | 619 | gsettings = subprocess.Popen(['gsettings', 'list-recursively', schema], |
66 | 620 | stdout=subprocess.PIPE) | 620 | stdout=subprocess.PIPE) |
68 | 621 | for l in gsettings.stdout: | 621 | for line in gsettings.stdout: |
69 | 622 | try: | 622 | try: |
71 | 623 | (schema_name, key, value) = l.split(None, 2) | 623 | (schema_name, key, value) = line.split(None, 2) |
72 | 624 | value = value.rstrip() | 624 | value = value.rstrip() |
73 | 625 | except ValueError: | 625 | except ValueError: |
74 | 626 | continue # invalid line | 626 | continue # invalid line |
75 | @@ -801,8 +801,8 @@ | |||
76 | 801 | return 'invalid' | 801 | return 'invalid' |
77 | 802 | except OSError: | 802 | except OSError: |
78 | 803 | return None | 803 | return None |
81 | 804 | for l in out.splitlines(): | 804 | for line in out.splitlines(): |
82 | 805 | fields = l.split(':', 1) | 805 | fields = line.split(':', 1) |
83 | 806 | if len(fields) < 2: | 806 | if len(fields) < 2: |
84 | 807 | continue | 807 | continue |
85 | 808 | if fields[0] == 'license': | 808 | if fields[0] == 'license': |
86 | @@ -816,7 +816,7 @@ | |||
87 | 816 | 816 | ||
88 | 817 | try: | 817 | try: |
89 | 818 | with open(module_list) as f: | 818 | with open(module_list) as f: |
91 | 819 | mods = [l.split()[0] for l in f] | 819 | mods = [line.split()[0] for line in f] |
92 | 820 | except IOError: | 820 | except IOError: |
93 | 821 | return [] | 821 | return [] |
94 | 822 | 822 | ||
95 | @@ -912,9 +912,9 @@ | |||
96 | 912 | 912 | ||
97 | 913 | if os.path.exists(path): | 913 | if os.path.exists(path): |
98 | 914 | with open(path, 'r') as f: | 914 | with open(path, 'r') as f: |
100 | 915 | filtered = [l if not l.startswith('password') | 915 | filtered = [line if not line.startswith('password') |
101 | 916 | else '### PASSWORD LINE REMOVED ###' | 916 | else '### PASSWORD LINE REMOVED ###' |
103 | 917 | for l in f.readlines()] | 917 | for line in f.readlines()] |
104 | 918 | report[key] = ''.join(filtered) | 918 | report[key] = ''.join(filtered) |
105 | 919 | 919 | ||
106 | 920 | 920 | ||
107 | 921 | 921 | ||
108 | === modified file 'apport/packaging.py' | |||
109 | --- apport/packaging.py 2017-06-12 23:42:53 +0000 | |||
110 | +++ apport/packaging.py 2020-08-20 16:32:50 +0000 | |||
111 | @@ -283,16 +283,16 @@ | |||
112 | 283 | name = None | 283 | name = None |
113 | 284 | version = None | 284 | version = None |
114 | 285 | with open('/etc/os-release') as f: | 285 | with open('/etc/os-release') as f: |
118 | 286 | for l in f: | 286 | for line in f: |
119 | 287 | if l.startswith('NAME='): | 287 | if line.startswith('NAME='): |
120 | 288 | name = l.split('=', 1)[1] | 288 | name = line.split('=', 1)[1] |
121 | 289 | if name.startswith('"'): | 289 | if name.startswith('"'): |
122 | 290 | name = name[1:-2].strip() | 290 | name = name[1:-2].strip() |
123 | 291 | # work around inconsistent "Debian GNU/Linux" in os-release | 291 | # work around inconsistent "Debian GNU/Linux" in os-release |
124 | 292 | if name.endswith('GNU/Linux'): | 292 | if name.endswith('GNU/Linux'): |
125 | 293 | name = name.split()[0:-1] | 293 | name = name.split()[0:-1] |
128 | 294 | elif l.startswith('VERSION_ID='): | 294 | elif line.startswith('VERSION_ID='): |
129 | 295 | version = l.split('=', 1)[1] | 295 | version = line.split('=', 1)[1] |
130 | 296 | if version.startswith('"'): | 296 | if version.startswith('"'): |
131 | 297 | version = version[1:-2].strip() | 297 | version = version[1:-2].strip() |
132 | 298 | if name and version: | 298 | if name and version: |
133 | 299 | 299 | ||
134 | === modified file 'apport/report.py' | |||
135 | --- apport/report.py 2020-06-09 21:41:57 +0000 | |||
136 | +++ apport/report.py 2020-08-20 16:32:50 +0000 | |||
137 | @@ -505,7 +505,7 @@ | |||
138 | 505 | pathlist = [path] | 505 | pathlist = [path] |
139 | 506 | 506 | ||
140 | 507 | if not module and desc[2] == imp.PKG_DIRECTORY: | 507 | if not module and desc[2] == imp.PKG_DIRECTORY: |
142 | 508 | module = ['__init__'] | 508 | module = ['__init__'] |
143 | 509 | 509 | ||
144 | 510 | if path and path.endswith('.pyc'): | 510 | if path and path.endswith('.pyc'): |
145 | 511 | path = path[:-1] | 511 | path = path[:-1] |
146 | 512 | 512 | ||
147 | === modified file 'apport/sandboxutils.py' | |||
148 | --- apport/sandboxutils.py 2020-04-13 21:19:56 +0000 | |||
149 | +++ apport/sandboxutils.py 2020-08-20 16:32:50 +0000 | |||
150 | @@ -23,13 +23,13 @@ | |||
151 | 23 | pkgs = {} | 23 | pkgs = {} |
152 | 24 | 24 | ||
153 | 25 | # first, grab the versions that we captured at crash time | 25 | # first, grab the versions that we captured at crash time |
156 | 26 | for l in (report.get('Package', '') + '\n' + report.get('Dependencies', '')).splitlines(): | 26 | for line in (report.get('Package', '') + '\n' + report.get('Dependencies', '')).splitlines(): |
157 | 27 | if not l.strip(): | 27 | if not line.strip(): |
158 | 28 | continue | 28 | continue |
159 | 29 | try: | 29 | try: |
161 | 30 | (pkg, version) = l.split()[:2] | 30 | (pkg, version) = line.split()[:2] |
162 | 31 | except ValueError: | 31 | except ValueError: |
164 | 32 | apport.warning('invalid Package/Dependencies line: %s', l) | 32 | apport.warning('invalid Package/Dependencies line: %s', line) |
165 | 33 | # invalid line, ignore | 33 | # invalid line, ignore |
166 | 34 | continue | 34 | continue |
167 | 35 | pkgs[pkg] = version | 35 | pkgs[pkg] = version |
168 | @@ -41,13 +41,13 @@ | |||
169 | 41 | '''Return package -> version dictionary from report''' | 41 | '''Return package -> version dictionary from report''' |
170 | 42 | 42 | ||
171 | 43 | pkg_vers = {} | 43 | pkg_vers = {} |
174 | 44 | for l in (report.get('Package', '') + '\n' + report.get('Dependencies', '')).splitlines(): | 44 | for line in (report.get('Package', '') + '\n' + report.get('Dependencies', '')).splitlines(): |
175 | 45 | if not l.strip(): | 45 | if not line.strip(): |
176 | 46 | continue | 46 | continue |
177 | 47 | try: | 47 | try: |
179 | 48 | (pkg, version) = l.split()[:2] | 48 | (pkg, version) = line.split()[:2] |
180 | 49 | except ValueError: | 49 | except ValueError: |
182 | 50 | apport.warning('invalid Package/Dependencies line: %s', l) | 50 | apport.warning('invalid Package/Dependencies line: %s', line) |
183 | 51 | # invalid line, ignore | 51 | # invalid line, ignore |
184 | 52 | continue | 52 | continue |
185 | 53 | pkg_vers[pkg] = version | 53 | pkg_vers[pkg] = version |
186 | @@ -74,10 +74,10 @@ | |||
187 | 74 | pkgs = set() | 74 | pkgs = set() |
188 | 75 | libs = set() | 75 | libs = set() |
189 | 76 | if 'ProcMaps' in report: | 76 | if 'ProcMaps' in report: |
192 | 77 | for l in report['ProcMaps'].splitlines(): | 77 | for line in report['ProcMaps'].splitlines(): |
193 | 78 | if not l.strip(): | 78 | if not line.strip(): |
194 | 79 | continue | 79 | continue |
196 | 80 | cols = l.split() | 80 | cols = line.split() |
197 | 81 | if len(cols) in (6, 7) and 'x' in cols[1] and '.so' in cols[5]: | 81 | if len(cols) in (6, 7) and 'x' in cols[1] and '.so' in cols[5]: |
198 | 82 | lib = os.path.realpath(cols[5]) | 82 | lib = os.path.realpath(cols[5]) |
199 | 83 | libs.add(lib) | 83 | libs.add(lib) |
200 | @@ -88,16 +88,18 @@ | |||
201 | 88 | os.makedirs(pkgmap_cache_dir) | 88 | os.makedirs(pkgmap_cache_dir) |
202 | 89 | 89 | ||
203 | 90 | # grab as much as we can | 90 | # grab as much as we can |
206 | 91 | for l in libs: | 91 | for line in libs: |
207 | 92 | pkg = apport.packaging.get_file_package(l, True, pkgmap_cache_dir, | 92 | pkg = apport.packaging.get_file_package(line, True, pkgmap_cache_dir, |
208 | 93 | release=report['DistroRelease'], | 93 | release=report['DistroRelease'], |
209 | 94 | arch=report.get('Architecture')) | 94 | arch=report.get('Architecture')) |
210 | 95 | if pkg: | 95 | if pkg: |
211 | 96 | if verbose: | 96 | if verbose: |
213 | 97 | apport.log('dynamically loaded %s needs package %s, queueing' % (l, pkg)) | 97 | apport.log('dynamically loaded %s needs package %s, queueing' |
214 | 98 | % (line, pkg)) | ||
215 | 98 | pkgs.add(pkg) | 99 | pkgs.add(pkg) |
216 | 99 | else: | 100 | else: |
218 | 100 | apport.warning('%s is needed, but cannot be mapped to a package', l) | 101 | apport.warning('%s is needed, but cannot be mapped to a package', |
219 | 102 | line) | ||
220 | 101 | 103 | ||
221 | 102 | return [(p, pkg_versions.get(p)) for p in pkgs] | 104 | return [(p, pkg_versions.get(p)) for p in pkgs] |
222 | 103 | 105 | ||
223 | @@ -235,8 +237,12 @@ | |||
224 | 235 | report['ExecutablePath'] = '/bin/systemctl' | 237 | report['ExecutablePath'] = '/bin/systemctl' |
225 | 236 | pkg = 'systemd' | 238 | pkg = 'systemd' |
226 | 237 | if pkg: | 239 | if pkg: |
229 | 238 | apport.log('Installing extra package %s to get %s' % (pkg, path), log_timestamps) | 240 | version = pkg_versions.get(pkg) |
230 | 239 | pkgs.append((pkg, pkg_versions.get(pkg))) | 241 | pkg_version = "{}={}".format(pkg, version) if version else pkg |
231 | 242 | apport.log( | ||
232 | 243 | "Installing extra package %s to get %s" % (pkg_version, path), log_timestamps | ||
233 | 244 | ) | ||
234 | 245 | pkgs.append((pkg, version)) | ||
235 | 240 | else: | 246 | else: |
236 | 241 | apport.fatal('Cannot find package which ships %s %s', path, report[path]) | 247 | apport.fatal('Cannot find package which ships %s %s', path, report[path]) |
237 | 242 | 248 | ||
238 | 243 | 249 | ||
239 | === modified file 'apport/ui.py' | |||
240 | --- apport/ui.py 2019-07-22 19:11:45 +0000 | |||
241 | +++ apport/ui.py 2020-08-20 16:32:50 +0000 | |||
242 | @@ -711,23 +711,23 @@ | |||
243 | 711 | self.ui_error_message(_('Invalid problem report'), excstr(e)) | 711 | self.ui_error_message(_('Invalid problem report'), excstr(e)) |
244 | 712 | return True | 712 | return True |
245 | 713 | elif self.options.window: | 713 | elif self.options.window: |
260 | 714 | self.ui_info_message('', _('After closing this message ' | 714 | self.ui_info_message('', _('After closing this message ' |
261 | 715 | 'please click on an application window to report a problem about it.')) | 715 | 'please click on an application window to report a problem about it.')) |
262 | 716 | xprop = subprocess.Popen(['xprop', '_NET_WM_PID'], | 716 | xprop = subprocess.Popen(['xprop', '_NET_WM_PID'], |
263 | 717 | stdout=subprocess.PIPE, stderr=subprocess.PIPE) | 717 | stdout=subprocess.PIPE, stderr=subprocess.PIPE) |
264 | 718 | (out, err) = xprop.communicate() | 718 | (out, err) = xprop.communicate() |
265 | 719 | if xprop.returncode == 0: | 719 | if xprop.returncode == 0: |
266 | 720 | try: | 720 | try: |
267 | 721 | self.options.pid = int(out.split()[-1]) | 721 | self.options.pid = int(out.split()[-1]) |
268 | 722 | except ValueError: | 722 | except ValueError: |
255 | 723 | self.ui_error_message(_('Cannot create report'), | ||
256 | 724 | _('xprop failed to determine process ID of the window')) | ||
257 | 725 | return True | ||
258 | 726 | return self.run_report_bug() | ||
259 | 727 | else: | ||
269 | 728 | self.ui_error_message(_('Cannot create report'), | 723 | self.ui_error_message(_('Cannot create report'), |
271 | 729 | _('xprop failed to determine process ID of the window') + '\n\n' + err) | 724 | _('xprop failed to determine process ID of the window')) |
272 | 730 | return True | 725 | return True |
273 | 726 | return self.run_report_bug() | ||
274 | 727 | else: | ||
275 | 728 | self.ui_error_message(_('Cannot create report'), | ||
276 | 729 | _('xprop failed to determine process ID of the window') + '\n\n' + err) | ||
277 | 730 | return True | ||
278 | 731 | else: | 731 | else: |
279 | 732 | return self.run_crashes() | 732 | return self.run_crashes() |
280 | 733 | 733 | ||
281 | 734 | 734 | ||
282 | === modified file 'backends/packaging-apt-dpkg.py' | |||
283 | --- backends/packaging-apt-dpkg.py 2020-04-16 00:25:44 +0000 | |||
284 | +++ backends/packaging-apt-dpkg.py 2020-08-20 16:32:50 +0000 | |||
285 | @@ -1213,9 +1213,9 @@ | |||
286 | 1213 | return [] | 1213 | return [] |
287 | 1214 | 1214 | ||
288 | 1215 | mismatches = [] | 1215 | mismatches = [] |
292 | 1216 | for l in out.splitlines(): | 1216 | for line in out.splitlines(): |
293 | 1217 | if l.endswith('FAILED'): | 1217 | if line.endswith('FAILED'): |
294 | 1218 | mismatches.append(l.rsplit(':', 1)[0]) | 1218 | mismatches.append(line.rsplit(':', 1)[0]) |
295 | 1219 | 1219 | ||
296 | 1220 | return mismatches | 1220 | return mismatches |
297 | 1221 | 1221 | ||
298 | @@ -1224,8 +1224,8 @@ | |||
299 | 1224 | '''Heuristically determine primary mirror from an apt sources.list''' | 1224 | '''Heuristically determine primary mirror from an apt sources.list''' |
300 | 1225 | 1225 | ||
301 | 1226 | with open(apt_sources) as f: | 1226 | with open(apt_sources) as f: |
304 | 1227 | for l in f: | 1227 | for line in f: |
305 | 1228 | fields = l.split() | 1228 | fields = line.split() |
306 | 1229 | if len(fields) >= 3 and fields[0] == 'deb': | 1229 | if len(fields) >= 3 and fields[0] == 'deb': |
307 | 1230 | if fields[1].startswith('['): | 1230 | if fields[1].startswith('['): |
308 | 1231 | # options given, mirror is in third field | 1231 | # options given, mirror is in third field |
309 | 1232 | 1232 | ||
310 | === modified file 'data/package_hook' | |||
311 | --- data/package_hook 2016-12-10 11:28:27 +0000 | |||
312 | +++ data/package_hook 2020-08-20 16:32:50 +0000 | |||
313 | @@ -52,12 +52,12 @@ | |||
314 | 52 | tags = options.tags.replace(',', '') | 52 | tags = options.tags.replace(',', '') |
315 | 53 | pr['Tags'] = tags | 53 | pr['Tags'] = tags |
316 | 54 | 54 | ||
323 | 55 | for l in (options.logs or []): | 55 | for line in (options.logs or []): |
324 | 56 | if os.path.isfile(l): | 56 | if os.path.isfile(line): |
325 | 57 | pr[mkattrname(l)] = (l,) | 57 | pr[mkattrname(line)] = (line,) |
326 | 58 | elif os.path.isdir(l): | 58 | elif os.path.isdir(line): |
327 | 59 | for f in os.listdir(l): | 59 | for f in os.listdir(line): |
328 | 60 | path = os.path.join(l, f) | 60 | path = os.path.join(line, f) |
329 | 61 | if os.path.isfile(path): | 61 | if os.path.isfile(path): |
330 | 62 | pr[mkattrname(path)] = (path,) | 62 | pr[mkattrname(path)] = (path,) |
331 | 63 | 63 | ||
332 | 64 | 64 | ||
333 | === modified file 'setup.py' | |||
334 | --- setup.py 2019-03-29 20:55:44 +0000 | |||
335 | +++ setup.py 2020-08-20 16:32:50 +0000 | |||
336 | @@ -75,8 +75,8 @@ | |||
337 | 75 | distutils.log.info('Updating hashbang of %s', f) | 75 | distutils.log.info('Updating hashbang of %s', f) |
338 | 76 | lines[0] = new_hashbang | 76 | lines[0] = new_hashbang |
339 | 77 | with open(f, 'w') as fd: | 77 | with open(f, 'w') as fd: |
342 | 78 | for l in lines: | 78 | for line in lines: |
343 | 79 | fd.write(l) | 79 | fd.write(line) |
344 | 80 | 80 | ||
345 | 81 | 81 | ||
346 | 82 | # | 82 | # |
347 | 83 | 83 | ||
348 | === modified file 'test/test_apport_valgrind.py' | |||
349 | --- test/test_apport_valgrind.py 2019-05-16 18:48:29 +0000 | |||
350 | +++ test/test_apport_valgrind.py 2020-08-20 16:32:50 +0000 | |||
351 | @@ -94,7 +94,7 @@ | |||
352 | 94 | }''' | 94 | }''' |
353 | 95 | 95 | ||
354 | 96 | with open('memleak.c', 'w') as fd: | 96 | with open('memleak.c', 'w') as fd: |
356 | 97 | fd.write(code) | 97 | fd.write(code) |
357 | 98 | cmd = ['gcc', '-Wall', '-Werror', '-g', 'memleak.c', '-o', 'memleak'] | 98 | cmd = ['gcc', '-Wall', '-Werror', '-g', 'memleak.c', '-o', 'memleak'] |
358 | 99 | self.assertEqual( | 99 | self.assertEqual( |
359 | 100 | subprocess.call(cmd), 0, 'compiling memleak.c failed.') | 100 | subprocess.call(cmd), 0, 'compiling memleak.c failed.') |
360 | 101 | 101 | ||
361 | === modified file 'test/test_fileutils.py' | |||
362 | --- test/test_fileutils.py 2016-12-10 11:28:27 +0000 | |||
363 | +++ test/test_fileutils.py 2020-08-20 16:32:50 +0000 | |||
364 | @@ -377,9 +377,9 @@ | |||
365 | 377 | self.assertTrue('libc.so.6' in libs, libs) | 377 | self.assertTrue('libc.so.6' in libs, libs) |
366 | 378 | self.assertTrue('libc.so.6' in libs['libc.so.6'], libs['libc.so.6']) | 378 | self.assertTrue('libc.so.6' in libs['libc.so.6'], libs['libc.so.6']) |
367 | 379 | self.assertTrue(os.path.exists(libs['libc.so.6'])) | 379 | self.assertTrue(os.path.exists(libs['libc.so.6'])) |
371 | 380 | for l in libs: | 380 | for line in libs: |
372 | 381 | self.assertFalse('vdso' in l, libs) | 381 | self.assertFalse('vdso' in line, libs) |
373 | 382 | self.assertTrue(os.path.exists(libs[l])) | 382 | self.assertTrue(os.path.exists(libs[line])) |
374 | 383 | 383 | ||
375 | 384 | self.assertEqual(apport.fileutils.shared_libraries('/non/existing'), {}) | 384 | self.assertEqual(apport.fileutils.shared_libraries('/non/existing'), {}) |
376 | 385 | self.assertEqual(apport.fileutils.shared_libraries('/etc'), {}) | 385 | self.assertEqual(apport.fileutils.shared_libraries('/etc'), {}) |
377 | 386 | 386 | ||
378 | === modified file 'test/test_signal_crashes.py' | |||
379 | --- test/test_signal_crashes.py 2018-03-23 20:23:02 +0000 | |||
380 | +++ test/test_signal_crashes.py 2020-08-20 16:32:50 +0000 | |||
381 | @@ -138,8 +138,8 @@ | |||
382 | 138 | 'LC_TELEPHONE', 'LC_MEASUREMENT', 'LC_IDENTIFICATION', | 138 | 'LC_TELEPHONE', 'LC_MEASUREMENT', 'LC_IDENTIFICATION', |
383 | 139 | 'LOCPATH', 'TERM', 'XDG_RUNTIME_DIR', 'LD_PRELOAD'] | 139 | 'LOCPATH', 'TERM', 'XDG_RUNTIME_DIR', 'LD_PRELOAD'] |
384 | 140 | 140 | ||
387 | 141 | for l in pr['ProcEnviron'].splitlines(): | 141 | for line in pr['ProcEnviron'].splitlines(): |
388 | 142 | (k, v) = l.split('=', 1) | 142 | (k, v) = line.split('=', 1) |
389 | 143 | self.assertTrue(k in allowed_vars, | 143 | self.assertTrue(k in allowed_vars, |
390 | 144 | 'report contains sensitive environment variable %s' % k) | 144 | 'report contains sensitive environment variable %s' % k) |
391 | 145 | 145 | ||
392 | 146 | 146 | ||
393 | === modified file 'test/test_ui.py' | |||
394 | --- test/test_ui.py 2019-05-16 18:48:29 +0000 | |||
395 | +++ test/test_ui.py 2020-08-20 16:32:50 +0000 | |||
396 | @@ -1770,7 +1770,7 @@ | |||
397 | 1770 | def _run_hook(self, code): | 1770 | def _run_hook(self, code): |
398 | 1771 | f = open(os.path.join(self.hookdir, 'coreutils.py'), 'w') | 1771 | f = open(os.path.join(self.hookdir, 'coreutils.py'), 'w') |
399 | 1772 | f.write('def add_info(report, ui):\n%s\n' % | 1772 | f.write('def add_info(report, ui):\n%s\n' % |
401 | 1773 | '\n'.join([' ' + l for l in code.splitlines()])) | 1773 | '\n'.join([' ' + line for line in code.splitlines()])) |
402 | 1774 | f.close() | 1774 | f.close() |
403 | 1775 | self.ui.options.package = 'coreutils' | 1775 | self.ui.options.package = 'coreutils' |
404 | 1776 | self.ui.run_report_bug() | 1776 | self.ui.run_report_bug() |