Skip to content

Commit c33cbbb

Browse files
fix: wrap PosixPath in str() for open() in Python 3.4
Python 3.4 doesn't support passing pathlib.Path objects to the builtin open(); that was added in Python 3.6. Use str(path) explicitly.
1 parent 6ee3e4f commit c33cbbb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/integration/dogshell/test_dogshell.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ def test_security_monitoring_rules(self, dogshell, get_unique, tmp_path):
750750
"type": "log_detection"
751751
}
752752

753-
with open(rule_file, "w") as f:
753+
with open(str(rule_file), "w") as f:
754754
json.dump(rule_data, f)
755755

756756
# Create rule
@@ -772,7 +772,7 @@ def test_security_monitoring_rules(self, dogshell, get_unique, tmp_path):
772772
updated_name = "Updated Rule {}".format(unique)
773773
rule_data["name"] = updated_name
774774

775-
with open(rule_file, "w") as f:
775+
with open(str(rule_file), "w") as f:
776776
json.dump(rule_data, f)
777777

778778
out, _, _ = dogshell(["security-monitoring", "rules", "update", rule_id, "--file", str(rule_file)])

0 commit comments

Comments
 (0)