actually, let's make the open/fdopen a method

def _open_excl(self, path):
    return os.fdopenblahblah

Then that get's much easier to mock/stub for testing