diff --git a/dailyreleases/generation.py b/dailyreleases/generation.py index 5663a4e..46452bc 100644 --- a/dailyreleases/generation.py +++ b/dailyreleases/generation.py @@ -147,7 +147,7 @@ def generate(post=False, pm_recipients=None) -> None: def load_already_posted() -> Set[str]: try: with DATA_DIR.joinpath("already_posted").open() as file: - return {line.rstrip() for line in file.readlines()} + return {line.rstrip() for line in file} except FileNotFoundError: return set() @@ -155,4 +155,4 @@ def load_already_posted() -> Set[str]: def save_already_posted(already_posted) -> None: logger.info("Saving already posted to file") with DATA_DIR.joinpath("already_posted").open("w") as file: - file.writelines(already_posted) + file.writelines(f"{dirname}\n" for dirname in already_posted)