Shouldn't there be an ``else:`` here that handles the case that it was a different kind of ``OSError``? I think what you have right now would allow that error to silently pass. Perhaps just a ``raise`` statement would take care of that.