-
Notifications
You must be signed in to change notification settings - Fork 38
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
Automatically create the directory path for a JSONTokenStorage #998
Automatically create the directory path for a JSONTokenStorage #998
Conversation
~~~~~ | ||
|
||
- When a JSONTokenStorage is used, the containing directory will be automatically be | ||
created if it doesn't exist instead of erroring (on Mac). |
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.
Since it's not mac-specific, I don't think we should note the platform. Since I was suggesting an edit, I also went ahead and restored the pr link text from the template (:pr:`998`
also works).
created if it doesn't exist instead of erroring (on Mac). | |
created if it doesn't exist instead of erroring. (:pr:`NUMBER`) |
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.
I'm not sure if it's mac exclusive or not. I only know it doesn't work on mac.
@@ -40,8 +41,15 @@ def __init__(self, filename: pathlib.Path | str, *, namespace: str = "DEFAULT"): | |||
:param namespace: A user-supplied namespace for partitioning token data | |||
""" | |||
self.filename = str(filename) | |||
self._ensure_containing_dir_exists() |
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.
If we're adding this, shouldn't we do it on the parent class, not here?
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.
Sure, that's a fair question. Would you like to open that PR or me?
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.
Sure, I'll work that up!
(Also, no worries about merge/review order. I noticed it, and we'll sort out now. 😄 )
Given that this has already merged, I'm going to open a PR to post-fix the changelog entry and separately ask about moving the ensure_dir behavior up-tree. |
Yep, sorry didn't realize you were reviewing & expected this change to be small & uncontroversial enough to not wait around in case someone else was reviewing like I normally try to. |
What?
Why?
~/.globus/app
dir didn't exist).📚 Documentation preview 📚: https://globus-sdk-python--998.org.readthedocs.build/en/998/