Merge ~cjwatson/launchpad:py3-extract-dpkg-source-output into launchpad:master

Proposed by Colin Watson
Status: Merged
Approved by: Colin Watson
Approved revision: 03e044f6923783543c7159393f303357dae93667
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~cjwatson/launchpad:py3-extract-dpkg-source-output
Merge into: launchpad:master
Diff against target: 12 lines (+2/-1)
1 file modified
lib/lp/archiveuploader/utils.py (+2/-1)
Reviewer Review Type Date Requested Status
Cristian Gonzalez (community) Approve
Review via email: mp+398983@code.launchpad.net

Commit message

Convert dpkg-source output to text in extract_dpkg_source

Description of the change

We want the exception message to be text for Python 3, but we should be a little careful in case the output contains non-UTF-8 characters (perhaps dpkg-source mentioning an error related to a non-UTF-8 file name in the source package), so use `errors="replace"`.

To post a comment you must log in.
Revision history for this message
Cristian Gonzalez (cristiangsp) wrote :

Looks good!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/archiveuploader/utils.py b/lib/lp/archiveuploader/utils.py
2index bc5cf80..721b068 100644
3--- a/lib/lp/archiveuploader/utils.py
4+++ b/lib/lp/archiveuploader/utils.py
5@@ -262,7 +262,8 @@ def extract_dpkg_source(dsc_filepath, target, vendor=None):
6 output, unused = dpkg_source.communicate()
7 result = dpkg_source.wait()
8 if result != 0:
9- dpkg_output = prefix_multi_line_string(output, " ")
10+ dpkg_output = prefix_multi_line_string(
11+ output.decode("UTF-8", errors="replace"), " ")
12 raise DpkgSourceError(result=result, output=dpkg_output, command=args)
13
14

Subscribers

People subscribed via source and target branches

to status/vote changes: