Skip to content

Commit 01a245b

Browse files
Merge pull request #404 from TheTripleV/fix-403
#Fix 403: Close file descriptor before terminating process
2 parents 0df34c7 + d649790 commit 01a245b

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/setuptools_scm/file_finder_git.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ def _git_ls_files_and_dirs(toplevel):
5050
return _git_interpret_archive(proc.stdout, toplevel)
5151
finally:
5252
# ensure we avoid resource warnings by cleaning up the process
53+
proc.stdout.close()
5354
proc.terminate()
5455
except Exception:
5556
if proc.wait() != 0:

testing/test_git.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def test_root_relative_to(tmpdir, wd, monkeypatch):
4646

4747

4848
@pytest.mark.issue("https://github.com/pypa/setuptools_scm/issues/298")
49+
@pytest.mark.issue(403)
4950
def test_file_finder_no_history(wd, caplog):
5051
file_list = git_find_files(str(wd.cwd))
5152
assert file_list == []

0 commit comments

Comments
 (0)