audioread icon indicating copy to clipboard operation
audioread copied to clipboard

WindowsError: [Error 5] Access is denied

Open Saw-mon-and-Natalie opened this issue 8 years ago • 1 comments

I get this error from ffedc.py:

  File "C:\Python27\lib\site-packages\audioread\ffdec.py", line 279, in __exit__
    self.close()
  File "C:\Python27\lib\site-packages\audioread\ffdec.py", line 263, in close
    self.proc.kill()
  File "C:\Python27\lib\subprocess.py", line 1002, in terminate
    _subprocess.TerminateProcess(self._handle, 1)
WindowsError: [Error 5] Access is denied

I've been searching how to resolve it and found this on stackoverflow: https://stackoverflow.com/questions/17076679/windowserror-access-is-denied-on-calling-process-terminate

But even trying this try-catch trick doesn't work when I modify ffdec.py. Looks like issue might be related to this: https://stackoverflow.com/questions/5573257/windowserror-error-5-access-is-denied-when-trying-to-kill-a-subprocess-pytho

But still don't know how to resolve. I tried running my code with admin privileges too and I have all the permissions to modify my file.

Saw-mon-and-Natalie avatar Jul 29 '17 20:07 Saw-mon-and-Natalie

Thanks for the report! This sounds related to #51, although that one is in the context of WSL.

I don't have a lot to offer because I don't have a Windows machine to test on, but it might be the case that this happens when the process has already exited. Catching the exception and ignoring it would then be OK. Could you please open a PR with the try/catch addition you tried so we can take a look?

sampsyo avatar Jul 31 '17 14:07 sampsyo