This commit is contained in:
Marc Beninca 2024-09-13 17:22:36 +02:00
parent 0a9404fb2f
commit ef45fc9d81
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -77,5 +77,5 @@ def wipe(path: str) -> None:
def write(file_path: str, text: str, charset: str = CHARSET) -> None: def write(file_path: str, text: str, charset: str = CHARSET) -> None:
"""Write text into a file.""" """Write text into a file."""
with open(file_path, "bw") as file_object: with Path(file_path).open(mode="w", encoding=charset) as file_object:
file_object.write(text.encode(charset)) file_object.write(text)