Message260555
Eryk Sun: The patch proposes to add an unlink() call after the file has been closed:
except Exception:
_os.close(fd) # This automatically deletes the file right?
_os.unlink(name) # Won’t this raise FileNotFoundError?
raise
By your explanation, it sounds like it would be better to call unlink() before close().
Terry & Victor: Writing the explicit “except BaseException:” makes it clear you weren’t being lazy in figuring out what exceptions you want to catch. But in this case the “raise” at the end of the the exception handler make it clear enough for me. I would be happy with either option. |
|
Date |
User |
Action |
Args |
2016-02-20 03:55:50 | martin.panter | set | recipients:
+ martin.panter, terry.reedy, vstinner, SilentGhost, eryksun, Eugene Viktorov |
2016-02-20 03:55:50 | martin.panter | set | messageid: <1455940550.73.0.712086764938.issue26385@psf.upfronthosting.co.za> |
2016-02-20 03:55:50 | martin.panter | link | issue26385 messages |
2016-02-20 03:55:50 | martin.panter | create | |
|