classification
Title: heapq.heappush called with too few arguments in sched.py
Type: crash Stage:
Components: Library (Lib) Versions: Python 3.0, Python 2.6, Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, mthard, rbp
Priority: normal Keywords: patch

Created on 2008-05-09 15:27 by mthard, last changed 2008-05-11 15:22 by georg.brandl. This issue is now closed.

Files
File name Uploaded Description Edit
sched.py.patch mthard, 2008-05-09 15:27 Patch to sched.py
sched.py.patch-r252 rbp, 2008-05-10 14:04 Patch to sched.py on Python 2.5.2
Messages (3)
msg66480 - (view) Author: Matt Harden (mthard) Date: 2008-05-09 15:27
In the method scheduler.run in the sched module, heapq.heappush is
called with single argument (event).  It's a two argument function.  The
correct call would be heapq.heappush(q, event).

This problem is probably not frequently experienced because it only
occurs if the delay function modifies the queue, deleting the top entry
while sched.run() is waiting to execute it.

A patch is attached based on the trunk.
msg66524 - (view) Author: Rodrigo Bernardo Pimentel (rbp) (Python committer) Date: 2008-05-10 14:04
+1 on the patch.

IIRC, there won't be any more bugfix releases for 2.5.x, but, just in
case: the patch doesn't work on 2.5 (though the issue lists it as an
affected version - and it is!), so I'm uploading a patch for it (svn tag
r252).

I started writing a test for it, but it's such an obvious and trivial
patch that I think it's unnecessary.
msg66640 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-05-11 15:22
Thanks, fixed in r63070, r63071 (2.5).
History
Date User Action Args
2008-05-11 15:22:05georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg66640
nosy: + georg.brandl
2008-05-10 14:04:17rbpsetfiles: + sched.py.patch-r252
nosy: + rbp
messages: + msg66524
2008-05-09 15:27:03mthardcreate