User percent encoded name of inexistant database
Closes #14801 (grafted from 5fddfb00cfffa81177c0b5ddda6aaecaccfe19da) --HG-- branch : 8.0
This commit is contained in:
@@ -547,7 +547,8 @@ class Database(DatabaseInterface):
|
|||||||
db_path = safe_join(
|
db_path = safe_join(
|
||||||
config.get('database', 'path'), self.name + '.sqlite')
|
config.get('database', 'path'), self.name + '.sqlite')
|
||||||
if not os.path.isfile(db_path):
|
if not os.path.isfile(db_path):
|
||||||
raise IOError("Database '%s' doesn't exist!" % db_path)
|
raise DatabaseOperationalError(
|
||||||
|
f"Database '{db_path}' doesn't exist!")
|
||||||
db_uri = base_uri._replace(path=db_path)
|
db_uri = base_uri._replace(path=db_path)
|
||||||
|
|
||||||
# Use unparse before replacing sqlite with file because SQLite accepts
|
# Use unparse before replacing sqlite with file because SQLite accepts
|
||||||
|
|||||||
@@ -33,8 +33,8 @@ class TransactionTestCase(TestCase):
|
|||||||
and ensure that it stops cleanly and allows starting of next
|
and ensure that it stops cleanly and allows starting of next
|
||||||
transaction'''
|
transaction'''
|
||||||
self.assertRaises(
|
self.assertRaises(
|
||||||
Exception, empty_transaction, "Non existant DB", USER,
|
backend.DatabaseOperationalError, empty_transaction,
|
||||||
context=CONTEXT)
|
"Non%20existant%20DB", USER, context=CONTEXT)
|
||||||
self.assertTrue(empty_transaction(DB_NAME, USER, context=CONTEXT))
|
self.assertTrue(empty_transaction(DB_NAME, USER, context=CONTEXT))
|
||||||
|
|
||||||
def test_set_user(self):
|
def test_set_user(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user