Is there any way to tell python to clean up for exit without terminating the process ? Then you could flush everything and get all your finalizers called before calling sys._exit
On Fri, Jun 4, 2010 at 5:55 PM, Paul Molodowitch <[email protected]> wrote: > Hey Yukio - I can confirm your PyNode problem - it looks like it's > having a problem identifying the node type for some reason. I'll take > a closer look into it, hopefully have a fix up in the repo soon. > > As to your second question: > > YES! > > I made a post about that too > (http://groups.google.com/group/python_inside_maya/browse_thread/thread/87e342e461b0cd14/51acba49d8c4efeb?lnk=gst&q=segmentation#51acba49d8c4efeb), > and later submitted a report to Autodesk about it. They said they > were able to confirm the problem on their end as well. Their > suggestion, however, was to use os._exit(0). > > My response was: > > Hmm... well, I can confirm that os._exit will not raise a seg fault, > like sys.exit(); unfortunately, it raises other problems - for > instance, stdout / stderr buffers are not always correctly flushed. > This is because, unforuntely, os._exit is not a "clean" exit, but > quite the opposite - it does none of the standard python cleanup stuff > at exit, but instead is more akin to a process kill (except you can > specify an exit code). Additionally, we still have the problem of > ungraceful exits when an uncaught exception is raised. > > Is there no way to signal the maya application to terminate from > within python? This could be useful on it's own right, but would also > solve this issue - maya.standalone.initialize could register this maya > termination command to be called on exit with the atexit.register > method... > > Anyway, if you would like this fixed, please submit it to them as well! =) > > - Paul > > On Fri, Jun 4, 2010 at 3:19 AM, <[email protected]> wrote: >> Hi there >> >> we`ve got some errors with some nodes and pymel-1.0.2 >> >> as far the following nodes will raise KeyError: 'MObjectHandle' >> [u'angleDimension', u'clusterFlexorShape', u'collisionModel', u'dynHolder', >> u'oldNormalConstraint', u'oldTangentConstraint'] >> >> for example: >> >> import maya.cmds as mc >> from pymel.core import PyNode >> >> testNode = mc.createNode('angleDimension') >> test = PyNode(testNode) >> test.name() >> >> or: >> import maya.cmds as mc >> from pymel.core import PyNode >> failed = [] >> for node in [u'angleDimension', u'clusterFlexorShape', u'collisionModel', >> u'dynHolder', u'oldNormalConstraint', u'oldTangentConstraint']: >> testNode = mc.createNode(node) >> try: >> test = PyNode(testNode) >> print test.name() >> except: >> failed.append(node) >> >> mc.delete(testNode) >> >> print "failed: " >> print failed >> >> anybody got the same issues? >> >> and now for something completely different: >> >> anybody having seg faults with mayapy (2011) on linux after >> import maya.standalone >> maya.standalone.initialize() >> .... >> ... >> quit() >> >> the famous Signal: 11 >> >> cheers, >> yukio >> >> -- >> http://groups.google.com/group/python_inside_maya > > -- > http://groups.google.com/group/python_inside_maya -- http://groups.google.com/group/python_inside_maya
