From 7f0f93f7262eb79086bf86cf651093f7c1dc7a06 Mon Sep 17 00:00:00 2001 From: Andrej Date: Wed, 4 Jun 2025 13:53:49 +0500 Subject: [PATCH] ifc2sql - close cursor too Important on Windows if someone is using Patcher explicitly and `self.c` is not garbage collected and file stays locked and cannot be moved. --- src/ifcpatch/ifcpatch/recipes/Ifc2Sql.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ifcpatch/ifcpatch/recipes/Ifc2Sql.py b/src/ifcpatch/ifcpatch/recipes/Ifc2Sql.py index 686dc2177e..b650825ae9 100644 --- a/src/ifcpatch/ifcpatch/recipes/Ifc2Sql.py +++ b/src/ifcpatch/ifcpatch/recipes/Ifc2Sql.py @@ -224,6 +224,7 @@ class Patcher(ifcpatch.BasePatcher): self.c.execute("INSERT INTO geometry VALUES (%s, %s, %s, %s, %s, %s);", row) self.db.commit() + self.c.close() # Important for static use of Patcher on Windows. self.db.close() def create_geometry(self) -> None: