📝 Issue Summary
SQL import/export completely fails on Python 3.13 due to removed support for pathlib.Path context managers. MailLogSentinel was developed with Python 3.9, but Python 3.13 (now default in latest Debian) has breaking changes that make import/export functionality unusable.
Error occurs in 3 places:
- During initial setup (bundled mapping headers)
- During SQL export (column mapping file loading)
- During SQL import (column mapping file loading)
🔁 Steps to Reproduce
- Run MailLogSentinel on Python 3.13 system
- Execute:
python3 /usr/local/bin/maillogsentinel.py --sql-export
- or:
python3 /usr/local/bin/maillogsentinel.py --sql-import
- Observe failure:
ERROR: Could not load headers from bundled mapping for test setup: 'PosixPath' object does not support the context manager protocol
...
sql_export: Error loading bundled default column mapping file: 'PosixPath' object does not support the context manager protocol. Aborting SQL export.
TypeError: 'PosixPath' object does not support the context manager protocol
❌ Current Behavior
- SQL import/export completely broken on Python 3.13+
- Same error pattern appears in multiple locations
- Users on modern Python versions cannot export data
✅ Expected Behavior
SQL import/export should work on Python 3.13+ just like it does on Python 3.9-3.12.
🐍 Python Context
This is a breaking change in Python, not a bug in MLS:
- Python 3.9: Path context managers made no-op (but still worked)
- Python 3.11: Started emitting deprecation warnings
- Python 3.13: Complete removal of Path context manager support
🌍 Environment
- Broken on: Python 3.13+ (all platforms)
- Works on: Python 3.9 - 3.12
- Affected OS: All (Linux, Windows, macOS)
- Debian: Python 3.13 is now the default
🎯 Technical Details
Problematic code pattern found in multiple locations:
with importlib.resources.files("package").joinpath("file.json") as path:
# This fails because PosixPath no longer supports context manager protocol
Known locations:
sql_exporter.py line ~399
sql_importer.py line ~334
- Wherever "bundled mapping for test setup" is loaded
⚡ Current Workaround
Downgrade to Python 3.12, but this is unsustainable as Python 3.13 becomes standard.
🔗 References
- Python 3.13 What's New - pathlib context manager removal
- Similar issues reported in other projects migrating to Python 3.13
💼 Impact
- Users affected: Anyone on Python 3.13+ (growing rapidly)
- Functionality lost: Complete SQL import/export feature
- Urgency: High - affects latest Python version compatibility
📝 Issue Summary
SQL import/export completely fails on Python 3.13 due to removed support for
pathlib.Pathcontext managers. MailLogSentinel was developed with Python 3.9, but Python 3.13 (now default in latest Debian) has breaking changes that make import/export functionality unusable.Error occurs in 3 places:
🔁 Steps to Reproduce
python3 /usr/local/bin/maillogsentinel.py --sql-exportpython3 /usr/local/bin/maillogsentinel.py --sql-import❌ Current Behavior
✅ Expected Behavior
SQL import/export should work on Python 3.13+ just like it does on Python 3.9-3.12.
🐍 Python Context
This is a breaking change in Python, not a bug in MLS:
🌍 Environment
🎯 Technical Details
Problematic code pattern found in multiple locations:
Known locations:
sql_exporter.pyline ~399sql_importer.pyline ~334⚡ Current Workaround
Downgrade to Python 3.12, but this is unsustainable as Python 3.13 becomes standard.
🔗 References
💼 Impact