diff --git a/src/DIRAC/Core/Base/SQLAlchemyDB.py b/src/DIRAC/Core/Base/SQLAlchemyDB.py index 97ae4d3f286..9400168665e 100644 --- a/src/DIRAC/Core/Base/SQLAlchemyDB.py +++ b/src/DIRAC/Core/Base/SQLAlchemyDB.py @@ -3,6 +3,7 @@ Uses sqlalchemy """ + import datetime from urllib import parse as urlparse from sqlalchemy import create_engine, desc, exc diff --git a/src/DIRAC/DataManagementSystem/DB/FTS3DB.py b/src/DIRAC/DataManagementSystem/DB/FTS3DB.py index de7b789ae55..ed45cf2097a 100644 --- a/src/DIRAC/DataManagementSystem/DB/FTS3DB.py +++ b/src/DIRAC/DataManagementSystem/DB/FTS3DB.py @@ -1,5 +1,5 @@ -""" Frontend to FTS3 MySQL DB. Written using sqlalchemy -""" +"""Frontend to FTS3 MySQL DB. Written using sqlalchemy""" + # We disable the no-member error because # they are constructed by SQLAlchemy for all # the objects mapped to a table. @@ -7,6 +7,7 @@ import datetime import errno +from urllib.parse import quote_plus from sqlalchemy import ( BigInteger, @@ -184,7 +185,7 @@ def __getDBConnectionInfo(self, fullname): self.dbHost = dbParameters["Host"] self.dbPort = dbParameters["Port"] self.dbUser = dbParameters["User"] - self.dbPass = dbParameters["Password"] + self.dbPass = quote_plus(dbParameters["Password"]) self.dbName = dbParameters["DBName"] def __init__(self, pool_size=15, url=None, parentLogger=None): diff --git a/src/DIRAC/RequestManagementSystem/DB/RequestDB.py b/src/DIRAC/RequestManagementSystem/DB/RequestDB.py index 7715e4ba854..618677084b1 100644 --- a/src/DIRAC/RequestManagementSystem/DB/RequestDB.py +++ b/src/DIRAC/RequestManagementSystem/DB/RequestDB.py @@ -16,6 +16,8 @@ import errno import random +from urllib.parse import quote_plus + from sqlalchemy import ( TEXT, BigInteger, @@ -198,7 +200,7 @@ def __getDBConnectionInfo(self, fullname): self.dbHost = dbParameters["Host"] self.dbPort = dbParameters["Port"] self.dbUser = dbParameters["User"] - self.dbPass = dbParameters["Password"] + self.dbPass = quote_plus(dbParameters["Password"]) self.dbName = dbParameters["DBName"] def __init__(self, parentLogger=None):