• (nodebb)

    Frist,

    Also, it takes three parameters and uses one of them.

    As you see in the next snippet, it's an exception handler that's used with shutil.rmtree, so that's the parameter list it needs.

  • DanielOfMyr (unregistered)

    I'm curious about how and where this code is used

  • (nodebb) in reply to Dragnslcr

    Possibly it should do something with those parameters, though. The current logic is "if there's an error deleting a file, add write permission, and then delete it again". I don't think that will work anyway - IIRC you need write permission to the directory containing the file, not write permission to the file itself, to delete it. And if the error is due to something other than the file not being writable, deleting it again will still fail.

  • (nodebb) in reply to SteelCamel2

    IIRC you need write permission to the directory containing the file, not write permission to the file itself, to delete it

    In my experience, you need both write permissions (to the file and to the directory that contains the name that you want to delete(1).

    (1) That's not a circumlocution. If you want to delete the file, you have to delete all of its hard links.

Leave a comment on “Brillant Python Programmers”

Log In or post as a guest

Replying to comment #690966:

« Return to Article