Skip to content

Commit 8f23007

Browse files
committed
Merge branch 'master' of https://github.com/bastibe/python-soundfile into v310
2 parents 6b2707b + cfed1c5 commit 8f23007

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/test_soundfile.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,12 @@ def _file_existing(request, filename, fdarg, objarg=None):
4646
fd = os.open(filename, fdarg)
4747

4848
def finalizer():
49-
with pytest.raises(OSError):
49+
# On Windows Server 2025, os.close() on an already-closed fd does
50+
# not raise OSError, so we close it silently to avoid resource leaks.
51+
try:
5052
os.close(fd)
53+
except OSError:
54+
pass
5155

5256
request.addfinalizer(finalizer)
5357
return fd

0 commit comments

Comments
 (0)