Skip to content

Remove Python 2 compatibility helpers: to_bytes, to_native, to_unicode#199

Merged
lavr merged 3 commits intomasterfrom
fix/issue-197-remove-py2-helpers
Mar 31, 2026
Merged

Remove Python 2 compatibility helpers: to_bytes, to_native, to_unicode#199
lavr merged 3 commits intomasterfrom
fix/issue-197-remove-py2-helpers

Conversation

@lavr
Copy link
Copy Markdown
Owner

@lavr lavr commented Mar 31, 2026

Summary

  • Remove to_bytes, to_native, to_unicode from emails/utils.py
  • Replace all call sites with direct .encode() / .decode() calls
  • Remove unused imports (sys, overload) from utils.py

Files changed (10)

Source: utils.py, loader/__init__.py, loader/helpers.py, loader/local_store.py, store/file.py, transformer.py
Tests: test_dkim.py, test_message.py, test_rfc822_loader.py, smtp_servers.py

Test plan

  • All 85 tests pass
  • mypy clean

Closes #197

lavr added 3 commits March 31, 2026 19:40
Replace all call sites with direct .encode()/.decode() calls, as these
functions are trivial wrappers on Python 3.

Closes #197
@lavr lavr merged commit de1e8f3 into master Mar 31, 2026
7 checks passed
@lavr lavr deleted the fix/issue-197-remove-py2-helpers branch April 2, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove Python 2 compatibility helpers: to_bytes, to_native, to_unicode

1 participant