non-blocking, and again probably just me being picky - please ignore if you like.

1.  file is a reserved keyword in python, and I generally dislike overriding special names
2.  would it make sense to put the try/except inside the loop, so that the scope is slightly more clear?  In the except, file is definitely going to be correctly set because it is the last value that was assigned before the loop terminated due to an exception, but if the try-except were inside the loop it might be more explicit and obvious?  And the except terminates execution of the rest of the function anyway.