Author alimpfard
Recipients alimpfard
Date 2022-01-10.09:01:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
`virtualenv --clear` is extremely eager to delete the passed directory without
any sort of confirmation, leading to possible data-loss
(e.g. with a mistyped command, or a misunderstanding of what it actually does).

Simply deleting an entire directory tree with a command that's extremely
prone to misunderstanding should not be virtualenv's job, but as it has
decided to make this its job, then it should take proper precautions to avoid
unintentional `rm -fr some-directory` by *at least* asking for confirmation.
The previous behaviour can of course, stay behind a `--force` flag for uses in
CI or similar, but this should *not* be the default behaviour.

related: mentions that
"[it is not] good practice to put non-virtual environment-related files into a
virtual environment", which is sensible, and so virtualenv should then simply
refuse to be instantiated in a non-empty directory.

On a more subjetive note, `virtualenv --clear <dir>` sounds like a way to purge the virtual environment files from a directory (yes, I understand what the help says, but that hardly changes anything), so perhaps a more verbose flag like "--clear-contents" would be more appropriate, but I digress.
Date User Action Args
2022-01-10 09:01:46alimpfardsetrecipients: + alimpfard
2022-01-10 09:01:46alimpfardsetmessageid: <>
2022-01-10 09:01:46alimpfardlinkissue46326 messages
2022-01-10 09:01:46alimpfardcreate