[issue38868] Shutil cannot delete a folder that contains an .ini file

2019-12-06 Thread Svetlana Vodianova
Svetlana Vodianova added the comment: I think eryksun is correct. I agree. The code sample provided by him, and the Python docs, mean I'm able to remove a folder with a .ini file without getting WinError 5. I should mark this as closed as he solved my problem. -- stage: ->

[issue38868] Shutil cannot delete a folder that contains an .ini file

2019-12-01 Thread Bruno P. Kinoshita
Bruno P. Kinoshita added the comment: I think eryksun is correct. Reproduced it locally. Setting to read-only initially did not raise the issue, but then as administrator I removed the inherited permissions and set it to read-only for my user, then it raised the exact same WinError 5

[issue38868] Shutil cannot delete a folder that contains an .ini file

2019-11-22 Thread Eryk Sun
Eryk Sun added the comment: The directory probably has the "readonly" attribute set. The documentation includes a basic remove_readonly error handler for rmtree [1]: import os, stat import shutil def remove_readonly(func, path, _): "Clear the readonly bit and

[issue38868] Shutil cannot delete a folder that contains an .ini file

2019-11-21 Thread Svetlana Vodianova
Svetlana Vodianova added the comment: What is the system error code (winerror) of the PermissionError? PermissionError: [WinError 5] Access is denied Note: Please ignore my first post (msg357097) describing the problem, I made a few mistakes that might be confusing. msg357099 better

[issue38868] Shutil cannot delete a folder that contains an .ini file

2019-11-20 Thread Eryk Sun
Eryk Sun added the comment: What is the system error code (winerror) of the PermissionError? -- nosy: +eryksun ___ Python tracker ___

[issue38868] Shutil cannot delete a folder that contains an .ini file

2019-11-20 Thread Svetlana Vodianova
Svetlana Vodianova added the comment: I posted my problem on Stack Overflow, but as of right now haven't received any answers. Link: https://stackoverflow.com/questions/58922332/shutil-cannot-delete-a-folder-with-a-hidden-desktop-ini-file To summarize my problem: If you use copytree to

[issue38868] Shutil cannot delete a folder that contains an .ini file

2019-11-20 Thread Svetlana Vodianova
New submission from Svetlana Vodianova : I posted my problem on Stack Overflow, but as of right now haven't received any answers. Link: https://stackoverflow.com/questions/58922332/shutil-cannot-delete-a-folder-with-a-hidden-desktop-ini-file To summarize my problem: If you use copytree to