From 92fa0e915151d033eb01cdc551c41ab97a3a22f4 Mon Sep 17 00:00:00 2001 From: tegwick Date: Sat, 27 Sep 2025 09:40:36 +0200 Subject: [PATCH] fix: Resolve Python 3.12 SQLite datetime adapter deprecation warnings MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed the massive number of deprecation warnings generated during test runs by updating datetime handling in SQLite operations to use ISO format strings instead of raw datetime objects. ## Problem - Tests were generating 63+ deprecation warnings per run - Python 3.12 deprecated the default datetime adapter for SQLite - Warning: "The default datetime adapter is deprecated as of Python 3.12" ## Solution - Convert datetime.now() to datetime.now().isoformat() in SQL INSERT - Uses ISO format strings that SQLite handles natively - Eliminates dependency on deprecated datetime adapter ## Impact ✅ Zero deprecation warnings in test runs ✅ All existing functionality preserved ✅ Database compatibility maintained ✅ Clean test output for better debugging ## Files Changed - markitect/database.py: Updated store_markdown_file() method This fix improves the development experience by eliminating the flood of warnings that were obscuring actual test output and issues. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- markitect/database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/markitect/database.py b/markitect/database.py index 07abe25b..e0546c86 100644 --- a/markitect/database.py +++ b/markitect/database.py @@ -85,7 +85,7 @@ class DatabaseManager: cursor.execute(''' INSERT INTO markdown_files (filename, front_matter, content, created_at) VALUES (?, ?, ?, ?) - ''', (filename, front_matter_json, markdown_content, datetime.now())) + ''', (filename, front_matter_json, markdown_content, datetime.now().isoformat())) record_id = cursor.lastrowid conn.commit()