don't catch the OSError; it causes an infinite loop