tokejepsen Posted May 26, 2016 Report Posted May 26, 2016 I'm trying to query an executable and get the output of that query. When I try to do any form of stdout from subprocess like, PIPE or stdout to file, and run through ftrack connect it fails. I'm currently working around the problem by using os.system, with a command that outputs to a file.
Mattias Lagergren Posted May 30, 2016 Report Posted May 30, 2016 On 5/26/2016 at 6:27 PM, tokejepsen said: When I try to do any form of stdout from subprocess like, PIPE or stdout to file, and run through ftrack connect it fails. Could you supply some source code examples that I can try with?
tokejepsen Posted May 30, 2016 Author Report Posted May 30, 2016 This action generates titles for movies and image sequences via Image Magick; https://bitbucket.org/tokejepsen/ftrack-hooks/src/b636c49593d667b44cd25c3db404ebfe1393b141/generate_titles.py?fileviewer=file-view-default When running it through ftrack connect and you use subprocess instead of these lines; https://bitbucket.org/tokejepsen/ftrack-hooks/src/b636c49593d667b44cd25c3db404ebfe1393b141/generate_titles.py?fileviewer=file-view-default#generate_titles.py-59:65, it fails the execution/job.
Mattias Lagergren Posted May 31, 2016 Report Posted May 31, 2016 And no output, error code why it fails?
tokejepsen Posted June 1, 2016 Author Report Posted June 1, 2016 Get this interesting error; tog/tog_ep001_StarCatching/sc010/sc010sh010/animation/v006 Traceback (most recent call last): File "K:\development\tools\ftrack\ftrack-hooks\generate_titles.py", line 141, in create_job south_west_text, south_east_text, north_west_text) File "K:\development\tools\ftrack\ftrack-hooks\generate_titles.py", line 60, in generate_title resolution = subprocess.check_output([os.path.join(image_magick_dir, 'identify.exe'), '-format', '%wx%h', '%s[1]' % input_file]) File "C:\Python27\lib\subprocess.py", line 566, in check_output process = Popen(stdout=PIPE, *popenargs, **kwargs) File "C:\Python27\lib\subprocess.py", line 702, in __init__ errread, errwrite), to_close = self._get_handles(stdin, stdout, stderr) File "C:\Python27\lib\subprocess.py", line 833, in _get_handles p2cread = self._make_inheritable(p2cread) File "C:\Python27\lib\subprocess.py", line 884, in _make_inheritable _subprocess.DUPLICATE_SAME_ACCESS) WindowsError: [Error 6] The handle is invalid Seems to be something to do with ftrack-connect running without a console, I think
Mattias Lagergren Posted June 2, 2016 Report Posted June 2, 2016 Odd, nothing I've seen before. Let me know if you get any further with subprocess!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.