PPA downloads broken

Bug #1926307 reported by Robie Basak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
git-ubuntu
Triaged
Low
Unassigned

Bug Description

gitubuntu.source_information.GitUbuntuPPASourcePackage no longer works correctly since we moved to a Focal base. This class relies on internals of its superclass ubuntutools.archive.UbuntuSourcePackage and these internals have changed in Focal.

Example failure:

>>> import tempfile
>>> import launchpadlib.launchpad
>>> import gitubuntu.git_repository
>>> import gitubuntu.importer
>>> import gitubuntu.source_information
>>> tmpdir=tempfile.TemporaryDirectory(suffix='manual')
>>> lp=launchpadlib.launchpad.Launchpad.login_anonymously('~racb', 'production', version='devel')
>>> repo=gitubuntu.git_repository.GitUbuntuRepository('../test_repo')
>>> spphr=next(iter(lp.people['racb'].getPPAByName(distribution=lp.distributions['ubuntu'], name='experimental').getPublishedSources(exact_match=True, source_name='hello', version='2.10-2ubuntu3~ppa2')))
>>> guspi=gitubuntu.source_information.GitUbuntuSourcePackageInformation(spphr, 'ppa:racb/experimental', workdir=tmpdir.name)
>>> guspi.pull()
ERROR:root:Failed to pull down source (attempt 1/1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/git-ubuntu/git/gitubuntu/source_information.py", line 356, in pull
    raise DownloadError('Failed to pull down source')
ubuntutools.archive.DownloadError: Failed to pull down source

Since the experimental import-ppa was removed prior to 1.0, I don't think this results in a significant impact right now.

Quick workaround:

diff --git a/gitubuntu/source_information.py b/gitubuntu/source_information.py
index 574d692..000f210 100644
--- a/gitubuntu/source_information.py
+++ b/gitubuntu/source_information.py
@@ -152,7 +152,7 @@ class GitUbuntuPPASourcePackage(UbuntuSourcePackage):
         self._ppa_owner, self._ppa_name = ppa.split('/', 1)
         self._spph = None

- def _lp_url(self, filename):
+ def _lp_url(self, filename, source=None):
         "Build a source package URL on Launchpad"
         ret = os.path.join('https://launchpad.net', "~%s" % self._ppa_owner,
                             '+archive', 'ubuntu', self._ppa_name,

However a proper fix would be to start using ubuntutools.archive.PersonalPackageArchiveSourcePackage instead.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.