Merge lp:~sjakthol/software-properties/fix-1037916 into lp:software-properties
Status: | Merged | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 801 | ||||||||||||||||
Proposed branch: | lp:~sjakthol/software-properties/fix-1037916 | ||||||||||||||||
Merge into: | lp:software-properties | ||||||||||||||||
Diff against target: |
22 lines (+3/-2) 1 file modified
softwareproperties/ppa.py (+3/-2) |
||||||||||||||||
To merge this branch: | bzr merge lp:~sjakthol/software-properties/fix-1037916 | ||||||||||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Colin Watson | Approve | ||
Sami Jaktholm (community) | Needs Resubmitting | ||
Review via email: mp+124560@code.launchpad.net |
Description of the change
Construct paths for new sources list entries properly. This caused some weird behavior together with bug 1042916 in python-apt when adding a PPA that already had a file with entries present in the system.
Basically python-apt failed to match the new PPA to the existing one and apt-add-repository provided it with a confusing path to save the PPA to (the path had double-slash in it, for example '/etc/apt/
This caused all kind of weird results to be written in the sources list file. Some results can be seen in bugs 972617, 994515 1018327 and 1037916.
Although this particular problem will be gone once the fix for bug 1042916 is released I think it's better to fix the other half of the problem too. This branch uses os.path.join to make sure the path is constructed properly.
Thanks for the explanation. Using os.path.join does seem reasonable.
However, a style point: using "from os.path import join" inside a
function isn't very PEP-8-ish - you only need to do that kind of thing
in the case where the import must be deferred until the function is
first called (usually only for circular or conditional imports).
I suggest instead:
* 'import os' at the top of the file
* call os.path.join rather than join
Could you make and test that change and I'll be happy to sponsor it?