Skip to content

Commit a63858b

Browse files
Merge pull request #1172 from RonnyPfannschmidt/unraisable
chore: allow unraisable exceptions again, seems we no longer trigger the error
2 parents a0a54d2 + 2aee615 commit a63858b

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

.github/workflows/python-tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ jobs:
4444
include:
4545
- os: windows-latest
4646
python_version: 'msys2'
47+
env:
48+
# Enable tracemalloc to debug gc errors with popen objects (especially on Windows)
49+
PYTHONTRACEMALLOC: "1"
4750

4851
name: ${{ matrix.os }} - Python ${{ matrix.python_version }}
4952
steps:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ filterwarnings = [
164164
log_level = "debug"
165165
log_cli_level = "info"
166166
# disable unraisable until investigated
167-
addopts = ["-ra", "--strict-config", "--strict-markers", "-p", "no:unraisableexception"]
167+
addopts = ["-ra", "--strict-config", "--strict-markers"]
168168
markers = [
169169
"issue(id): reference to github issue",
170170
"skip_commit: allows to skip committing in the helpers",

src/setuptools_scm/_file_finders/git.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,16 @@ def _git_ls_files_and_dirs(toplevel: str) -> tuple[set[str], set[str]]:
8484
# ensure we avoid resource warnings by cleaning up the process
8585
proc.stdout.close()
8686
proc.terminate()
87+
# Wait for process to actually terminate and be reaped
88+
try:
89+
proc.wait(timeout=5) # Add timeout to avoid hanging
90+
except subprocess.TimeoutExpired:
91+
log.warning("git archive process did not terminate gracefully, killing")
92+
proc.kill()
93+
proc.wait()
8794
except Exception:
88-
if proc.wait() != 0:
95+
# proc.wait() already called in finally block, check if it failed
96+
if proc.returncode != 0:
8997
log.error("listing git files failed - pretending there aren't any")
9098
return set(), set()
9199

0 commit comments

Comments
 (0)