[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gnulib-tool.py: Refactor directory tree removals
From: |
Bruno Haible |
Subject: |
Re: gnulib-tool.py: Refactor directory tree removals |
Date: |
Sat, 13 Apr 2024 13:02:52 +0200 |
Hi Collin,
> > + try:
> > + shutil.rmtree(dest)
> > + except FileNotFoundError:
> > + pass
>
> You should be able to use 'shutil.rmtree(dest, ignore_errors=True)'
> here [1]. Unless you have a reason for not doing so that I missed.
It can be useful to get PermissionError explicitly signalled.
I know that 'rm -rf' will just print an error message to stderr in this case.
If we ever find that we need better error handling than what 'rm -rf'
provides, we are ready to use shutil.rmtree.
Bruno