changeset 986:9ce3f60410b4

more verbose failure
author Alain Mazy <am@orthanc.team>
date Fri, 25 Sep 2026 14:31:15 +0200
parents f9a5926ed466
children ea4b4ec7eef1
files Tests/Toolbox.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Tests/Toolbox.py	Fri Sep 25 12:56:59 2026 +0200
+++ b/Tests/Toolbox.py	Fri Sep 25 14:31:15 2026 +0200
@@ -415,12 +415,17 @@
 class ExternalCommandThread:
     @staticmethod
     def ExternalCommandFunction(arg, stop_event, command, env):
-        with open(os.devnull, 'w') as devnull:
-            external = subprocess.Popen(command, env = env, stderr = devnull)
+        with tempfile.TemporaryFile() as output:
+            external = subprocess.Popen(command, env = env, stderr = subprocess.STDOUT, stdout = output)
 
             while (not stop_event.is_set()):
                 error = external.poll()
                 if error != None:
+                    print('Error while executing external command: %s', command)
+                    output.seek(0)
+                    print("--------------")
+                    print(output.read())
+                    print("--------------")
                     # http://stackoverflow.com/a/1489838/881731
                     os._exit(-1)
                 stop_event.wait(0.1)