From 9847120a5514d6abac3baa2de80f3b7f48b6f1b9 Mon Sep 17 00:00:00 2001 From: tehkillerbee Date: Tue, 10 Jun 2025 22:55:33 +0200 Subject: [PATCH] Consistent use of file open --- tidalapi/session.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tidalapi/session.py b/tidalapi/session.py index aef713b..b83b4dd 100644 --- a/tidalapi/session.py +++ b/tidalapi/session.py @@ -631,14 +631,14 @@ def save_session_to_file(self, session_file: Path): "is_pkce": {"data": self.is_pkce}, # "expiry_time": {"data": self.expiry_time}, } - with session_file.open("w") as outfile: - json.dump(data, outfile) + with session_file.open("w") as file: + json.dump(data, file) def load_session_from_file(self, session_file: Path): try: - with open(session_file) as f: + with session_file.open("r") as file: log.info("Loading session from %s...", session_file) - data = json.load(f) + data = json.load(file) except Exception as e: log.info("Could not load session from %s: %s", session_file, e) return False