-
Notifications
You must be signed in to change notification settings - Fork 110
Update session.py #318
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
base: master
Are you sure you want to change the base?
Update session.py #318
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -633,12 +633,12 @@ 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: | ||
with open(session_file, "w") as outfile: | ||
json.dump(data, outfile) | ||
|
||
def load_session_from_file(self, session_file: Path): | ||
try: | ||
with open(session_file) as f: | ||
with open(session_file, "r") as f: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding this is redundant and linters will scream at you for it: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This change does not make sense, IMO. We should make use of the Path object and call .open() on it. |
||
log.info("Loading session from %s...", session_file) | ||
data = json.load(f) | ||
except Exception as e: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
session_file is declared to be a Path object, what's the point of reverting it to the plain
open()
?If anything, rest of the code should be converted to Path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed