In writing a replacement for tkDialog.askdirname() (needed because this is not Kanji -capable on Windows), I needed to work around a problem where os.listdir() will block indefinitely when a volume is not reachable. Looking for a cross-platform solution, I tried doing the os.lsitdir() within a thread, and then from the main thread, calling getdirThread.join(<some-timeout>), so I can continue without waiting for the network time-out.

On Windows this works fine, for both floppy drives and mapped network drives that are not reachable. However, on Mac OS X, if I mount a network volume, and then shut-down the network, the entire process seems to block: a print statement in the main thread never gets executed, that is right after getdirThread.run() and before getdirThread.join().

Thanks for any advice.
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to