add-apt-repository does not handle malformed repo URL nicely
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
software-properties (Ubuntu) |
Fix Released
|
Low
|
Unassigned |
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://
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/
self.run()
File "/usr/lib/
self.
File "/usr/lib/
owner_name, ppa_name, distro = ppa_path[
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.
Changed in software-properties (Ubuntu): | |
status: | New → Confirmed |
This specific case appears to have been fixed a while ago. I couldn't find the specific commit, but running this test case in 20.04, an error is printed in the terminal, but no exception is raised.