Issue #168 resolved

Event queue overflow not throwing exception

mikered549
created an issue

According to the documentation, "When the queue overflows an exception is thrown." however once the queue fills up and a new event should be added, it just silently fails to add it.

Simple test case:

import pygame
pygame.init()
scr = pygame.display.set_mode((300,300))
quit = False
while not quit:
  for event in pygame.event.get(pygame.QUIT):
    print 'This should quit.'
    quit = True
  pygame.display.flip()

Starting the program, then hitting the close button will close the program normally. Starting the program, then filling the queue by clicking on the window a lot makes hitting the close button do nothing at all.

Comments (5)

  1. illume

    I think this line in the docs needs to be fixed to match the behaviour.

    Something like this: "If you don't get events off the queue regularly, then new events just don't get put on the queue until you remove the events already on there."

  2. Lenard Lindstrom

    The Python exception is raised if pygame.event.post is called on a full event queue. It is not possible to raise an exception at the moment an event is dropped. SDL2 has a dynamically allocated queue, limited only by available memory.

  3. Lenard Lindstrom

    Clarify documentation for a full SDL event queue: resolve Issue #168

    Move the vague full event queue exception reference in the general event module description to the poll function doc where it belongs.

    Be more descriptive and specific about event queue overflow.

    → <<cset 8b608af0f35d>>

  4. Log in to comment