Merge lp:~sjakthol/software-properties/fix-1111291 into lp:software-properties
Proposed by
Sami Jaktholm
Status: | Merged |
---|---|
Merged at revision: | 851 |
Proposed branch: | lp:~sjakthol/software-properties/fix-1111291 |
Merge into: | lp:software-properties |
Diff against target: |
86 lines (+40/-28) 1 file modified
softwareproperties/ppa.py (+40/-28) |
To merge this branch: | bzr merge lp:~sjakthol/software-properties/fix-1111291 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Vogt (community) | Approve | ||
Review via email: mp+157514@code.launchpad.net |
Commit message
* softwarepropert
- Use PycURL only with python2, not if urllib raises an unexpected exception
in python3. Fixes LP: #1111291.
- Catch http.client.
show a formatted error message instead of traceback.
Description of the change
This is hard to test as the code is only run if urllib fails. Luckily the changes are pretty straightforward.
To post a comment you must log in.
On Sat, Apr 06, 2013 at 12:30:28PM -0000, Sami Jaktholm wrote: ies/ppa. py: body_callback. Testcase added to
> Sami Jaktholm has proposed merging lp:~sjakthol/software-properties/fix-1111291 into lp:software-properties.
>
> Commit message:
> * softwarepropert
> - Convert bytes to string in CurlCallback.
> tests/test_lp.py. Fixes LP: #1111291.
Hi Sami, thanks for your branch.
[..]
> This is hard to test as the code is only run if urllib fails. Luckily the changes are pretty straightforward.
The change itself it looks fine, but I'm curious why its needed? It
seems like the fallback code is only intended for python2 and the fix
is only needed when the pycurl code is run with py3.
We should probably rewrite this function to make that clear, attached
is a patch that shows what I have in mind (not tested, I have no
network connection while writing this).
So it would be great to look a bit deeper and figure out what is
causing the fallback code to get activated in the first place. The
current code with the big try/except is hiding the real problem it
seems.
Cheers,
Michael