Hi
I’m making a small plugin for meshroom_batch. For some reason the executable throws an “UnboundLocalError” all the time.
So i have a callback like this:
self.AddStdoutHandlerCallback( ".*UnboundLocalError.*" ).HandleCallback += self.HandleStdoutError
And I found some code here to handle it:
def HandleStdoutError( self ):
errorMessage = self.GetRegexMatch( 0 )
ignorePhrases = ['unboundlocalerror']
for phrase in ignorePhrases:
if phrase in errorMessage.lower():
self.LogWarning( "Ignoring error: %s" % errorMessage )
return
But in the log it seems that the executable throws the error after it has been caught by the handler:
STDOUT: Traceback (most recent call last):
STDOUT: File "d:\release\BUILD\meshroom\venv\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 40, in run
STDOUT: File "d:\release\BUILD\meshroom\venv\lib\site-packages\cx_Freeze\initscripts\Console.py", line 37, in run
STDOUT: File "bin/meshroom_batch", line 206, in <module>
STDOUT: File "d:\release\BUILD\meshroom\meshroom\core\taskManager.py", line 234, in compute
WARNING: Ignoring error: UnboundLocalError: local variable 'allReady' referenced before assignment
STDOUT: UnboundLocalError: local variable 'allReady' referenced before assignment
So at the end of the process the plugin still shows a:
INFO: Process exit code: 1
...
Scheduler Thread - Render Thread 0 threw a major error:
And the job s rescheduled. Even though all the files have been processed and written to disk successfully.
I also tried to ignore the exitCode like this:
def CheckExitCode( self, exitCode ):
if exitCode != 0 and exitCode != 1:
self.FailRender( "Renderer returned non-zero error code %d. Check the renderer's output." % exitCode )
But it doesn’t seem to do the trick. Am I doing something wrong in the way I’m trying to catch this error or is this the executable messing with order in which it reports to the stdout that messes this up?
So if there is a way to surpress this error i would be very happy to know.
Any help appreciated.
I’ve also posted on the meshroom github repo to see if im doing something wrong with the way i pass arguments to the executable. No answers yet.
Regards
Bonsak