@@ -96,7 +96,7 @@ def __init__(
9696 'sigterm_timeout' , default = 5 ),
9797 sigkill_timeout : SomeSubstitutionsType = LaunchConfiguration (
9898 'sigkill_timeout' , default = 5 ),
99- emulate_tty : bool = False ,
99+ emulate_tty : bool = True ,
100100 prefix : Optional [SomeSubstitutionsType ] = None ,
101101 output : Text = 'log' ,
102102 output_format : Text = '[{this.name}] {line}' ,
@@ -175,7 +175,7 @@ def __init__(
175175 as a string or a list of strings and Substitutions to be resolved
176176 at runtime, defaults to the LaunchConfiguration called
177177 'sigkill_timeout'
178- :param: emulate_tty emulate a tty (terminal), defaults to False , but can
178+ :param: emulate_tty emulate a tty (terminal), defaults to True , but can
179179 be overridden with the LaunchConfiguration called 'emulate_tty',
180180 the value of which is evaluated as true or false according to
181181 :py:func:`evaluate_condition_expression`.
@@ -345,6 +345,8 @@ def __on_signal_process_event(
345345 raise RuntimeError ('Signal event received before execution.' )
346346 if self ._subprocess_transport is None :
347347 raise RuntimeError ('Signal event received before subprocess transport available.' )
348+ if self ._subprocess_protocol is None :
349+ raise RuntimeError ('Signal event received before subprocess protocol available.' )
348350 if self ._subprocess_protocol .complete .done ():
349351 # the process is done or is cleaning up, no need to signal
350352 self .__logger .debug (
@@ -390,6 +392,8 @@ def __on_process_stdin(
390392 def __on_process_stdout (
391393 self , event : ProcessIO
392394 ) -> Optional [SomeActionsType ]:
395+ if self .__stdout_buffer .closed :
396+ raise RuntimeError ('OnProcessIO (stdout) received after stdout buffer closed.' )
393397 self .__stdout_buffer .write (event .text .decode (errors = 'replace' ))
394398 self .__stdout_buffer .seek (0 )
395399 last_line = None
@@ -409,6 +413,8 @@ def __on_process_stdout(
409413 def __on_process_stderr (
410414 self , event : ProcessIO
411415 ) -> Optional [SomeActionsType ]:
416+ if self .__stderr_buffer .closed :
417+ raise RuntimeError ('OnProcessIO (stderr) received after stderr buffer closed.' )
412418 self .__stderr_buffer .write (event .text .decode (errors = 'replace' ))
413419 self .__stderr_buffer .seek (0 )
414420 last_line = None
0 commit comments