One thing you might try is experimenting with sys.setcheckinterval(), just to see what effect it might have, if any.
That does seem to have an impact. At 0, the problem was completely reproducible. At 100, I couldn't get it to occur.
If you try other values in between, can you directly affect the frequency of the failure? That would appear to suggest a race condition.
It's also possible there were some threading bugs in Py2.2 under Linux. Maybe you could repeat the test with a more recent version and see if you get different behaviour. (Not that that proves anything conclusively, but at least it might be a good solution for your immediate problem.)
2.3 (on the same machine) does seem better, even with setcheckinterval(0).
The default check interval was changed from 10 in version 2.2
and earlier to 100 in version 2.3. (See http://www.python.org/2.3/highlights.html for details.)
On the other hand, with version 2.3.4 under RH9, I tried values of 10 and 1 with no failures at any time. This might still be an issue with your own particular system, so having others try it out might be helpful...
-Peter -- http://mail.python.org/mailman/listinfo/python-list