When will os.remove fail?

Chris Angelico rosuav at gmail.com
Tue Mar 14 10:40:16 EDT 2017


On Wed, Mar 15, 2017 at 1:30 AM, Jon Ribbens <jon+usenet at unequivocal.eu> wrote:
> On 2017-03-14, Chris Angelico <rosuav at gmail.com> wrote:
>> On Wed, Mar 15, 2017 at 12:30 AM, Jon Ribbens <jon+usenet at unequivocal.eu> wrote:
>>> rm does not ask before deleting. However some Linux distributions
>>> take it upon themselves to put "alias rm='rm -i'" in /etc/profile.
>>
>> I have no such alias, but it still prompts.
>
> I'm think you must be mistaken. What do you see if you type
> 'alias rm' and 'which rm'? Are you perhaps trying to delete
> files to which you do not have write permission?

This conversation was specifically about files for which one does not
have write permission. So yes. (It's pretty common; .git/objects is
mostly or entirely made up of such files.)

ChrisA


More information about the Python-list mailing list