Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
81c5a905
Commit
81c5a905
authored
Apr 30, 2019
by
Marco Rougeth
Committed by
Brett Cannon
Apr 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bpo-36232: Improve error message on dbm.open() when the db doesn't exist (GH-12060)
parent
9bdd6d1c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
2 deletions
+5
-2
Lib/dbm/__init__.py
Lib/dbm/__init__.py
+2
-1
Misc/NEWS.d/next/Library/2019-03-20-15-13-18.bpo-36366.n0eav_.rst
...S.d/next/Library/2019-03-20-15-13-18.bpo-36366.n0eav_.rst
+1
-1
Misc/NEWS.d/next/Library/2019-04-06-20-25-25.bpo-36232.SClmhb.rst
...S.d/next/Library/2019-04-06-20-25-25.bpo-36232.SClmhb.rst
+2
-0
No files found.
Lib/dbm/__init__.py
View file @
81c5a905
...
...
@@ -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 create a new db"
)
elif
result
==
""
:
# db type cannot be determined
raise
error
[
0
](
"db type could not be determined"
)
...
...
Misc/NEWS.d/next/Library/2019-03-20-15-13-18.bpo-36366.n0eav_.rst
View file @
81c5a905
Calling ``stop()`` on an unstarted or stopped :func:`unittest.mock.patch`
object will now return `None` instead of raising :exc:`RuntimeError`,
making the method idempotent.
Patch byKarthikeyan Singaravelan.
Patch by
Karthikeyan Singaravelan.
Misc/NEWS.d/next/Library/2019-04-06-20-25-25.bpo-36232.SClmhb.rst
0 → 100644
View file @
81c5a905
Improve error message when trying to open existing DBM database that
actually doesn't exist. Patch by Marco Rougeth.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment