Error In Sys Exitfunc
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How to skip sys.exitfunc when unhandled exceptions occur up vote 4 down vote favorite As you can see, even after the program should have died it speaks from the grave. Is there a way to "deregister" the exitfunction in case of exceptions? import atexit def helloworld(): print("Hello World!") atexit.register(helloworld) raise Exception("Good bye cruel world!") outputs Traceback (most recent call last): File "test.py", line 8, in raise Exception("Good bye cruel world!") Exception: Good bye cruel world! Hello World! python exception atexit share|improve this question edited Oct 2 '15 at 5:45 Aniket Thakur 26.1k14113140 asked Sep 17 '08 at 8:05 pi. 9,37942343 add a comment| 3 Answers 3 active oldest votes up vote 5 down vote accepted I don't really know why you want to do that, but you can install an excepthook that will be called by Python whenever an uncatched exception is raised, and in it clear the array of registered function in the atexit module. Something like that : import sys import atexit def clear_atexit_excepthook(exctype, value, traceback): atexit._exithandlers[:] = [] sys.__excepthook__(exctype, value, traceback) def helloworld(): print "Hello world!" sys.excepthook = clear_atexit_excepthook atexit.register(helloworld) raise Exception("Good bye cruel world!") Beware that it may behave incorrectly if the exception is raised from an atexit registered function (but then the behaviour would have been strange even if this hook was not used). share|improve this answer answered Sep 17 '08 at 8:21 Sylvain Defresne 23.1k35474 add a comment| Did you find this question interesting? Try our newsletter Sign up for our n
[ subject ] [ author ] ----- Original Message ----- From: "Patrick McGarry" To: "张忠波" , "Ceph-User" Cc: "community" Sent: Tuesday, May 12, 2015 1:23:36 PM Subject: Re: [ceph-users] Error in sys.exitfunc Moving this to ceph-user where it belongs for eyeballs and responses. On Mon, May 11, 2015 at 10:39 PM, 张忠波 wrote: > Hi > When I run ceph-deploy , error will appear , http://stackoverflow.com/questions/80993/how-to-skip-sys-exitfunc-when-unhandled-exceptions-occur "Error in sys.exitfunc: " . > I find the same error message with me , > http://www.spinics.net/lists/ceph-devel/msg21388.html , but I cannot find > the way to solve this problem . It is not a problem, it is just a poor way that Python has to terminate threads. This is safe to ignore. > > CentOS release 6.6 http://lists.ceph.com/pipermail/ceph-users-ceph.com/2015-May/001449.html (Final) > > Python 2.6.6 > > ceph-deploy v1.5.19 > > Linux ceph1 3.10.77-1.el6.elrepo.x86_64 > > > I am looking forward for your reply ! > best wishes! > > zhongbo > > error message: > [root at ceph1 leadorceph]# ceph-deploy new mdsnode > [ceph_deploy.conf][DEBUG ] found configuration file at: > /root/.cephdeploy.conf > [ceph_deploy.cli][INFO ] Invoked (1.5.23): /usr/bin/ceph-deploy new mdsnode > [ceph_deploy.new][DEBUG ] Creating new cluster named ceph > [ceph_deploy.new][INFO ] making sure passwordless SSH succeeds > [mdsnode][DEBUG ] connected to host: ceph1 > [mdsnode][INFO ] Running command: ssh -CT -o BatchMode=yes mdsnode > [ceph_deploy.new][WARNIN] could not connect via SSH > [ceph_deploy.new][INFO ] will connect again with password prompt > root at mdsnode's password: > [mdsnode][DEBUG ] connected to host: mdsnode > [mdsnode][DEBUG ] detect platform information from remote host > [mdsnode][DEBUG ] detect machine type > [mdsnode][WARNIN] .ssh/authorized_keys does not exist, will skip adding keys > root at mdsnode's password: > root at mdsnode's password: > [mdsnode][DEBUG ] connected to host: mdsnode > [mdsnode][DEBUG ] detect platform i
2015-01-20 11:29:21 UTC PermalinkRaw Message Please advise.Thanks,-KarlFrom: Blake, Karl DSent: Monday, January 19, 2015 7:23 http://ceph-users.ceph.narkive.com/iKYrW5KR/error-in-sys-exitfunc PMTo: 'ceph-***@ceph.com'Subject: error in sys.exitfuncAnytime I run Ceph-deploy I get the above error. Can you help resolve?Thanks,-Karl Blake, Karl D 2015-01-20 15:46:37 UTC PermalinkRaw Message Error is same as this posted link - http://www.spinics.net/lists/ceph-devel/msg21388.htmlFrom: Blake, Karl DSent: Tuesday, January 20, 2015 4:29 AMTo: ceph-***@ceph.comSubject: RE: error in error in sys.exitfuncPlease advise.Thanks,-KarlFrom: Blake, Karl DSent: Monday, January 19, 2015 7:23 PMTo: 'ceph-***@ceph.com'Subject: error in sys.exitfuncAnytime I run Ceph-deploy I get the above error. Can you help resolve?Thanks,-Karl Travis Rhoden 2015-01-30 15:25:13 UTC PermalinkRaw Message Hi Karl,Sorry that I missed this go by. If you are still hitting error in sys this issue,I'd like to help you and figure this one out, especially since you arenot the only person to have hit it.Can you pass along your system details, (OS, version, etc.).I'd also like to know how you installed ceph-deploy (via RPM, or pip?).- TravisPost by Blake, Karl DError is same as this posted link -http://www.spinics.net/lists/ceph-devel/msg21388.htmlFrom: Blake, Karl DSent: Tuesday, January 20, 2015 4:29 AMSubject: RE: error in sys.exitfuncPlease advise.Thanks,-KarlFrom: Blake, Karl DSent: Monday, January 19, 2015 7:23 PMSubject: error in sys.exitfuncAnytime I run Ceph-deploy I get the above error. Can you help resolve?Thanks,-Karl_______________________________________________ceph-users mailing listhttp://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com 3 Replies 181 Views Switch to linear view Disable enhanced parsing Permalink to this page Thread Navigation Blake, Karl D 2015-01-20 02:22:38 UTC Blake, Karl D 2015-01-20 11:29:21 UTC Blake, Karl D 2015-01-20 15:46:37 UTC Travis Rhoden 2015-01-30 15:25:13 UTC about - legalese Loading...