-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-36232: Improve error message on dbm.open() when the db doesn't exist #12060
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
Conversation
The forced-push was just to rebuild on Azure. It was falling for reasons not related to the changes. |
Lib/dbm/__init__.py
Outdated
@@ -82,7 +82,8 @@ def open(file, flag='r', mode=0o666): | |||
# file doesn't exist and the new flag was used so use default type | |||
mod = _defaultmod | |||
else: | |||
raise error[0]("need 'c' or 'n' flag to open new db") | |||
raise error[0]("db file doesn't exist, " |
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.
raise error[0]("db file doesn't exist, " | |
raise error[0]("db file doesn't exist; " |
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
@rougeth mind adding a news file? (And make sure to thank yourself!) You can use blurb-it -- found in the Details link for the bedevere/news CI check -- to add one easily. |
I have made the requested changes; please review again. |
Thanks for making the requested changes! @brettcannon: please review the changes made to this pull request. |
@brettcannon I was looking into the other news entries, found a typo and fixed it, is that ok? |
Lib/dbm/__init__.py
Outdated
@@ -82,7 +82,8 @@ def open(file, flag='r', mode=0o666): | |||
# file doesn't exist and the new flag was used so use default type | |||
mod = _defaultmod | |||
else: | |||
raise error[0]("need 'c' or 'n' flag to open new db") | |||
raise error[0]("db file doesn't exist; " | |||
"use 'c' or 'n' flag to open new db") |
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.
"use 'c' or 'n' flag to open new db") | |
"use 'c' or 'n' flag to create a new db") |
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.
One minor wording change.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
I would have committed the change myself but GH says I don't have permission to. |
I have made the requested changes; please review again |
Thanks for making the requested changes! @brettcannon: please review the changes made to this pull request. |
Explicit raise that db file doesn't exist if tries to open an existing file with 'r' and 'w' flags.
@brettcannon I may have blocked PR changes from other people (don't know/remember why :) I believe now it's ok. |
Thanks! |
https://bugs.python.org/issue36232