Skip to content
Snippets Groups Projects
Commit 09604a3f authored by Mattia Mancini's avatar Mattia Mancini
Browse files

Add support for special characters in passwords

parent ef5118a7
No related branches found
No related tags found
3 merge requests!4Add lofarquery lta,!3Add lofarquery lta,!2Add lofarquery lta
......@@ -4,6 +4,7 @@ from configparser import ConfigParser
import logging
import os.path, os
from typing import *
import urllib.parse
import pandas
CONNECTION_STRING = 'oracle+cx_oracle://{user}:{password}@db.lofar.target.rug.nl/?service_name=db.lofar.target.rug.nl'
......@@ -51,7 +52,8 @@ def parse_args():
def create_db_engine(user: str, password: str):
connection_string: str = CONNECTION_STRING.format(user=user, password=password)
connection_string: str = CONNECTION_STRING.format(user=urllib.parse.quote_plus(user),
password=urllib.parse.quote_plus(password))
return create_engine(connection_string)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment