Skip to content

Windows tests fail #655

Description

@techtonik

https://ci.appveyor.com/project/jdavid/pygit2/branch/master/job/pe30m4i7qwl2br64

Windows has a strict requirements that all files need to be closed when removing dir. https://superuser.com/questions/2937/how-do-i-delete-a-folder-thats-in-use

======================================================================
ERROR: test_write_commit (test.test_archive.ArchiveTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python35\lib\shutil.py", line 381, in _rmtree_unsafe
    os.unlink(fullname)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\tmp0up7s6rm\\testrepo\\.git\\objects\\pack\\pack-e6fbc15b315a0eab6005c44e5b7054b1f0043f39.idx'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "C:\projects\pygit2\test\utils.py", line 135, in tearDown
    self.repo_ctxtmgr.__exit__(None, None, None)
  File "C:\projects\pygit2\test\utils.py", line 86, in __exit__
    rmtree(self.temp_dir)
  File "C:\projects\pygit2\test\utils.py", line 65, in rmtree
    shutil.rmtree(path, onerror=onerror)
  File "C:\Python35\lib\shutil.py", line 488, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "C:\Python35\lib\shutil.py", line 378, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Python35\lib\shutil.py", line 378, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Python35\lib\shutil.py", line 378, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Python35\lib\shutil.py", line 378, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "C:\Python35\lib\shutil.py", line 383, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
  File "C:\projects\pygit2\test\utils.py", line 64, in <lambda>
    onerror = lambda func, path, e: force_rm_handle(func, path, e)
  File "C:\projects\pygit2\test\utils.py", line 47, in force_rm_handle
    remove_path(path)
PermissionError: [WinError 5] Access is denied: 'C:\\Users\\appveyor\\AppData\\Local\\Temp\\1\\tmp0up7s6rm\\testrepo\\.git\\objects\\pack\\pack-e6fbc15b315a0eab6005c44e5b7054b1f0043f39.idx'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions