Skip to content

Commit 23f2bf4

Browse files
committed
Fix #399
1 parent e57cf46 commit 23f2bf4

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
v3.4.3
2+
======
3+
4+
* fix #399: ensure the git file finder closes file descriptor after reading archive
5+
16
v3.4.2
27
======
38

src/setuptools_scm/file_finder_git.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def _git_toplevel(path):
2828

2929

3030
def _git_interpret_archive(fd, toplevel):
31-
with tarfile.open(fileobj=fd, mode="r|*") as tf:
31+
with fd, tarfile.open(fileobj=fd, mode="r|*") as tf:
3232
git_files = set()
3333
git_dirs = {toplevel}
3434
for member in tf.getmembers():
@@ -49,7 +49,7 @@ def _git_ls_files_and_dirs(toplevel):
4949
try:
5050
return _git_interpret_archive(proc.stdout, toplevel)
5151
finally:
52-
# ensure we avoid ressource warnings by cleaning up the pocess
52+
# ensure we avoid resource warnings by cleaning up the pocess
5353
proc.wait()
5454
except Exception:
5555
if proc.wait() != 0:

0 commit comments

Comments
 (0)