Skip to content

Consistent use of path file open #331

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tidalapi/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down