Skip to content

Commit 1b4a913

Browse files
volayanyalldawson
authored andcommitted
[processing] avoid exception when listing DB schemas
do not fail if cert file cannot be deleted when creating GeoDB object fixes #21099
1 parent 2c69483 commit 1b4a913

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

python/plugins/processing/tools/postgis.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,17 +222,26 @@ def __init__(self, host=None, port=None, dbname=None, user=None,
222222
sslCertFile = expandedUri.param("sslcert")
223223
if sslCertFile:
224224
sslCertFile = sslCertFile.replace("'", "")
225-
os.remove(sslCertFile)
225+
try:
226+
os.remove(sslCertFile)
227+
except OSError:
228+
pass
226229

227230
sslKeyFile = expandedUri.param("sslkey")
228231
if sslKeyFile:
229232
sslKeyFile = sslKeyFile.replace("'", "")
230-
os.remove(sslKeyFile)
233+
try:
234+
os.remove(sslKeyFile)
235+
except OSError:
236+
pass
231237

232238
sslCAFile = expandedUri.param("sslrootcert")
233239
if sslCAFile:
234240
sslCAFile = sslCAFile.replace("'", "")
235-
os.remove(sslCAFile)
241+
try:
242+
os.remove(sslCAFile)
243+
except OSError:
244+
pass
236245

237246
self.has_postgis = self.check_postgis()
238247

0 commit comments

Comments
 (0)