Python3 version of launchpadlib doesn't properly upload binary attachments to Launchpad
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
wadllib |
Fix Released
|
High
|
Colin Watson | ||
python-wadllib (Ubuntu) |
Fix Released
|
High
|
Colin Watson | ||
Xenial |
Fix Released
|
High
|
Colin Watson | ||
Bionic |
Fix Released
|
High
|
Colin Watson |
Bug Description
Tested on 16.04 and 17.10
python-launchpadlib (1.10.5-1 on 17.10)
python3-
While working on porting a utility using launchpadlib from Python2 to Python3, I noticed the binary attachments were becoming unreadable.
I've tried uploading .jpg files, .tgz files, .tar.xz files, they all fail to open properly.
P.S.: When a fix is available, can it be ported to Xenial? We need this for our tools running on devices using Xenial.
[Test Case]
I wrote a little proof of concept that uploads a given binary attachment to a launchpad issue (see attachment). To use it on staging launchpad:
APPORT_
When using the exact same script with python2 (basically, replacing `python3` with `python` in the shebang line), the binary file is properly attached. That's why I think it's a bug with python3-
[Regression Potential]
The only sensible way to fix this bug was to rewrite how wadllib does MIME-encoding of its form uploads, so it'll be important to test both text and binary uploads.
Launchpad only defines a few methods that use multipart/
Related branches
- Simon Davy (community): Approve
- LAZR Developers: Pending requested
-
Diff: 442 lines (+208/-82)8 files modifiedREADME.txt (+1/-1)
setup.py (+0/-8)
src/wadllib/NEWS.txt (+10/-0)
src/wadllib/README.txt (+58/-11)
src/wadllib/application.py (+114/-47)
src/wadllib/tests/test_docs.py (+15/-7)
tox.ini (+10/-0)
versions.cfg (+0/-8)
description: | updated |
description: | updated |
affects: | launchpadlib → wadllib |
Changed in wadllib: | |
assignee: | nobody → Colin Watson (cjwatson) |
importance: | Undecided → High |
status: | New → In Progress |
Changed in wadllib: | |
status: | In Progress → Fix Committed |
tags: | added: patch |
Attached using python2 launchpadlib