[Bug 953424] [NEW] add-apt-repository does not handle malformed repo URL nicely

David Futcher bobbocanfly at gmail.com
Mon Mar 12 21:10:12 UTC 2012


Public bug reported:

add-apt-repository doesn't handle URLs nicely when they are malformed in
a particular way. If you forget to add a repository name to a full-form
ppa url it should fail gracefully but instead crashes:

sudo add-apt-repository http://ppa.launchpad.net/username/ubuntu
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 95, in run
    self.add_ppa_signing_key(self.ppa_path)
  File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 103, in add_ppa_signing_key
    owner_name, ppa_name, distro = ppa_path[1:].split('/')
ValueError: need more than 2 values to unpack

In this case I simply forgot to add the ppa name between the owner name
and the distro. The 'correct' lines for the malformed URL are added to
sources.list. It would be much nicer if add-apt-repository could handle
this issue more gracefully. This is on Ubuntu 11.10, version 0.81.13.3.

** Affects: software-properties (Ubuntu)
     Importance: Low
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to software-properties in Ubuntu.
https://bugs.launchpad.net/bugs/953424

Title:
  add-apt-repository does not handle malformed repo URL nicely

Status in “software-properties” package in Ubuntu:
  New

Bug description:
  add-apt-repository doesn't handle URLs nicely when they are malformed
  in a particular way. If you forget to add a repository name to a full-
  form ppa url it should fail gracefully but instead crashes:

  sudo add-apt-repository http://ppa.launchpad.net/username/ubuntu
  Exception in thread Thread-1:
  Traceback (most recent call last):
    File "/usr/lib/python2.7/threading.py", line 552, in __bootstrap_inner
      self.run()
    File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 95, in run
      self.add_ppa_signing_key(self.ppa_path)
    File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 103, in add_ppa_signing_key
      owner_name, ppa_name, distro = ppa_path[1:].split('/')
  ValueError: need more than 2 values to unpack

  In this case I simply forgot to add the ppa name between the owner
  name and the distro. The 'correct' lines for the malformed URL are
  added to sources.list. It would be much nicer if add-apt-repository
  could handle this issue more gracefully. This is on Ubuntu 11.10,
  version 0.81.13.3.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/953424/+subscriptions




More information about the foundations-bugs mailing list