Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit78d63d9

Browse files
committed
Let close_fds be True on all platforms
Since Python 3.7, subprocess.Popen supports close_fds=True on allplatforms, including Windows, and it is the default, includingwhen arguments for standard streams have non-None values passed.3.7 is the lowest version of Python that GitPython supports. Sothis omits the close_fds=True argument from the calls where it waspresent. This has the same effect (in 3.7 and higher) as passingclose_fds=True.When the the close_fd argument was added to the Popen call ingit.cmd.Git.execute in1ee2afb, Python 2 was still supported. InPython 2, close_fds defaulted to False. This appears to be thereason it had been passed explicitly. It was conditioned on beingon a Unix-like system because having it True on Windows wouldprevent stdin, stdout, or stderr redirection.
1 parent96acc22 commit78d63d9

File tree

2 files changed

+0
-2
lines changed

2 files changed

+0
-2
lines changed

‎git/cmd.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1001,7 +1001,6 @@ def execute(
10011001
stderr=PIPE,
10021002
stdout=stdout_sink,
10031003
shell=shell,
1004-
close_fds=(os.name=="posix"),# Unsupported on Windows.
10051004
universal_newlines=universal_newlines,
10061005
creationflags=PROC_CREATIONFLAGS,
10071006
**subprocess_kwargs,

‎git/index/fun.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,6 @@ def run_commit_hook(name: str, index: "IndexFile", *args: str) -> None:
102102
stdout=subprocess.PIPE,
103103
stderr=subprocess.PIPE,
104104
cwd=index.repo.working_dir,
105-
close_fds=(os.name=="posix"),
106105
creationflags=PROC_CREATIONFLAGS,
107106
)
108107
exceptExceptionasex:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp