-
-
Notifications
You must be signed in to change notification settings - Fork 919
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIx issue #464 corrupt log file #469
Changes from 5 commits
e0eafc4
a7f403b
b4b5ecc
1116ef7
0d93908
d79951f
572ebd6
8bde103
d8ef023
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -609,6 +609,12 @@ def execute(self, command, | |
# end handle | ||
|
||
try: | ||
if sys.platform == 'win32': | ||
CREATE_NO_WINDOW = 0x08000000 | ||
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.
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. I intended to provide a obvious patch. You usually change my process control patches so I left that for you to decide on where you wished to define CREATE_NO_WINDOW. |
||
creationflags = CREATE_NO_WINDOW | ||
else: | ||
creationflags = None | ||
|
||
proc = Popen(command, | ||
env=env, | ||
cwd=cwd, | ||
|
@@ -619,6 +625,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 +636,13 @@ def execute(self, command, | |
|
||
def _kill_process(pid): | ||
""" Callback method to kill a process. """ | ||
p = Popen(['ps', '--ppid', str(pid)], stdout=PIPE) | ||
if sys.platform == 'win32': | ||
CREATE_NO_WINDOW = 0x08000000 | ||
creationflags = CREATE_NO_WINDOW | ||
else: | ||
creationflags = None | ||
|
||
p = Popen(['ps', '--ppid', str(pid)], stdout=PIPE, creationflags) | ||
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. I am afraid that using 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. This concern is reflected in actual breakage as well: https://travis-ci.org/gitpython-developers/GitPython/jobs/148304657#L318 |
||
child_pids = [] | ||
for line in p.stdout: | ||
if len(line.split()) > 0: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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: