One more patch before we release

Sebastian Spaeth Sebastian at SSpaeth.de
Tue Jan 25 12:23:08 GMT 2011


I am sorry to have a big patch, but I feel that this needs to go in
before the release. I just tested the current master branch and the
Curses.Blinkenlights ui is broken (offlineimap.ui.Curses gives an
ImportError).

This is due to cyclical import dependencies (threadutils pulls in ui and
the Curses ui imports threadutils.MultiLock), so it was pure luck that
this has previously worked.

I analyzed the lock usage, and fortunately we don't need the "MultiLock"
implementation at all. It is ONLY ever used by the Curses UI, and has
been in that code since 2005 at least. Python offers a RLock since at
least python 2.3.4 which does what we want. So I replaced the uses of
MultiLock with an RLock, and deleted our home-grown MultiLock
implementation.

I tested the Curses UI and it works again for me. So I would love to
have this patch being considered for pulling into master before we
release to not introduce a Curses UI regression.

Sebastian




More information about the OfflineIMAP-project mailing list