فهرست منبع

Close all mkstemp files.

Gary van der Merwé 10 سال پیش
والد
کامیت
b2c44f4288
3فایلهای تغییر یافته به همراه7 افزوده شده و 0 حذف شده
  1. 1 0
      dulwich/tests/test_hooks.py
  2. 5 0
      dulwich/tests/test_porcelain.py
  3. 1 0
      dulwich/tests/test_repository.py

+ 1 - 0
dulwich/tests/test_hooks.py

@@ -106,6 +106,7 @@ exit 0
     def test_hook_post_commit(self):
 
         (fd, path) = tempfile.mkstemp()
+        os.close(fd)
 
         post_commit_msg = """#!/bin/sh
 rm """ + path + "\n"

+ 5 - 0
dulwich/tests/test_porcelain.py

@@ -449,6 +449,7 @@ class PushTests(PorcelainTestCase):
 
         # create a second file to be pushed back to origin
         handle, fullpath = tempfile.mkstemp(dir=clone_path)
+        os.close(handle)
         porcelain.add(repo=clone_path, paths=[os.path.basename(fullpath)])
         porcelain.commit(repo=clone_path, message=b'push',
             author=b'', committer=b'')
@@ -481,6 +482,7 @@ class PullTests(PorcelainTestCase):
 
         # create a file for initial commit
         handle, fullpath = tempfile.mkstemp(dir=self.repo.path)
+        os.close(handle)
         filename = os.path.basename(fullpath)
         porcelain.add(repo=self.repo.path, paths=filename)
         porcelain.commit(repo=self.repo.path, message=b'test',
@@ -492,6 +494,7 @@ class PullTests(PorcelainTestCase):
 
         # create a second file to be pushed
         handle, fullpath = tempfile.mkstemp(dir=self.repo.path)
+        os.close(handle)
         filename = os.path.basename(fullpath)
         porcelain.add(repo=self.repo.path, paths=filename)
         porcelain.commit(repo=self.repo.path, message=b'test2',
@@ -687,6 +690,7 @@ class FetchTests(PorcelainTestCase):
 
         # create a file for initial commit
         handle, fullpath = tempfile.mkstemp(dir=self.repo.path)
+        os.close(handle)
         filename = os.path.basename(fullpath)
         porcelain.add(repo=self.repo.path, paths=filename)
         porcelain.commit(repo=self.repo.path, message=b'test',
@@ -699,6 +703,7 @@ class FetchTests(PorcelainTestCase):
 
         # create a second file to be pushed
         handle, fullpath = tempfile.mkstemp(dir=self.repo.path)
+        os.close(handle)
         filename = os.path.basename(fullpath)
         porcelain.add(repo=self.repo.path, paths=filename)
         porcelain.commit(repo=self.repo.path, message=b'test2',

+ 1 - 0
dulwich/tests/test_repository.py

@@ -501,6 +501,7 @@ exit 0
         self.addCleanup(shutil.rmtree, repo_dir)
 
         (fd, path) = tempfile.mkstemp(dir=repo_dir_str)
+        os.close(fd)
         post_commit_msg = """#!/bin/sh
 rm """ + path + """
 """