Resolve Python - Threading

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

creonovo

  • Posts: 6
  • Joined: Wed Sep 18, 2013 7:26 pm
  • Real Name: Ari Brown

Resolve Python - Threading

PostFri Dec 22, 2023 8:25 pm

I'm trying to run some subprocesses using the Python threading module. The threading does spawn the subprocesses, however the communication from the subprocess doesn't seem to return back. I'm not able to get the stdout or stderr from the threaded subprocesses.
This all works without issue if I were to run the script from either a terminal or VSCode, however when trying to run the script through Resolve, I don't get the communication back from the threads.
Is there any workaround for this, or something I can do differently so I can properly spawn all of my subprocesses?
Offline

creonovo

  • Posts: 6
  • Joined: Wed Sep 18, 2013 7:26 pm
  • Real Name: Ari Brown

Re: Resolve Python - Threading

PostThu Dec 28, 2023 5:14 pm

Following up on my own post - I believe I found the issue causing this in case it is helpful for anyone else:

If using threading and any of the subprocesses such as subprocess.Popen, it appears that if you use any logging or print statements within the subprocess it interrupts the process from finishing. As soon as those were removed all of the communication returned back outside of the threads.
This is only the case when the scripts are run within Resolve. Everything works correctly being run via terminal or VScode outside of Resolve.

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 20 guests