Skip to content

Commit 6f80c4e

Browse files
committed
Bugfix: Set folder_db for csv database
This fixes the error message: [ERROR] sharing database cannot be initialized: UnboundLocalError("cannot access local variable 'folder_db' where it is not associated with a value")
1 parent 1e3eb14 commit 6f80c4e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

radicale/sharing/csv.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ def init_database(self) -> bool:
4040
sharing_db_file = os.path.join(folder_db, "sharing.csv")
4141
logger.info("sharing database filename not provided, use default: %r", sharing_db_file)
4242
else:
43+
sharing_db_file = os.path.abspath(sharing_db_file)
44+
folder_db = os.path.dirname(sharing_db_file)
4345
logger.info("sharing database filename: %r", sharing_db_file)
4446

4547
if not os.path.exists(folder_db):

0 commit comments

Comments
 (0)