File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 44#
55# This module is part of GitPython and is released under
66# the BSD License: http://www.opensource.org/licenses/bsd-license.php
7-
8- import git .objects .base as base
97import os
8+ import tempfile
109
10+ import git .objects .base as base
1111from git .test .lib import (
1212 TestBase ,
1313 assert_raises ,
@@ -69,10 +69,13 @@ def test_base_object(self):
6969 data = data_stream .read ()
7070 assert data
7171
72- tmpfile = os .tmpfile ()
72+ tmpfilename = tempfile .mktemp (suffix = 'test-stream' )
73+ tmpfile = open (tmpfilename , 'wb+' )
7374 assert item == item .stream_data (tmpfile )
7475 tmpfile .seek (0 )
7576 assert tmpfile .read () == data
77+ tmpfile .close ()
78+ os .remove (tmpfilename )
7679 # END stream to file directly
7780 # END for each object type to create
7881
@@ -113,7 +116,7 @@ def test_add_unicode(self, rw_repo):
113116 filename = u"שלום.txt"
114117
115118 file_path = os .path .join (rw_repo .working_dir , filename )
116- open (file_path , "wb" ).write ('something' )
119+ open (file_path , "wb" ).write (b 'something' )
117120
118121 rw_repo .git .add (rw_repo .working_dir )
119122 rw_repo .index .commit ('message' )
You can’t perform that action at this time.
0 commit comments