[issue33123] Path.unlink should have a missing_ok parameter

2019-05-15 Thread Antoine Pitrou
Change by Antoine Pitrou : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue33123] Path.unlink should have a missing_ok parameter

2019-05-15 Thread miss-islington
miss-islington added the comment: New changeset d9e006bcefe6fac859b1b5d741725b9a91991044 by Miss Islington (bot) (‮zlohhcuB treboR) in branch 'master': bpo-33123: pathlib: Add missing_ok parameter to Path.unlink (GH-6191)

[issue33123] Path.unlink should have a missing_ok parameter

2018-07-17 Thread Daniel Pope
Daniel Pope added the comment: This would be a shortcut in the common case that you simply want an idempotent "make sure this file/symlink is gone" operation. There are already boolean options to enable idempotent behaviour in several pathlib implementations, such as mkdir(exist_ok=True)

[issue33123] Path.unlink should have a missing_ok parameter

2018-07-17 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It can be written as try: path.inlink() except FileNotFoundError: pass If you want to save few lines of code, you can use contextlib.suppress(). with suppress(FileNotFoundError): path.inlink() I suggest to close this issue. It

[issue33123] Path.unlink should have a missing_ok parameter

2018-07-17 Thread Daniel Pope
Change by Daniel Pope : -- nosy: +lordmauve ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue33123] Path.unlink should have a missing_ok parameter

2018-03-22 Thread Roundup Robot
Change by Roundup Robot : -- keywords: +patch pull_requests: +5938 stage: -> patch review ___ Python tracker ___

[issue33123] Path.unlink should have a missing_ok parameter

2018-03-22 Thread rbu
New submission from rbu : Similarly to how several pathlib file creation functions have an "exists_ok" parameter, we should introduce "missing_ok" that makes removal functions not raise an exception when a file or directory is already absent. IMHO, this should