Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork938
FIx issue #464 corrupt log file#469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
e0eafc4
a7f403b
b4b5ecc
1116ef7
0d93908
d79951f
572ebd6
8bde103
d8ef023
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -43,6 +43,9 @@ | ||
safe_decode, | ||
) | ||
# value of Windows process creation flag taken from MSDN | ||
CREATE_NO_WINDOW = 0x08000000 | ||
execute_kwargs = ('istream', 'with_keep_cwd', 'with_extended_output', | ||
'with_exceptions', 'as_process', 'stdout_as_string', | ||
'output_stream', 'with_stdout', 'kill_after_timeout', | ||
@@ -609,6 +612,11 @@ def execute(self, command, | ||
# end handle | ||
try: | ||
if sys.platform == 'win32': | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Generally for these kinds of assignment, I believe it's easier to read by starting out like this: creationflags=Noneifsys.platform=='win32':creationflags=CREATE_NO_WINDOW | ||
creationflags = CREATE_NO_WINDOW | ||
else: | ||
creationflags = 0 | ||
proc = Popen(command, | ||
env=env, | ||
cwd=cwd, | ||
@@ -619,6 +627,7 @@ def execute(self, command, | ||
shell=self.USE_SHELL, | ||
close_fds=(os.name == 'posix'), # unsupported on windows | ||
universal_newlines=universal_newlines, | ||
creationflags=creationflags, | ||
**subprocess_kwargs | ||
) | ||
except cmd_not_found_exception as err: | ||
@@ -629,7 +638,12 @@ def execute(self, command, | ||
def _kill_process(pid): | ||
""" Callback method to kill a process. """ | ||
if sys.platform == 'win32': | ||
creationflags = CREATE_NO_WINDOW | ||
else: | ||
creationflags = 0 | ||
p = Popen(['ps', '--ppid', str(pid)], stdout=PIPE, creationflags=creationflags) | ||
child_pids = [] | ||
for line in p.stdout: | ||
if len(line.split()) > 0: | ||