Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add support for XDG_CONFIG_HOME #129
Add support for XDG_CONFIG_HOME #129
Changes from 4 commits
3475590
c84f97d
36064fa
55791f3
9369c20
7a73416
88b12c5
9a159ac
0144516
f1a2d9a
43b6620
072bd8f
d0e2767
9eee217
4c72147
e829822
dc0a4dc
7bd28b6
e1a3715
6ee83ad
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 am reading this docstring over and over and I think apiver doesn't let us change the default location to use
XDG_CONFIG_HOME
in v1. Someone may have written a program that relies on the promise that when the filename was not passed andB2_ACCOUNT_INFO
was not set, then the db file will land in~/.b2_account_info
. After running something, the program might clean the environment by removing that file.If we make this change and
XDG_CONFIG_HOME
is defined, sdk user would not expect the configuration of the end user to be suddenly leaked (as it is not cleaned up anymore), possibly allowing access to the following user.I think this is a good change and we should introduce it, but that should happen with the release of
from b2sdk.v2 import *
, otherwise we risk introducing a breaking change, while the purpose of apiver is to avoid it unless fixing a bug (which we are not doing here) which would change behavior because the old behavior was just wrong.Furthermore, we should separate the documentation of the interface from the documentation of the current behavior, so that this can be altered in the future, by mentioning that the user should not define of this algorithm staying exactly the same, but should use
self.filename
to determine the actually determined location of the file in case it needs to be accessed later.We did not have a compelling reason to release v2, but this is a good one.
@bwbeach @0az do you agree with my viewpoint? Shall we move it to v2?
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.
Good catch: I didn't actually think of that case.
Sounds good to 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.
@0az then would you please adjust the docstring here? We'll hold off merging this until b2sdk 1.1.0 and b2cli 2.0.0 are shipped, then we'll increment apiver to v2 and finally we'll merge your thing (though a final adjustment will be necessary to provide backwards compatibility)
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.
Another question for v2: should SqliteAccountInfo support
:memory:
or anonymous (empty string) databases?https://www.sqlite.org/c3ref/open.html
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.
It looks like that could replace
InMemoryAccountInfo
with one line of code. I like less code.