@@ -43,10 +43,10 @@ def comparator_tmpdir(tmp_pathplus):
4343 fn = "FiLe" # Verify case-insensitive comparison
4444 else :
4545 fn = "file"
46- with open (os .path .join (dir , fn ), 'w' ) as output :
46+ with open (os .path .join (dir , fn ), 'w' , encoding = "UTF-8" ) as output :
4747 output .write ('Contents of file go here.\n ' )
4848
49- with open (os .path .join (data .dir_diff , "file2" ), 'w' ) as output :
49+ with open (os .path .join (data .dir_diff , "file2" ), 'w' , encoding = "UTF-8" ) as output :
5050 output .write ('An extra file.\n ' )
5151
5252 return data
@@ -85,7 +85,7 @@ def test_cmpfiles(self, comparator_tmpdir):
8585 ), "Comparing directory to same fails"
8686
8787 # Add different file2
88- with open (os .path .join (comparator_tmpdir .dir , "file2" ), 'w' ) as output :
88+ with open (os .path .join (comparator_tmpdir .dir , "file2" ), 'w' , encoding = "UTF-8" ) as output :
8989 output .write ('Different contents.\n ' )
9090
9191 assert filecmp .cmpfiles (
@@ -174,7 +174,7 @@ def test_dircmp(self, comparator_tmpdir):
174174 self ._assert_report (d .report , expected_report )
175175
176176 # Add different file2
177- with open (os .path .join (comparator_tmpdir .dir_diff , "file2" ), 'w' ) as output :
177+ with open (os .path .join (comparator_tmpdir .dir_diff , "file2" ), 'w' , encoding = "UTF-8" ) as output :
178178 output .write ('Different contents.\n ' )
179179 d = DirComparator (comparator_tmpdir .dir , comparator_tmpdir .dir_diff )
180180 assert d .same_files == ["file" ]
0 commit comments