Skip to content

Commit

Permalink
Add Encoding while saving kernel log for CLH testcase
Browse files Browse the repository at this point in the history
This will add encoding while opening file to save kernel
logs under Cloud-Hypervisor testcase.

This is needed while running this test on windows to
resolve UnicodeEncodeError.

Signed-off-by: Smit Gardhariya <[email protected]>
  • Loading branch information
smit-gardhariya committed Jan 16, 2024
1 parent ee3bb31 commit 3f4f7ff
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion microsoft/testsuites/cloud_hypervisor/ch_tests_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def _save_kernel_logs(self, log_path: Path) -> None:
else:
dmesg_str = self.node.tools[Dmesg].get_output(force_run=True)
dmesg_path = log_path / "dmesg"
with open(str(dmesg_path), "w") as f:
with open(str(dmesg_path), "w", encoding='utf-8') as f:
f.write(dmesg_str)


Expand Down

0 comments on commit 3f4f7ff

Please sign in to comment.