Merge ubuntu-debuginfod:fix-requests-get into ubuntu-debuginfod:master
Proposed by
Sergio Durigan Junior
Status: | Merged |
---|---|
Merged at revision: | 92f8d6ead978709ec8f2788e8c750e9cbbddd1ef |
Proposed branch: | ubuntu-debuginfod:fix-requests-get |
Merge into: | ubuntu-debuginfod:master |
Diff against target: |
15 lines (+1/-3) 1 file modified
debuggetter.py (+1/-3) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Bryce Harrington (community) | Approve | ||
Athos Ribeiro | Pending | ||
Canonical Server Reporter | Pending | ||
Review via email: mp+434754@code.launchpad.net |
Description of the change
This MP fixes the code that downloads things from LP.
I've found that requests will happily deflate gzip files because it always sends "Accept-Encoding: gzip deflate". Because some source packages have .diff.gz files, this automatically decompression ends up messing with "dpkg-source -x". I've been experiencing these errors locally.
Upstream says that one should use requests.raw when reading data from the object in this case:
https:/
https:/
so this is what I'm proposing here.
To post a comment you must log in.
The rtd article says to use stream=True in the get() call, which you're already doing. The other link explains convincingly that r.raw is the way to go.
I wonder if there might be plain text files you're downloading that do need the deflation, but presumably you've verified that not to be the case.
You might leave yourself these two links in your commit message (or as comments) for future reference.
I also checked the api docs for copyfileobj to see if there's any error conditions / side effects / exceptions / parameters / return codes to note but it has nothing special.
So, LGTM, +1