[Bug 887249] [NEW] Providing wrong ppa format in add-apt-repository throws a 404 error which is not handled appropriately

Manish Sinha (मनीष सिन्हा) manishsinha at ubuntu.com
Mon Nov 7 18:38:31 UTC 2011


Public bug reported:

I was trying to add the elementary PPA, but by mistake added a ~ after :

$ sudo add-apt-repository ppa:~elementaryart/elementarydesktop
Traceback (most recent call last):
  File "/usr/bin/add-apt-repository", line 88, in <module>
    ppa_info = get_ppa_info_from_lp(user, ppa_name)
  File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 65, in get_ppa_info_from_lp
    lp_page = urlopen(req).read()
  File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
    return _opener.open(url, data, timeout)
  File "/usr/lib/python2.7/urllib2.py", line 400, in open
    response = meth(req, response)
  File "/usr/lib/python2.7/urllib2.py", line 513, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/lib/python2.7/urllib2.py", line 438, in error
    return self._call_chain(*args)
  File "/usr/lib/python2.7/urllib2.py", line 372, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.7/urllib2.py", line 521, in http_error_default
    raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found

Expected: The exception should be handled and a friendly error message
should be shown instead of a verbose exception

---------

$ lsb_release -rd
Description:	Ubuntu 11.10
Release:	11.10

--------

$ apt-cache policy python-software-properties
python-software-properties:
  Installed: 0.81.13.1
  Candidate: 0.81.13.1

--------

** Affects: software-properties
     Importance: Undecided
         Status: New

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


** Tags: 404 error exception

** Summary changed:

- Providing wrong ppa format in add-apt-repository throws a 404 error which is not caught
+ Providing wrong ppa format in add-apt-repository throws a 404 error which is not handled appropiately

** Summary changed:

- Providing wrong ppa format in add-apt-repository throws a 404 error which is not handled appropiately
+ Providing wrong ppa format in add-apt-repository throws a 404 error which is not handled appropriately

** Also affects: software-properties
   Importance: Undecided
       Status: New

** Description changed:

- I was trying to add the elementary PPA, but mistake added a ~ after :
+ I was trying to add the elementary PPA, but by mistake added a ~ after :
  
  $ sudo add-apt-repository ppa:~elementaryart/elementarydesktop
  Traceback (most recent call last):
-   File "/usr/bin/add-apt-repository", line 88, in <module>
-     ppa_info = get_ppa_info_from_lp(user, ppa_name)
-   File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 65, in get_ppa_info_from_lp
-     lp_page = urlopen(req).read()
-   File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
-     return _opener.open(url, data, timeout)
-   File "/usr/lib/python2.7/urllib2.py", line 400, in open
-     response = meth(req, response)
-   File "/usr/lib/python2.7/urllib2.py", line 513, in http_response
-     'http', request, response, code, msg, hdrs)
-   File "/usr/lib/python2.7/urllib2.py", line 438, in error
-     return self._call_chain(*args)
-   File "/usr/lib/python2.7/urllib2.py", line 372, in _call_chain
-     result = func(*args)
-   File "/usr/lib/python2.7/urllib2.py", line 521, in http_error_default
-     raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
+   File "/usr/bin/add-apt-repository", line 88, in <module>
+     ppa_info = get_ppa_info_from_lp(user, ppa_name)
+   File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 65, in get_ppa_info_from_lp
+     lp_page = urlopen(req).read()
+   File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
+     return _opener.open(url, data, timeout)
+   File "/usr/lib/python2.7/urllib2.py", line 400, in open
+     response = meth(req, response)
+   File "/usr/lib/python2.7/urllib2.py", line 513, in http_response
+     'http', request, response, code, msg, hdrs)
+   File "/usr/lib/python2.7/urllib2.py", line 438, in error
+     return self._call_chain(*args)
+   File "/usr/lib/python2.7/urllib2.py", line 372, in _call_chain
+     result = func(*args)
+   File "/usr/lib/python2.7/urllib2.py", line 521, in http_error_default
+     raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
  urllib2.HTTPError: HTTP Error 404: Not Found
  
  Expected: The exception should be handled and a friendly error message
  should be shown instead of a verbose exception
  
  ---------
  
  $ lsb_release -rd
  Description:	Ubuntu 11.10
  Release:	11.10
  
  --------
  
- $ apt-cache policy python-software-properties 
+ $ apt-cache policy python-software-properties
  python-software-properties:
-   Installed: 0.81.13.1
-   Candidate: 0.81.13.1
+   Installed: 0.81.13.1
+   Candidate: 0.81.13.1
  
  --------

-- 
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/887249

Title:
  Providing wrong ppa format in add-apt-repository throws a 404 error
  which is not handled appropriately

Status in The apt sources.list editor used in Ubuntu (and Kubuntu):
  New
Status in “software-properties” package in Ubuntu:
  New

Bug description:
  I was trying to add the elementary PPA, but by mistake added a ~ after
  :

  $ sudo add-apt-repository ppa:~elementaryart/elementarydesktop
  Traceback (most recent call last):
    File "/usr/bin/add-apt-repository", line 88, in <module>
      ppa_info = get_ppa_info_from_lp(user, ppa_name)
    File "/usr/lib/python2.7/dist-packages/softwareproperties/ppa.py", line 65, in get_ppa_info_from_lp
      lp_page = urlopen(req).read()
    File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
      return _opener.open(url, data, timeout)
    File "/usr/lib/python2.7/urllib2.py", line 400, in open
      response = meth(req, response)
    File "/usr/lib/python2.7/urllib2.py", line 513, in http_response
      'http', request, response, code, msg, hdrs)
    File "/usr/lib/python2.7/urllib2.py", line 438, in error
      return self._call_chain(*args)
    File "/usr/lib/python2.7/urllib2.py", line 372, in _call_chain
      result = func(*args)
    File "/usr/lib/python2.7/urllib2.py", line 521, in http_error_default
      raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
  urllib2.HTTPError: HTTP Error 404: Not Found

  Expected: The exception should be handled and a friendly error message
  should be shown instead of a verbose exception

  ---------

  $ lsb_release -rd
  Description:	Ubuntu 11.10
  Release:	11.10

  --------

  $ apt-cache policy python-software-properties
  python-software-properties:
    Installed: 0.81.13.1
    Candidate: 0.81.13.1

  --------

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




More information about the foundations-bugs mailing list