[Python-ideas] Add shutil.ignore_patterns() to shutil.rmtree()

George Fischhof george at fischhof.hu
Fri May 5 09:55:37 EDT 2017


2017-05-05 13:02 GMT+02:00 Oleg Broytman <phd at phdru.name>:

> Hi!
>
> On Fri, May 05, 2017 at 09:58:15AM +0200, George Fischhof <
> george at fischhof.hu> wrote:
> > Hi Folks,
> >
> > I have a task to synchronize folders but some files should be remained
> > untouched.
>
>    Synchronize folders using rmtree()? I don't get it.
>
> > I think this is a very common task.
>
>    I think it is not that common.
>
> > I found that shutil.copytree() has ignore_patterns() but rmtree() has
> not.
> >
> > So here comes my idea: add ignore_patterns() to rmtree() it is a good
>
>    rmtree() is like ``rm -r``, not like ``find . -name *.pyc -delete``.
>
> > feature and makes the functions symmetric.
>
>    Why impose artificial symmetry?
>
> > BR,
> > George
>
> Oleg.
> --
>      Oleg Broytman            http://phdru.name/            phd at phdru.name
>            Programmers don't die, they just GOSUB without RETURN.
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>



Actually it would be good if copytree() would be able to overwrite files
and directories.

George
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20170505/37077a6a/attachment-0001.html>


More information about the Python-ideas mailing list