Skip to content

Django 6 Compatibility Issues #362

@hesstobi

Description

@hesstobi

The django-ses package fails 19 out of 70 tests when running against Django 6.0, indicating breaking changes in Django's email handling and signal dispatch mechanisms.

Environment

  • Django Version: 6.0
  • Python Version: 3.12
  • django-ses Version: 4.4.0

Issues Identified

1. Message.as_bytes() API Change

Error: TypeError: Message.as_bytes() got an unexpected keyword argument 'linesep'

Affected Code:

  • django_ses/__init__.py:274 (v2 parameters)
  • django_ses/__init__.py:297 (v1 parameters)

Root Cause: Django 6 have changed the signature of Message.as_bytes() in the email module, removing linesep parameter, because the email object is now a type of email.message.EmailMessage.

2. Signal Dispatch API Change

Error 1: TypeError: 'bool' object is not callable

  • Location: Django's dispatcher.py:435 in _clear_dead_receivers()
  • Test: test_views.HandleBounceTestCaseWithBL.test_bounce_event_can_perform_blacklist

Error 2: ValueError: not enough values to unpack (expected 4, got 3)

  • Location: Django's dispatcher.py:459 in _live_receivers()
  • Test: test_views.HandleBounceTestCaseWithBL.test_complaint_event_can_perform_blacklist

Root Cause: Django 6 has modified the internal signal dispatch receiver signature again, the test setup is not respecting this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions