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

HBChannel._exiting = True, AttributeError: 'NoneType' object has no attribute '_exiting' #323

Closed
sebhahn opened this issue Dec 22, 2017 · 5 comments · Fixed by #336
Closed
Milestone

Comments

@sebhahn
Copy link

sebhahn commented Dec 22, 2017

I get the following problem after running python setup.py test. All the tests succeed, but this error message appears in the end.

Error in sys.exitfunc:
Traceback (most recent call last):
  File "/root/miniconda/envs/test_env/lib/python2.7/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
  File "/root/miniconda/envs/test_env/lib/python2.7/site-packages/jupyter_client/channels.py", line 83, in _notice_exit
    HBChannel._exiting = True
AttributeError: 'NoneType' object has no attribute '_exiting'
@takluyver
Copy link
Member

Errors like that can occur randomly when the interpreter is being torn down. I don't think there's an easy way to avoid them.

@sebhahn
Copy link
Author

sebhahn commented Jan 3, 2018

Maybe checking the attributes of HBChannel would be helpful avoiding the exception?

@takluyver
Copy link
Member

I think the trouble is that these kinds of errors can come from almost anywhere if code runs on shutdown, and I don't think it's worth trying to catch them. They're probably harmless, but if they're not (e.g. some files don't get cleaned up), it's better to see what went wrong than to hide it.

@sebhahn
Copy link
Author

sebhahn commented Jan 3, 2018

In my particular case I just run python setup.py test for a self-written python package which uses ipyparallel. The tests doesn't even contain an import jupyter statement, the code uses just import ipyparallel. Where/who needs to take care of this error in my case?

@minrk
Copy link
Member

minrk commented Jan 16, 2018

This can usually be avoided with a check or two at the highest level of atexit code. I think we can probably handle it.

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

Successfully merging a pull request may close this issue.

3 participants