Skip to content

Commit

Permalink
Add Encoding while saving kernel log for CLH testcase (microsoft#3140)
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 authored Jan 16, 2024
1 parent ee3bb31 commit f2e352a
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 f2e352a

Please sign in to comment.