Option to not raise if file does not exists for os.remove()?

Dec. 29, 2020
8:58 p.m.
What about a parameter, false by default, that suppresses the FileNotFoundError exception if true for os.remove()? Something similar to exist_ok for os.makedirs().

9:39 p.m.
Hi Sergio, The pathlib module includes this feature: https://docs.python.org/3/library/pathlib.html#pathlib.Path.unlink Best, Eelke On Tue, Dec 29, 2020, 22:12 Serhiy Storchaka <storchaka@gmail.com> wrote:

1:39 p.m.
Hi Sergio, The pathlib module includes this feature: https://docs.python.org/3/library/pathlib.html#pathlib.Path.unlink Best, Eelke On Tue, Dec 29, 2020, 22:12 Serhiy Storchaka <storchaka@gmail.com> wrote:
1538
Age (days ago)
1541
Last active (days ago)
3 comments
3 participants
participants (3)
-
Eelke van den Bos
-
Marco Sulla
-
Serhiy Storchaka