nbmanager icon indicating copy to clipboard operation
nbmanager copied to clipboard

Access is denied on Windows

Open davidemf opened this issue 9 years ago • 5 comments

On Windows, I get a PermissionError "Access is denied":

Traceback (most recent call last):
  File "C:\Anaconda3\lib\site-packages\nbmanager-0.1-py3.5.egg\nbmanager\gui.py", line 148, in shutdown
  File "C:\Anaconda3\lib\site-packages\nbmanager-0.1-py3.5.egg\nbmanager\api.py", line 71, in shutdown
PermissionError: [WinError 5] Access is denied

I tried running the shell as Administrator but get the same problem.

The app crashes as a result of this.

davidemf avatar Aug 02 '16 10:08 davidemf

That line uses os.kill() to send a signal to a process. The Python docs have some pretty big caveats about os.kill() on Windows, so I guess we'd need something else, but I don't really know what.

takluyver avatar Aug 02 '16 10:08 takluyver

I get the same error. Will try to find a work around.

Traceback (most recent call last):
  File "c:\gits\nbmanager\nbmanager\gui.py", line 148, in shutdown
    server.shutdown(wait=False)
  File "c:\gits\nbmanager\nbmanager\api.py", line 76, in shutdown
    os.kill(self.pid, signal.SIGTERM)
PermissionError: [WinError 5] Access is denied

ajasja avatar May 04 '17 16:05 ajasja

Using

os.system("taskkill  /F /pid "+str(self.pid))

is an ugly hack but does the trick...

ajasja avatar May 04 '17 16:05 ajasja

Want to make a PR?

takluyver avatar May 04 '17 16:05 takluyver

Sure, that's an easy one:)

ajasja avatar May 04 '17 16:05 ajasja