mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix file encoding on windows
This commit is contained in:
parent
fc760685ee
commit
487161ba8f
1 changed files with 3 additions and 3 deletions
|
@ -166,10 +166,10 @@ class GitModuleTest(ModuleCase):
|
|||
files = [os.path.join(newdir_path, x) for x in self.files]
|
||||
files_relpath = [os.path.join(newdir, x) for x in self.files]
|
||||
for path in files:
|
||||
with salt.utils.files.fopen(path, 'w') as fp_:
|
||||
fp_.write(salt.utils.stringutils.to_str(
|
||||
with salt.utils.files.fopen(path, 'w', encoding='utf-8') as fp_:
|
||||
fp_.write(
|
||||
'This is a test file with relative path {0}.\n'.format(path)
|
||||
))
|
||||
)
|
||||
ret = self.run_function('git.add', [self.repo, newdir])
|
||||
res = '\n'.join(sorted(['add \'{0}\''.format(x) for x in files_relpath]))
|
||||
if salt.utils.platform.is_windows():
|
||||
|
|
Loading…
Add table
Reference in a new issue