TypeError when creating Lock.

Bug #827052 reported by Stephen A. Goss
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
flufl.lock
Fix Released
Medium
Barry Warsaw

Bug Description

I saw this message while running Mailman 3:

  File "/home/sgoss/phoenix-deploy/lib/python2.6/site-packages/flufl.lock-2.1-py2.6.egg/flufl/lock/_lockfile.py", line 345, in __enter__
    self.lock()
  File "/home/sgoss/phoenix-deploy/lib/python2.6/site-packages/flufl.lock-2.1-py2.6.egg/flufl/lock/_lockfile.py", line 273, in lock
    datetime.datetime.now() > self._releasetime + CLOCK_SLOP):
TypeError: unsupported operand type(s) for +: 'int' and 'datetime.timedelta'

This code failed since _releasetime is a property and can change between the first and second access here:

            if (self._releasetime != -1 and
                datetime.datetime.now() > self._releasetime + CLOCK_SLOP):

Revision history for this message
Barry Warsaw (barry) wrote :

Good catch! The fix is easy, but I want to see if I can think of a test.

Changed in flufl.lock:
status: New → Confirmed
importance: Undecided → Medium
assignee: nobody → Barry Warsaw (barry)
milestone: none → 2.1.1
Barry Warsaw (barry)
Changed in flufl.lock:
status: Confirmed → Fix Committed
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.