Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

GipPython lock folder with repo on windows so it could not be removed #387

Open
@Lehych

Description

@Lehych

Tested on

GitPython version: 1.0.2
Windows: Server 2012
Git: 2.7.0.windows

To reproduce

importosimportshutilfromgitimportRepopath_to_repo='somepath'r=Repo.init(path_to_repo)withfile(os.path.join(path_to_repo,'test.txt'),'a'):os.utime(os.path.join(path_to_repo,'test.txt'),None)r.index.add(['test.txt'])r.index.commit('Test commit')shutil.rmtree(path_to_repo)

you'll se
WindowsError: [Error 32] The process cannot access the file because it is being used by another process:
Also you'll see that there are four git subprocesses running until python process will be closed (I was using REPL and this subprocesses were hanging there until I closed REPL).

They aregit cat-file --batch-check andgit cat-file --batch.
On macos calling this example in REPL leads to appearing of two non finished git-processes too.

Process Explorer show that the folder (path_to_repo) is locked by 4 git processes.
gitpython_bug

Maybe there is concept that Repo should be closed somehow but i could not find that kind of API.

Some GitPython-tests fails with this error (tests run on master branch):

======================================================================ERROR: test_commit_serialization (git.test.performance.test_commit.TestPerformance)----------------------------------------------------------------------Traceback (most recent call last):  File "D:\gp\git\test\performance\lib.py", line 89, in tearDown    shutil.rmtree(self.gitrwrepo.working_dir)  File "c:\python27\Lib\shutil.py", line 256, in rmtree    onerror(os.rmdir, path, sys.exc_info())  File "c:\python27\Lib\shutil.py", line 254, in rmtree    os.rmdir(path)WindowsError: [Error 32] The process cannot access the file because it is being used by another process: 'c:\\users\\me\\appdata\\local\\temp\\3\\tmpdjaibf'-------------------- >> begin captured logging << --------------------root: INFO: You can set the GIT_PYTHON_TEST_GIT_REPO_BASE environment variable to a .git repository ofyour choice - defaulting to the gitpython repository--------------------- >> end captured logging << ---------------------======================================================================ERROR: test_large_data_streaming (git.test.performance.test_streams.TestObjDBPerformance)----------------------------------------------------------------------Traceback (most recent call last):  File "D:\gp\git\test\lib\helper.py", line 121, in repo_creator    return func(self, rw_repo)  File "D:\gp\git\test\performance\test_streams.py", line 90, in test_large_data_streaming    os.remove(db_file)WindowsError: [Error 32] The process cannot access the file because it is being used by another process: u'c:\\users\\me\\appdata\\local\\temp\\3\\tmpnylxewbare_test_large_data_streaming\\objects\\81\\7bd0459ba45c7186b5279fbacc69dc39c42efb'-------------------- >> begin captured logging << --------------------root: INFO: You can set the GIT_PYTHON_TEST_GIT_REPO_BASE environment variable to a .git repository ofyour choice - defaulting to the gitpython repository--------------------- >> end captured logging << ---------------------

P.S. I know it is a problem to test on windows platform. My colleague mentioned AppVeyor CI for windows CI.Pip-accel is using it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp