File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 11import time
22import os
33from typing import List , Union
4+ import subprocess
45
56
67class PBSJob :
@@ -136,7 +137,13 @@ def _job_is_still_running_or_queued(self):
136137 return False
137138
138139 def _run_qstat_to_get_full_job_attributes (self ) -> Union [List [str ], str ]:
139- return os .popen (f"qstat -xf { self .id } " ).read ().split ("\n " )
140+ result = subprocess .run (
141+ ["qstat" , "-xf" , str (self .id )],
142+ stdout = subprocess .PIPE ,
143+ stderr = subprocess .PIPE ,
144+ text = False , # Disable automatic decoding
145+ )
146+ return result .stdout .decode ("utf-8" , errors = "replace" ).split ("\n " )
140147
141148 def _is_a_known_job (self , qstat_output ):
142149 return not "Unknown Job Id" in qstat_output
Original file line number Diff line number Diff line change 4343
4444
4545__package_name__ = "pbs4py"
46- __package_version__ = "1.0.7 "
46+ __package_version__ = "1.0.8 "
4747
4848root = os .path .abspath (os .path .dirname (__file__ ))
4949with open (os .path .join (root , "README.md" ), encoding = "utf-8" ) as f :
You can’t perform that action at this time.
0 commit comments