Skip to content

Conversation

@twangboy
Copy link
Contributor

What does this PR do?

Skips PermissionError when trying to delete the test directory after a test run. Git maintains open file handles on git index files causing the following stacktrace when trying to clean up:

:1183][ERROR   ] Failed to remove directory: C:\Users\ADMINI~1\AppData\Local\Temp\salt-tests-tmpdir
15:52:35         Traceback (most recent call last):
15:52:35           File "c:\users\admini~1\appdata\local\temp\kitchen\testing\.nox\runtests-parametrized-3-coverage-true-crypto-none-transport-zeromq\lib\shutil.py", line 387, in _rmtree_unsafe
15:52:35             os.unlink(fullname)
15:52:35         PermissionError: [WinError 5] Access is denied: 'C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\salt-tests-tmpdir\\tmp216ldwzw\\gitfs\\709b529e4651ea331ec097c44268cba9\\.git\\objects\\pack\\pack-1a59b5f484045d2294d42df3e17258d44443fa5d.idx'

What issues does this PR fix or reference?

gitpython-developers/GitPython#546

Commits signed with GPG?

Yes

@dwoz
Copy link
Contributor

dwoz commented Jul 17, 2019

OSError will already be caught by the general Exception catching.

@twangboy twangboy closed this May 8, 2020
@twangboy twangboy deleted the fix_clean_neon branch May 8, 2020 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants