User percent encoded name of inexistant database

Closes #14801
(grafted from 5fddfb00cfffa81177c0b5ddda6aaecaccfe19da)

--HG--
branch : 8.0
This commit is contained in:
Nicolas Évrard
2026-04-22 18:19:51 +02:00
parent c4fdf6d9a0
commit e3a862e4c3
2 changed files with 4 additions and 3 deletions
+2 -1
View File
@@ -547,7 +547,8 @@ class Database(DatabaseInterface):
db_path = safe_join(
config.get('database', 'path'), self.name + '.sqlite')
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)
# Use unparse before replacing sqlite with file because SQLite accepts
+2 -2
View File
@@ -33,8 +33,8 @@ class TransactionTestCase(TestCase):
and ensure that it stops cleanly and allows starting of next
transaction'''
self.assertRaises(
Exception, empty_transaction, "Non existant DB", USER,
context=CONTEXT)
backend.DatabaseOperationalError, empty_transaction,
"Non%20existant%20DB", USER, context=CONTEXT)
self.assertTrue(empty_transaction(DB_NAME, USER, context=CONTEXT))
def test_set_user(self):