-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
db: make database path relative to config.core.homedir
#1574
Conversation
Any @sopel-irc/rockstars takers to review this? I'm hoping its pretty straightforward 😁 we shall see... |
@HumorBaby doesn't that is in conflict with #1446? |
The conflicts look... interesting. Good luck. :-/ |
On the plus side, there's only "one" conflict? 😕 |
3b4c0ff
to
701be15
Compare
hehe, wasn't too bad actually! RustyB developed around the part I modified 😁 Anyway, the conflict is handled now. |
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.
Almost 👍
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.
Last very small nitpick, and it's approved!
Raises `OSError` if the directory in which the database will be created does not exist.
2885698
to
6b8afcf
Compare
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.
🎉
path = os.path.normpath(os.path.join(config_dir, path)) | ||
path = os.path.normpath(os.path.join(config.core.homedir, path)) | ||
if not os.path.isdir(os.path.dirname(path)): | ||
raise OSError( |
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 could bikeshed this and say we should use FileNotFoundError
, but 💤. It's an easy change to make later if we really want to.
Makes the default base directory for the database
core.homedir
. Non-absolute paths are relative to that directory, as opposed to previously, where they were relative to the config file path.Additionally, now
SopelDB.__init__
willraise OSError
if the directory in which the database is to be created does not exist.Closes #1047.