In AppHelper.runConsoleEventLoop() hangs cause by runLoop.limitDateForMode_(mode) returning bad date

Issue #117 resolved
Russell Valentine
created an issue

It seems in OSX 10.10 in runConsoleEventLoop() will hang forever. So AppHelper.stopEventLoop() does nothing.

In AppHelper.py around line 180

nextfire = runLoop.limitDateForMode_(mode)

nextfire ends up being an NSDate of 4001-01-01 00:00:00 +0000

And so:

if not runLoop.runMode_beforeDate_(mode, nextfire)

Never completes.

A workaround might be?

if not runLoop.runMode_beforeDate_(mode, NSDate.date()):

To replicate:

from PyObjCTools import AppHelper
AppHelper.runConsoleEventLoop()

Comments (6)

  1. Ronald Oussoren repo owner

    PyObjC 3.1 will contain a fix for this by adding a parameter to runConsoleEventloop that determines the maximum delay between calling stopEventloop and actually stopping the loop. The parameter defaults to a delay of 3 seconds.

  2. Log in to comment