error handling when opening files

Alex Burke alexjeffburke at gmail.com
Wed Jul 9 15:59:49 EDT 2014


> Interestingly, did you know that even *closing* a file can fail?

No I didn't, interesting piece on information for sure! I thought close() is
usually made to always succeed regardless if it actually hosed up. Any
idea what the context manager will do in that case? (I ask as that
else-with form looks vulnerable in that case but may not be).

Thanks!



More information about the Python-list mailing list