Skip to content

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

Merged
merged 2 commits into from
Apr 29, 2019
Merged

bpo-36232: Improve error message on dbm.open() when the db doesn't exist #12060

merged 2 commits into from
Apr 29, 2019

Conversation

rougeth
Copy link
Contributor

@rougeth rougeth commented Feb 26, 2019

@rougeth
Copy link
Contributor Author

rougeth commented Mar 5, 2019

The forced-push was just to rebuild on Azure. It was falling for reasons not related to the changes.

@rougeth rougeth changed the title Improve error message on dbm.open bpo-36232: Improve error message on dbm.open Mar 8, 2019
@@ -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, "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
raise error[0]("db file doesn't exist, "
raise error[0]("db file doesn't exist; "

@bedevere-bot
Copy link

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 have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@brettcannon
Copy link
Member

@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.

@rougeth
Copy link
Contributor Author

rougeth commented Apr 6, 2019

I have made the requested changes; please review again.

@bedevere-bot
Copy link

Thanks for making the requested changes!

@brettcannon: please review the changes made to this pull request.

@rougeth
Copy link
Contributor Author

rougeth commented Apr 6, 2019

@brettcannon I was looking into the other news entries, found a typo and fixed it, is that ok?

@brettcannon brettcannon self-requested a review April 11, 2019 21:14
@@ -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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"use 'c' or 'n' flag to open new db")
"use 'c' or 'n' flag to create a new db")

Copy link
Member

@brettcannon brettcannon left a 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.

@bedevere-bot
Copy link

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 have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@brettcannon brettcannon changed the title bpo-36232: Improve error message on dbm.open bpo-36232: Improve error message on dbm.open() when the db doesn't exist Apr 26, 2019
@brettcannon
Copy link
Member

I would have committed the change myself but GH says I don't have permission to.

@rougeth
Copy link
Contributor Author

rougeth commented Apr 26, 2019

I have made the requested changes; please review again

@bedevere-bot
Copy link

Thanks for making the requested changes!

@brettcannon: please review the changes made to this pull request.

rougeth added 2 commits April 27, 2019 02:26
Explicit raise that db file doesn't exist if tries to open an existing
file with 'r' and 'w' flags.
@rougeth
Copy link
Contributor Author

rougeth commented Apr 27, 2019

@brettcannon I may have blocked PR changes from other people (don't know/remember why :) I believe now it's ok.

@brettcannon brettcannon merged commit 81c5a90 into python:master Apr 29, 2019
@brettcannon
Copy link
Member

Thanks!

@rougeth rougeth deleted the dbm-open-error-msg branch April 29, 2019 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants