AttributeError: 'NoneType' object has no attribute 'self_link'

Bug #495326 reported by Rick Spencer
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lazr.restfulclient (Ubuntu)
Fix Released
High
James Westby

Bug Description

Bug hugger, worked fine in 9.10: https://launchpad.net/bughugger

Now results in this error:
  File "/home/rick/dictview_bughugger/bughugger/LaunchpadUtils.py", line 302, in bug_dict
    if bug.assignee != None:
  File "/usr/lib/pymodules/python2.6/lazr/restfulclient/resource.py", line 338, in __ne__
    return not self == other
  File "/usr/lib/pymodules/python2.6/lazr/restfulclient/resource.py", line 603, in __eq__
    self.self_link == other.self_link and
AttributeError: 'NoneType' object has no attribute 'self_link'

ProblemType: Bug
Architecture: i386
Date: Thu Dec 10 20:37:46 2009
DistroRelease: Ubuntu 10.04
InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
Package: python-lazr.restfulclient 0.9.10-1
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcVersionSignature: Ubuntu 2.6.32-7.10-generic
SourcePackage: lazr.restfulclient
Tags: lucid
Uname: Linux 2.6.32-7-generic i686

Related branches

Revision history for this message
Rick Spencer (rick-rickspencer3) wrote :
Revision history for this message
Rick Spencer (rick-rickspencer3) wrote :

here's a patch that bandaids the problem:
=== modified file 'src/lazr/restfulclient/resource.py'
--- old/src/lazr/restfulclient/resource.py 2009-10-23 13:22:44 +0000
+++ new/src/lazr/restfulclient/resource.py 2009-12-11 04:52:32 +0000
@@ -599,6 +599,10 @@
         attributes are the same, and if their dirty attribute dicts
         contain the same values.
         """
+ #they also aren't equal if one of them is None
+ if other is None:
+ return False
+
         return (
             self.self_link == other.self_link and
             self.http_etag == other.http_etag and

Revision history for this message
Rick Spencer (rick-rickspencer3) wrote :

Taking the liberty of setting to confirmed, as seb128 also experienced this issue

Changed in lazr.restfulclient (Ubuntu):
status: New → Confirmed
importance: Undecided → High
Revision history for this message
James Westby (james-w) wrote : Re: [Bug 495326] Re: AttributeError: 'NoneType' object has no attribute 'self_link'

On Fri Dec 11 05:14:03 UTC 2009 Rick Spencer wrote:
> Taking the liberty of setting to confirmed, as seb128 also experienced
> this issue

Unsurprisingly

  http://bazaar.launchpad.net/~lazr-developers/lazr.restfulclient/trunk/revision/79

looks to be the cause.

Rick, your patch looks almost correct to me, it's certainly the right start.
Do you want to make a branch and propose it for merging?

Looking at the diff there's the same bug in the other implementation of __eq__
that was added. Also, there should be a couple of doctests added comparing
with None, but I think an LP dev will add tests for you if you propose the
change.

Thanks,

James

Revision history for this message
Rick Spencer (rick-rickspencer3) wrote :

Assigning to self until I get a branch proposed

Changed in lazr.restfulclient (Ubuntu):
assignee: nobody → Rick Spencer (rick-rickspencer3)
Revision history for this message
Rick Spencer (rick-rickspencer3) wrote :

I proposed the branch merge, back to you James. Thanks.

Changed in lazr.restfulclient (Ubuntu):
assignee: Rick Spencer (rick-rickspencer3) → James Westby (james-w)
status: Confirmed → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package lazr.restfulclient - 0.9.10-2

---------------
lazr.restfulclient (0.9.10-2) unstable; urgency=low

  * debian/patches/comparison_fixes.patch:
    - Cherrypick a fix from upstream bzr repository to fix comparisons of
      entries and hosted files with None (LP: #495326).
  * debian/control:
    - Bump Standards-Version to 3.8.4, no changes required.
  * Switch to format 3.0 (quilt).
 -- Ubuntu Archive Auto-Sync <email address hidden> Wed, 03 Feb 2010 23:38:15 +0000

Changed in lazr.restfulclient (Ubuntu):
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

Remote bug watches

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