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

Access is denied on Windows #8

Open
davidemf opened this issue Aug 2, 2016 · 5 comments
Open

Access is denied on Windows #8

davidemf opened this issue Aug 2, 2016 · 5 comments

Comments

@davidemf
Copy link

davidemf commented Aug 2, 2016

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.

@takluyver
Copy link
Member

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.

@ajasja
Copy link

ajasja commented May 4, 2017

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
Copy link

ajasja commented May 4, 2017

Using

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

is an ugly hack but does the trick...

@takluyver
Copy link
Member

Want to make a PR?

@ajasja
Copy link

ajasja commented May 4, 2017

Sure, that's an easy one:)

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

3 participants