JacquesLucke / blender_vscode

Visual Studio Code extension for Blender development.
MIT License
572 stars 75 forks source link

os.remove(link_path) unreliable #29

Open BlenderViza opened 5 years ago

BlenderViza commented 5 years ago

I had problems with os.remove(link_path):

File "C:\Users\BlenderViza\.vscode\extensions\jacqueslucke.blender-development-0.0.10\pythonFiles\include\blender_vscode\load_addons.py", line 39
=> PermissionError [WINERROR 5]

As administrator it deletes the targeted directory but not as user => unreliable!

My solution:

import shutil
shutil.rmtree(link_path) 
JacquesLucke commented 5 years ago

Thanks, not sure if there is a good way to fix it, will see.

tubiana commented 1 year ago

Hi, coming back on this issue, was it integrated ? Because I still have the same issue... Thank you :)

Mateusz-Grzelinski commented 2 months ago

shutil.rmtree will remove files what might lead to data loss, so I will not use that.

172 will help a little bit but #184 is really what will help here, but is very, very not ready.

At least that is what I think, because Permission error occurs in couple of different (very ugly) corner cases.