django-mailer icon indicating copy to clipboard operation
django-mailer copied to clipboard

Issue running runmailer_pg

Open citizenfish opened this issue 1 year ago • 1 comments

With psycopg2 Version 2.9.5 installed and running under python 3.11

python manage.py runmailer_pg

Gives error:-

  File "/opt/homebrew/lib/python3.11/site-packages/mailer/management/commands/runmailer_pg.py", line 31, in handle
    postgres_send_loop()
  File "/opt/homebrew/lib/python3.11/site-packages/mailer/postgres.py", line 38, in postgres_send_loop
    conn.set_isolation_level(psycopg2.extensions.ISOLATION_LEVEL_AUTOCOMMIT)

However,

python manage.py runmailer

Runs as expected

Desktop

  • OS: Mac OSX Sonara
  • Django Version 5.0

Additional context Reading the psycopg2 documents, it appears this may be a legacy method

Note This is a legacy method mixing isolation_level and autocommit. Using the respective properties is a better option.

citizenfish avatar Jan 05 '24 15:01 citizenfish