Comment 0 for bug 1405950

Revision history for this message
Hans Joachim Desserud (hjd) wrote :

$ sudo apt-add-repository ppa
Error: 'ppa' invalid

Just saying ppa without a user- or ppa name fails gracefully and informs the user it doesn't work. However, if we add the ':' separator, it attempts and fails to parse the string:

$ sudo apt-add-repository ppa:
Traceback (most recent call last):
  File "/usr/bin/apt-add-repository", line 119, in <module>
    shortcut = shortcut_handler(line)
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 837, in shortcut_handler
    ret = factory(shortcut)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 382, in shortcut_handler
    return PPAShortcutHandler(shortcut)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 345, in __init__
    self.shortcut = mangle_ppa_shortcut(shortcut)
  File "/usr/lib/python3/dist-packages/softwareproperties/ppa.py", line 133, in mangle_ppa_shortcut
    if (user[0] == "~"):
IndexError: string index out of range

This should handle the error more gracefully and display a similar error message to the user as above.

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: software-properties-common 0.96.1
ProcVersionSignature: Ubuntu 3.16.0-28.38-generic 3.16.7-ckt1
Uname: Linux 3.16.0-28-generic x86_64
ApportVersion: 2.15.1-0ubuntu1
Architecture: amd64
CurrentDesktop: Unity
Date: Sat Dec 27 15:06:46 2014
InstallationDate: Installed on 2014-12-19 (7 days ago)
InstallationMedia: Ubuntu 15.04 "Vivid Vervet" - Alpha amd64 (20141211)
PackageArchitecture: all
SourcePackage: software-properties
UpgradeStatus: No upgrade log present (probably fresh install)