def callback(data, *args, **kwargs):
    eventq.put(('Got data', data))
if timerthread[0] is not None:
    timerthread[0].cancel()
timerthread[0] = threading.Timer(30, timeout)
timerthread[0].start()
timerthread[0].start()
ftpc.retrbinary('RETR %s' % (somefile,), callback)
timerthread[0].cancel()
How to detect ftp server timeouts in Python