#1968 new defect

always use assertutil for assertions

Reported by: zooko Owned by:
Priority: minor Milestone: undecided
Component: code Version: 1.10.0
Keywords: Cc:
Launchpad Bug:

Description

Debugging #1742, we have the following report from a customer:

  File "/root/allmydata-tahoe-1.10.0/src/allmydata/mutable/retrieve.py", line 299, in _setup_download
    assert len(self.remaining_sharemap) >= k
exceptions.AssertionError: 

It would be helpful if we had instead received this from the customer:

  File "/root/allmydata-tahoe-1.10.0/src/allmydata/mutable/retrieve.py", line 299, in _setup_download
    _assert(len(self.remaining_sharemap) >= k, lenr=len(self.remaining_sharemap), k=k)
  File "/root/allmydata-tahoe-1.10.0/src/allmydata/util/assertutil.py", line 24, in _assert
    raise AssertionError, "".join(msgbuf)
AssertionError: lenr: 0 <type 'int'>, 'k': 1 <type 'int'>

Our wiki:CodingStandards doc says to use assertutil. To close this ticket, find all uses of assert in our codebase and change them to assertutil.

Change History (2)

comment:1 Changed at 2013-05-11T00:25:33Z by daira

This would also fix #1944.

comment:2 Changed at 2013-05-23T17:52:04Z by daira

This would also fix #1085.

Note: See TracTickets for help on using tickets.