[New-bugs-announce] [issue20126] sched doesn't handle events added after scheduler starts

lotus@blossomhillranch.com report at bugs.python.org
Sun Jan 5 04:00:23 CET 2014


New submission from lotus at blossomhillranch.com:

Events added after the scheduler is running, with a delay value before the next event, do not run at the correct time.

import sched
import time
import threading

def event( eventNum ):
	print( 'event', eventNum, time.time() )

s = sched.scheduler()
s.enter( 0,1,event, (0,) )
s.enter(10,1,event, (1,) )
t = threading.Thread( target = s.run )
t.start()
s.enter( 5,1,event, (2,) )


OUTPUT
event 0 1388890197.7716181
event 2 1388890207.7340584
event 1 1388890207.7347224

----------
messages: 207336
nosy: lotus at blossomhillranch.com
priority: normal
severity: normal
status: open
title: sched doesn't handle events added after scheduler starts
type: behavior
versions: Python 3.3

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20126>
_______________________________________


More information about the New-bugs-announce mailing list