API breakage: 'ConnectBug' object has no attribute 'Error'

Bug #254556 reported by Martin Pitt
2
Affects Status Importance Assigned to Milestone
python-launchpad-bugs
Fix Released
High
Brian Murray

Bug Description

I just updated the p-lp-bugs main checkout in the apport retracers, and they now fail with

Traceback (most recent call last):
  File "/home/ubuntu-archive/apport-retracer-i386/bin/crash-digger", line 230, in <module>
    opts.dup_db, opts.arch_indep_dupcheck, opts.logfile, opts.pidfile).run()
  File "/home/ubuntu-archive/apport-retracer-i386/bin/crash-digger", line 157, in run
    self.fill_pool()
  File "/home/ubuntu-archive/apport-retracer-i386/bin/crash-digger", line 71, in fill_pool
    self.crashdb.duplicate_db_consolidate()
  File "/home/ubuntu-archive/apport-retracer-i386/apport/apport/crashdb.py", line 211, in duplicate_db_consolidate
    fixed_ver = self.get_fixed_version(id)
  File "/home/ubuntu-archive/apport-retracer-i386/apport/apport/crashdb_impl/launchpad.py", line 261, in get_fixed_version
    except Bug.Error.LPUrlError, e:
AttributeError: 'ConnectBug' object has no attribute 'Error'

with

  Bug = Connector.ConnectBug()

This looks like a recent API breakage. If it is really justified, I'd need to do apport SRUs for stable releases, or some weird workaround hacks, but preferably Python libraries should not break API unless they really have to. Can this be put back in a sane way?

Thank you!

Revision history for this message
Markus Korn (thekorn) wrote :

patch added to reimplement the old behavior

please test this against this code (copy from apport/crashdb_impl/launchpad.py):

In [8]: try:
   ...: b = Bug(1111234536356)
   ...: except Bug.Error.LPUrlError, e:
   ...: if e.value.startswith('Page not found'):
   ...: print "PAGE NOT FOUND"
   ...: else:
   ...: raise
   ...:
   ...:
PAGE NOT FOUND

Markus

Revision history for this message
Brian Murray (brian-murray) wrote :

It should be LPUrlError in the patch not LPURLError, I'll merge the correct fix shortly.

Changed in python-launchpad-bugs:
assignee: nobody → brian-murray
importance: Undecided → High
status: New → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote :

Fix Released in bzr and in Intrepid package version 0.3.

Changed in python-launchpad-bugs:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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