Menu

#15 Timeouts don't process in order

closed
None
8
2012-07-26
2012-04-16
No

The list of DelayedCommands tries to be sorted in _schedule_command() on irclib.py line 321, but it does nothing. This causes process_timeout() to break if the next command doesn't happen to be the first element. DelayedCommand needs cmp() defined for the sort to work.

d = []
bisect.insort(d, irclib.DelayedCommand(20, doit, tuple()))
bisect.insort(d, irclib.DelayedCommand(30, doit, tuple()))
bisect.insort(d, irclib.DelayedCommand(10, doit, tuple()))
bisect.insort(d, irclib.DelayedCommand(5, doit, tuple()))
[x.delay for x in d]
[30, 5, 20, 10]

Discussion

  • Jason R. Coombs

    Jason R. Coombs - 2012-04-17

    Thanks for the bug report. This will be fixed in the 0.6 line shortly.

     
  • Jason R. Coombs

    Jason R. Coombs - 2012-04-17

    Fixed in fd20aecc62ed.

     
Monday.com Logo