[openstack-dev] [all] PYTHONDONTWRITEBYTECODE=true in tox.ini

Brant Knudson blk at acm.org
Mon Sep 15 21:02:42 UTC 2014


On Mon, Sep 15, 2014 at 1:25 PM, Eric Blake <eblake at redhat.com> wrote:

> On 09/15/2014 09:29 AM, Radomir Dopieralski wrote:
> > On 12/09/14 17:11, Doug Hellmann wrote:
> >
> >> I also use git-hooks with a post-checkout script to remove pyc files
> any time I change between branches, which is especially helpful if the
> different branches have code being moved around:
> >>
> >> git-hooks: https://github.com/icefox/git-hooks
> >>
> >> The script:
> >>
> >> $ cat ~/.git_hooks/post-checkout/remove_pyc
> >> #!/bin/sh
> >> echo "Removing pyc files from `pwd`"
> >> find . -name '*.pyc' | xargs rm -f
> >> exit 0
> >
> > Good thing that python modules can't have spaces in their names! But for
> > the future, find has a "-delete" parameter that won't break horribly on
> > strange filenames.
> >
> > find . -name '*.pyc' -delete
>
> GNU find has that as an extension, but POSIX does not guarantee it, and
> BSD find lacks it.
>
>
The workaround is -print0: find . -name '*.pyc' -print0 | xargs -0 rm -f

- Brant
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20140915/4e9e6da5/attachment.html>


More information about the OpenStack-dev mailing list