Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"OSError: [Errno 120] This function is not supported by the system." #64

Closed
retr0cube opened this issue Sep 1, 2021 · 8 comments
Closed

Comments

@retr0cube
Copy link

retr0cube commented Sep 1, 2021

Hi!
Whenever I try running create_project.py i get this error:

Traceback (most recent call last):
  File "test_project.py", line 14, in <module>
    add_on = create_project.CreateProject( "myaddon","mya")  #This Class Will create the project
  File "C:\Users\Retcy\Downloads\8. Coding Fun\neptune_api\neptune_lib\core\create_project.py", line 108, in __init__
    send2trash.send2trash(self.name)
  File "C:\Users\Retcy\AppData\Local\Programs\Python\Python37-32\lib\site-packages\send2trash\plat_win_legacy.py", line 146, in send2trash
    raise WindowsError(result, FormatError(result), paths)
OSError: [Errno 120] This function is not supported by the system.: ['C:\\Users\\Retcy\\DOWNLO~1\\8. Coding Fun\\neptune_api\\builds\\myaddon'] 

Code:
create_project.txt

@glubsy
Copy link

glubsy commented Sep 1, 2021

Might be a good idea to add more details here.

This is where the exception is raised:

if os.path.isdir(self.name):
    send2trash.send2trash(self.name)

@arsenetar
Copy link
Owner

@retr0cube To fully understand what is going on here we are going to need:

  • What OS version you are running (appears to be windows)
  • What version of send2trash you are using, you can get that via pip list if it was installed via pip

@glubsy The error actually should be coming up from the plat_win_legacy` line 146 (in versions that have a line 146), although why that error is coming up is unknown especially as "This function is not supported by the system.".

@arsenetar
Copy link
Owner

Looking into the error code it appears it is just being converted incorrectly 120 is actually DE_ACCESSDENIEDSRC | 0x78 | Security settings denied access to the source. based on https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shfileoperationw#return-value.

@retr0cube
Copy link
Author

retr0cube commented Sep 2, 2021

@arsenetar Hi! Sorry for late response btw :)

  • OS: I use Windows 10
  • Module Version: send2trash 1.7.1

Edit 1: Further testing i found that when you open the file you want to delete that error pops; But running the script again without accessing files everything runs fine, weird ?!

Edit 2: Maybe Permission issues ?

@retr0cube retr0cube changed the title " OSError: [Errno 120] This function is not supported by the system." "OSError: [Errno 120] This function is not supported by the system." Sep 2, 2021
@arsenetar
Copy link
Owner

Yeah it is a permission error, it seems the error string is converted incorrectly, will look into updating the conversion to be correct.

@retr0cube
Copy link
Author

@arsenetar hopefully will get updated very soon !
good luck !

@Merinorus
Copy link

Hi,
I just got the same error and fixed it. Check if python hasn't been blocked by the Windows Defender ransomware protection! You should authorize python to access controlled folders.

@python-dev-arpan
Copy link

Hi, I just got the same error and fixed it. Check if python hasn't been blocked by the Windows Defender ransomware protection! You should authorize python to access controlled folders.

It doesn't work I tried doing it. Still getting the same error OSError: [Errno 120] This function is not supported on this system.: ['C:\\Windows\\Temp\\SDIAG_~4'] I have asked this question on Stack Overflow but no good answer has popped out yet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants