Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close .git/index file descriptor #1394

Closed
wants to merge 1 commit into from

Conversation

skshetry
Copy link
Contributor

The index fd is not closed, which makes it fail on Windows with PermissionError:

E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\runneradmin\\AppData\\Local\\Temp\\pytest-of-runneradmin\\pytest-0\\test_commit_in_root_repo_with_0\\.git\\index'

and sometimes with not much information when using APIs that interact with git binary:

fatal: Unable to write new index file

Also see iterative/scmrepo#27 and conda-forge/gitpython-feedstock#62.

This regression was introduced on #1391 (specifically on d79d20d, and released on 3.1.25).

@Byron
Copy link
Member

Byron commented Jan 10, 2022

Thanks a lot for the fix. I thought that using try:finally might be even safer and implemented that in e16a004, which is why this PR has to be closed without merging.

A new release will be created within a couple of minutes.

@Byron Byron closed this Jan 10, 2022
@skshetry skshetry deleted the close-fd branch January 10, 2022 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants