From 696e43e83e2226fb3f1352449c9ae21a8805a893 Mon Sep 17 00:00:00 2001 From: Balram Choudhary Date: Mon, 20 Jan 2025 13:42:00 +0530 Subject: [PATCH] Polaris scan fix Signed-off-by: Balram Choudhary --- config.json | 2 +- ibm_db.c | 4 ++-- ibm_db_dbi.py | 2 +- setup.py | 5 +---- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/config.json b/config.json index f7569056..61a60537 100644 --- a/config.json +++ b/config.json @@ -1,7 +1,7 @@ { "database" : "sample", "user" : "db2inst1", - "password" : "password", + "password" : "", "hostname" : "localhost", "port" : 50000 } \ No newline at end of file diff --git a/ibm_db.c b/ibm_db.c index 83c2bbac..046827a8 100644 --- a/ibm_db.c +++ b/ibm_db.c @@ -1860,8 +1860,8 @@ static PyObject *_python_ibm_db_connect_helper( PyObject *self, PyObject *args, /* Set Options */ if ( !NIL_P(options) ) { if(!PyDict_Check(options)) { - LogMsg(EXCEPTION, "options Parameter must be of type dictionay", fileName); - PyErr_SetString(PyExc_Exception, "options Parameter must be of type dictionay"); + LogMsg(EXCEPTION, "options Parameter must be of type dictionary", fileName); + PyErr_SetString(PyExc_Exception, "options Parameter must be of type dictionary"); return NULL; } rc = _python_ibm_db_parse_options( options, SQL_HANDLE_DBC, conn_res ); diff --git a/ibm_db_dbi.py b/ibm_db_dbi.py index c86ffecf..9235485a 100644 --- a/ibm_db_dbi.py +++ b/ibm_db_dbi.py @@ -1751,7 +1751,7 @@ def executemany(self, operation, seq_parameters): self.messages.append(Error(str(ibm_db.conn_errormsg()))) raise self.messages[len(self.messages) - 1] if ibm_db.stmt_errormsg() is not None: - error_msg = f"Statement error: {str(ibm_db.conn_errormsg())}" + error_msg = f"Statement error: {str(ibm_db.stmt_errormsg())}" LogMsg(ERROR, error_msg) self.messages.append(Error(str(ibm_db.stmt_errormsg()))) raise self.messages[len(self.messages) - 1] diff --git a/setup.py b/setup.py index 0b465acb..eac86458 100644 --- a/setup.py +++ b/setup.py @@ -258,10 +258,7 @@ def _downloadClidriver(url): shutil.copy('ibm_db.dll', 'clidriver') def print_exception( e, url): - if(os_ == "win"): - err = "Error while downloading clidriver from the following URL : " + url + "\n" + str(e) - else: - err = "Error while downloading clidriver from the following URL : " + url + "\n" + str(e) + err = "Error while downloading clidriver from the following URL : " + url + "\n" + str(e) if "github" in url: if(os_ == "win"):