Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheduled monthly dependency update for December #126

Open
wants to merge 65 commits into
base: master
Choose a base branch
from

Conversation

pyup-bot
Copy link
Collaborator

@pyup-bot pyup-bot commented Dec 1, 2024

Update gevent from 1.2.1 to 24.11.1.

Changelog

24.11.1

====================


Bugfixes
--------

- Remove some legacy code that supported Python 2 for compatibility with
the upcoming releases of Cython 3.1.

Also, the ``PeriodicMonitorThreadStartedEvent`` now properly
implements the ``IPeriodicMonitorThreadStartedEvent`` interface.
The ``EventLoopBlocked`` event includes the hub which was blocked,
and it is notified before the report is printed so that event
listeners can modify the report.
See :issue:`2076`.

24.10.3

====================


Bugfixes
--------

- Fix clearing stack frames on Python 3.13. This is invoked when you
fork after having used the thread pool.
See :issue:`2067`.
- Distribute manylinux2014 wheels for x86_64.
See :issue:`2068`.
- Stop switching to the hub in the after fork hook in a child process. This could lead to strange behaviour, and is different than what all other versions of Python do.

24.10.2

====================


Bugfixes
--------

- Workaround a Cython bug compiling on GCC14.
See :issue:`2049`.

24.10.1

====================


Features
--------

- Update the bundled c-ares to 1.33.1.

- Add support for Python 3.13.

- The functions and classes in ``gevent.subprocess`` no longer accept
 ``stdout=STDOUT`` and raise a ``ValueError``.

Several additions and changes to the ``queue`` module, including:

- ``Queue.shutdown`` is available on all versions of Python.
- ``LifoQueue`` is now a joinable queue.

- gevent.monkey changed from a module to a package. The public API
remains the same.

For this release, private APIs (undocumented, marked internal, or
beginning with an underscore) are also preserved. However, these may
be changed or removed at any time in the future. If you are using one
of these APIs and cannot replace it, please contact the gevent team.



Bugfixes
--------

- For platforms that don't have ``socketpair``, upgrade our fallback
code to avoid a security issue.
See :issue:`2048`.


Deprecations and Removals
-------------------------

- Remove support for Python 3.8, which has reached the end of its
support lifecycle.
See :issue:`remove_py38`.

24.2.1

===================


Bugfixes
--------

- Add support for Python patch releases 3.11.8 and 3.12.2, which changed
internal details of threading.

As a result of these changes, note that it is no longer possible to
change the ``__class__`` of a ``gevent.threading._DummyThread``
object on those versions.

See :issue:`2020`.

Other
-----

Other updates for compatibility with the standard library include:

- Errors raised from ``subprocess.Popen`` may not have a filename set.
- ``SSLSocket.recv_into`` and ``SSLSocket.read`` no longer require the
 buffer to implement ``len`` and now work with buffers whose size is
 not 1.
- gh-108310: Fix CVE-2023-40217: Check for & avoid the ssl pre-close
 flaw.

In addition:

- Drop ``setuptools`` to a soft test dependency.
- Drop support for very old versions of CFFI.
- Update bundled c-ares from 1.19.1 to 1.26.0.
- Locks created by gevent, but acquired from multiple different
 threads (not recommended), no longer spin to implement timeouts
 and interruptible blocking. Instead, they use the native
 functionality of the Python 3 lock. This may improve some scenarios.
 See :issue:`2013`.

23.9.1

===================


Bugfixes
--------

- Require greenlet 3.0 on Python 3.11 and Python 3.12; greenlet 3.0 is
recommended for all platforms. This fixes a number of obscure crashes
on all versions of Python, as well as fixing a fairly common problem
on Python 3.11+ that could manifest as either a crash or as a
``SystemError``.
See :issue:`1985`.


----

23.9.0.post1

=========================

- Fix Windows wheel builds.
- Fix macOS wheel builds.

23.9.0

===================


Bugfixes
--------

- Make ``gevent.select.select`` accept arbitrary iterables, not just
sequences. That is, you can now pass in a generator of file
descriptors instead of a realized list. Internally, arbitrary
iterables are copied into lists. This better matches what the standard
library does. Thanks to David Salvisberg.
See :issue:`1979`.
- On Python 3.11 and newer, opt out of Cython's fast exception
manipulation, which *may* be causing problems in certain circumstances
when combined with greenlets.

On all versions of Python, adjust some error handling in the default
C-based loop. This fixes several assertion failures on debug versions
of CPython. Hopefully it has a positive impact under real conditions.
See :issue:`1985`.
- Make ``gevent.pywsgi`` comply more closely with the HTTP specification
for chunked transfer encoding. In particular, we are much stricter
about trailers, and trailers that are invalid (too long or featuring
disallowed characters) forcibly close the connection to the client
*after* the results have been sent.

Trailers otherwise continue to be ignored and are not available to the
WSGI application.

Previously, carefully crafted invalid trailers in chunked requests on
keep-alive connections might appear as two requests to
``gevent.pywsgi``. Because this was handled exactly as a normal
keep-alive connection with two requests, the WSGI application should
handle it normally. However, if you were counting on some upstream
server to filter incoming requests based on paths or header fields,
and the upstream server simply passed trailers through without
validating them, then this embedded second request would bypass those
checks. (If the upstream server validated that the trailers meet the
HTTP specification, this could not occur, because characters that are
required in an HTTP request, like a space, are not allowed in
trailers.) CVE-2023-41419 was reserved for this.

Our thanks to the original reporters, Keran Mu
(mkr22mails.tsinghua.edu.cn) and Jianjun Chen
(jianjuntsinghua.edu.cn), from Tsinghua University and Zhongguancun
Laboratory.
See :issue:`1989`.


----

23.7.0

===================


Features
--------

- Add preliminary support for Python 3.12, using greenlet 3.0a1. This
is somewhat tricky to build from source at this time, and there is
one known issue: On Python 3.12b3, dumping tracebacks of greenlets
is not available.
:issue:`1969`.
- Update the bundled c-ares version to 1.19.1.
See :issue:`1947`.


Bugfixes
--------

- Fix an edge case connecting a non-blocking ``SSLSocket`` that could result
in an AttributeError. In a change to match the standard library,
calling ``sock.connect_ex()`` on a subclass of ``socket`` no longer
calls the subclass's ``connect`` method.

Initial fix by Priyankar Jain.
See :issue:`1932`.
- Make gevent's ``FileObjectThread`` (mostly used on Windows) implement
``readinto`` cooperatively. PR by Kirill Smelkov.
See :issue:`1948`.
- Work around an ``AttributeError`` during cyclic garbage collection
when Python finalizers (``__del__`` and the like) attempt to use
gevent APIs. This is not a recommended practice, and it is unclear if
catching this ``AttributeError`` will fix any problems or just shift
them. (If we could determine the root situation that results in this
cycle, we might be able to solve it.)
See :issue:`1961`.


Deprecations and Removals
-------------------------

- Remove support for obsolete Python versions. This is everything prior
to 3.8.

Related changes include:

- Stop using ``pkg_resources`` to find entry points (plugins).
 Instead, use ``importlib.metadata``.
- Honor ``sys.unraisablehook`` when a callback function produces an
 exception, and handling the exception in the hub *also* produces an
 exception. In older versions, these would be simply printed.
- ``setup.py`` no longer includes the ``setup_requires`` keyword.
 Installation with a tool that understands ``pyproject.toml`` is
 recommended.
- The bundled tblib has been updated to version 2.0.


----

22.10.2

====================


Bugfixes
--------

- Update to greenlet 2.0. This fixes a deallocation issue that required
a change in greenlet's ABI. The design of greenlet 2.0 is intended to
prevent future fixes and enhancements from requiring an ABI change,
making it easier to update gevent and greenlet independently.

.. caution::

  greenlet 2.0 requires a modern-ish C++ compiler. This may mean
  certain older platforms are no longer supported.
  See :issue:`1909`.


----

22.10.1

====================


Features
--------

- Update bundled libuv to 1.44.2.
See :issue:`1913`.


Misc
----

- See :issue:`1898`., See :issue:`1910`., See :issue:`1915`.


----

22.08.0

====================


Features
--------

- Windows: Test and provide binary wheels for PyPy3.7.

Note that there may be issues with subprocesses, signals, and it may
be slow.
See :issue:`1798`.
- Upgrade embedded c-ares to 1.18.1.
See :issue:`1847`.
- Upgrade bundled libuv to 1.42.0 from 1.40.0.
See :issue:`1851`.
- Added preliminary support for Python 3.11 (rc2 and later).

Some platforms may or may not have binary wheels at this time.

.. important:: Support for legacy versions of Python, including 2.7
              and 3.6, will be ending soon. The
              maintenance burden has become too great and the
              maintainer's time is too limited.

              Ideally, there will be a release of gevent compatible
              with a final release of greenlet 2.0 that still
              supports those legacy versions, but that may not be
              possible; this may be the final release to support them.

:class:`gevent.threadpool.ThreadPool` can now optionally expire idle
threads. This is used by default in the implicit thread pool used for
DNS requests and other user-submitted tasks; other uses of a
thread-pool need to opt-in to this.
See :issue:`1867`.


Bugfixes
--------

- Truly disable the effects of compiling with ``-ffast-math``.
See :issue:`1864`.


----

21.12.0

====================


Features
--------

- Update autoconf files for Apple Silicon Macs. Note that while there
are reports of compiling gevent on Apple Silicon Macs now, this is
*not* a tested configuration. There may be some remaining issues with
CFFI on some systems as well.
See :issue:`1721`.
- Build and upload CPython 3.10 binary manylinux wheels.

Unfortunately, this required us to stop building and uploading CPython
2.7 binary manylinux wheels. Binary wheels for 2.7 continue to be
available for Windows and macOS.
See :issue:`1822`.
- Test and distribute musllinux_1_1 wheels.
See :issue:`1837`.
- Update the tested versions of PyPy2 and PyPy3. For PyPy2, there should
be no user visible changes, but for PyPy3, support has moved from
Python 3.6 to Python 3.7.
See :issue:`1843`.


Bugfixes
--------

- Try to avoid linking to two different Python runtime DLLs on Windows.
See :issue:`1814`.
- Stop compiling manylinux wheels with ``-ffast-math.`` This was
implicit in ``-Ofast``, but could alter the global state of the
process. Analysis and fix thanks to Ilya Konstantinov.
See :issue:`1820`.
- Fix hanging the interpreter on shutdown if gevent monkey patching
occurred on a non-main thread in Python 3.9.8 and above. (Note that
this is not a recommended practice.)
See :issue:`1839`.


----

21.8.0

===================


Features
--------

- Update the embedded c-ares from 1.16.1 to 1.17.1.
See :issue:`1758`.
- Add support for Python 3.10rc1 and newer.

As part of this, the minimum required greenlet version was increased
to 1.1.0 (on CPython), and the minimum version of Cython needed to
build gevent from a source checkout is 3.0a9.

Note that the dnspython resolver is not available on Python 3.10.
See :issue:`1790`.
- Update from Cython 3.0a6 to 3.0a9.
See :issue:`1801`.


Misc
----

- See :issue:`1789`.


----

21.1.2

===================


Features
--------

- Update the embedded libev from 4.31 to 4.33.
See :issue:`1754`.
- Update the embedded libuv from 1.38.0 to 1.40.0.
See :issue:`1755`.


Misc
----

- See :issue:`1753`.


----

21.1.1

===================

Bugfixes
--------

Fix a ``TypeError`` on startup on Python 2 with ``zope.schema``
installed. Reported by Josh Zuech.

21.1.0

===================

Bugfixes
--------

- Make gevent ``FileObjects`` more closely match the semantics of native
file objects for the ``name`` attribute:

- Objects opened from a file descriptor integer have that integer as
 their ``name.`` (Note that this is the Python 3 semantics; Python 2
 native file objects returned from ``os.fdopen()`` have the string
 "<fdopen>" as their name , but here gevent always follows Python 3.)
- The ``name`` remains accessible after the file object is closed.

Thanks to Dan Milon.
See :issue:`1745`.


Misc
----

Make ``gevent.event.AsyncResult`` print a warning when it detects improper
cross-thread usage instead of hanging.

``AsyncResult`` has *never* been safe to use from multiple threads.
It, like most gevent objects, is intended to work with greenlets from
a single thread. Using ``AsyncResult`` from multiple threads has
undefined semantics. The safest way to communicate between threads is
using an event loop async watcher.

Those undefined semantics changed in recent gevent versions, making it
more likely that an abused ``AsyncResult`` would misbehave in ways
that could cause the program to hang.

Now, when ``AsyncResult`` detects a situation that would hang, it
prints a warning to stderr. Note that this is best-effort, and hangs
are still possible, especially under PyPy 7.3.3.

At the same time, ``AsyncResult`` is tuned to behave more like it did
in older versions, meaning that the hang is once again much less
likely. If you were getting lucky and using ``AsyncResult``
successfully across threads, this may restore your luck. In addition,
cross-thread wakeups are faster. Note that the gevent hub now uses an
extra file descriptor to implement this.

Similar changes apply to ``gevent.event.Event`` (see :issue:`1735`).

See :issue:`1739`.


----

20.12.1

====================


Features
--------

- Make :class:`gevent.Greenlet` objects function as context managers.
When the ``with`` suite finishes, execution doesn't continue until the
greenlet is finished. This can be a simpler alternative to a
:class:`gevent.pool.Group` when the lifetime of greenlets can be
lexically scoped.

Suggested by André Caron.
See :issue:`1324`.


Bugfixes
--------

- Make gevent's ``Semaphore`` objects properly handle native thread
identifiers larger than can be stored in a C ``long`` on Python 3,
instead of raising an ``OverflowError``.

Reported by TheYOSH.
See :issue:`1733`.


----

20.12.0

====================


Features
--------

- Make worker threads created by :class:`gevent.threadpool.ThreadPool` install
the :func:`threading.setprofile` and :func:`threading.settrace` hooks
while tasks are running. This provides visibility to profiling and
tracing tools like yappi.

Reported by Suhail Muhammed.
See :issue:`1678`.

- Drop support for Python 3.5.

Bugfixes
--------

- Incorrectly passing an exception *instance* instead of an exception
*type* to `gevent.Greenlet.kill` or `gevent.killall` no longer prints
an exception to stderr.
See :issue:`1663`.
- Make destroying a hub try harder to more forcibly stop loop processing
when there are outstanding callbacks or IO operations scheduled.

Thanks to Josh Snyder (:issue:`1686`) and Jan-Philip Gehrcke
(:issue:`1669`).
See :issue:`1686`.
- Improve the ability to use monkey-patched locks, and
`gevent.lock.BoundedSemaphore`, across threads, especially when the
various threads might not have a gevent hub or any other active
greenlets. In particular, this handles some cases that previously
raised ``LoopExit`` or would hang. Note that this may not be reliable
on PyPy on Windows; such an environment is not currently recommended.

The semaphore tries to avoid creating a hub if it seems unnecessary,
automatically creating one in the single-threaded case when it would
block, but not in the multi-threaded case. While the differences
should be correctly detected, it's possible there are corner cases
where they might not be.

If your application appears to hang acquiring semaphores, but adding a
call to ``gevent.get_hub()`` in the thread attempting to acquire the
semaphore before doing so fixes it, please file an issue.
See :issue:`1698`.
- Make error reporting when a greenlet suffers a `RecursionError` more
reliable.

Reported by Dan Milon.
See :issue:`1704`.
- gevent.pywsgi: Avoid printing an extra traceback ("TypeError: not
enough arguments for format string") to standard error on certain
invalid client requests.

Reported by Steven Grimm.
See :issue:`1708`.
- Add support for PyPy2 7.3.3.
See :issue:`1709`.
- Python 2: Make ``gevent.subprocess.Popen.stdin`` objects have a
``write`` method that guarantees to write the entire argument in
binary, unbuffered mode. This may require multiple trips around the
event loop, but more closely matches the behaviour of the Python 2
standard library (and gevent prior to 1.5). The number of bytes
written is still returned (instead of ``None``).
See :issue:`1711`.
- Make `gevent.pywsgi` stop trying to enforce the rules for reading chunked input or
``Content-Length`` terminated input when the connection is being
upgraded, for example to a websocket connection. Likewise, if the
protocol was switched by returning a ``101`` status, stop trying to
automatically chunk the responses.

Reported by Kavindu Santhusa.
See :issue:`1712`.
- Remove the ``__dict__`` attribute from `gevent.socket.socket` objects. The
standard library socket do not have a ``__dict__``.

Noticed by Carson Ip.

As part of this refactoring, share more common socket code between Python 2
and Python 3.
See :issue:`1724`.

----

20.9.0

===================


Features
--------

- The embedded libev is now asked to detect the availability of
``clock_gettime`` and use the realtime and/or monotonic clocks, if
they are available.

On Linux, this can reduce the number of system calls libev makes.
Originally provided by Josh Snyder.
See :issue:`1648`.


Bugfixes
--------

- On CPython, depend on greenlet >= 0.4.17. This version is binary
incompatible with earlier releases on CPython 3.7 and later.

On Python 3.7 and above, the module ``gevent.contextvars`` is no
longer monkey-patched into the standard library. contextvars are now
both greenlet and asyncio task local. See :issue:`1656`.
See :issue:`1674`.
- The ``DummyThread`` objects created automatically by certain
operations when the standard library threading module is
monkey-patched now match the naming convention the standard library
uses ("Dummy-12345"). Previously (since gevent 1.2a2) they used
"DummyThread-12345".
See :issue:`1659`.
- Fix compatibility with dnspython 2.

.. caution:: This currently means that it can be imported. But it
            cannot yet be used. gevent has a pinned dependency on
            dnspython < 2 for now.

See :issue:`1661`.


----

20.6.2

===================


Features
--------

- It is now possible to build and use the embedded libuv on a Cygwin
platform.

Note that Cygwin is not an officially supported platform of upstream
libuv and is not tested by gevent, so the actual working status is
unknown, and this may bitrot in future releases.

Thanks to berkakinci for the patch.
See :issue:`1645`.


Bugfixes
--------

- Relax the version constraint for psutil on PyPy.

Previously it was pinned to 5.6.3 for PyPy2, except for on Windows,
where it was excluded. It is now treated the same as CPython again.
See :issue:`1643`.


----

20.6.1

===================


Features
--------

- gevent's CI is now tested on Ubuntu 18.04 (Bionic), an upgrade from
16.04 (Xenial).
See :issue:`1623`.


Bugfixes
--------

- On Python 2, the dnspython resolver can be used without having
selectors2 installed. Previously, an ImportError would be raised.
See :issue:`1641`.
- Python 3 ``gevent.ssl.SSLSocket`` objects no longer attempt to catch
``ConnectionResetError`` and treat it the same as an ``SSLError`` with
``SSL_ERROR_EOF`` (typically by suppressing it).

This was a difference from the way the standard library behaved (which
is to raise the exception). It was added to gevent during early
testing of OpenSSL 1.1 and TLS 1.3.
See :issue:`1637`.


----

20.6.0

===================


Features
--------

- Add ``gevent.selectors`` containing ``GeventSelector``. This selector
implementation uses gevent details to attempt to reduce overhead when
polling many file descriptors, only some of which become ready at any
given time.

This is monkey-patched as ``selectors.DefaultSelector`` by default.

This is available on Python 2 if the ``selectors2`` backport is
installed. (This backport is installed automatically using the
``recommended`` extra.) When monkey-patching, ``selectors`` is made
available as an alias to this module.
See :issue:`1532`.
- Depend on greenlet >= 0.4.16. This is required for CPython 3.9 and 3.10a0.
See :issue:`1627`.
- Add support for Python 3.9.

No binary wheels are available yet, however.
See :issue:`1628`.


Bugfixes
--------

- ``gevent.socket.create_connection`` and
``gevent.socket.socket.connect`` no longer ignore IPv6 scope IDs.

Any IP address (IPv4 or IPv6) is no longer subject to an extra call to
``getaddrinfo``. Depending on the resolver in use, this is likely to
change the number and order of greenlet switches. (On Windows, in
particular test cases when there are no other greenlets running, it has
been observed to lead to ``LoopExit`` in scenarios that didn't produce
that before.)
See :issue:`1634`.


----

20.5.2

===================


Bugfixes
--------

- Forking a process that had use the threadpool to run tasks that
created their own hub would fail to clean up the threadpool by raising
``greenlet.error``.
See :issue:`1631`.


----

20.5.1

===================


Features
--------

- Waiters on Event and Semaphore objects that call ``wait()`` or
``acquire()``, respectively, that find the Event already set, or the
Semaphore available, no longer "cut in line" and run before any
previously scheduled greenlets. They now run in the order in which
they arrived, just as waiters that had to block in those methods do.
See :issue:`1520`.
- Update tested PyPy version from 7.3.0 to 7.3.1 on Linux.
See :issue:`1569`.
- Make ``zope.interface``, ``zope.event`` and (by extension)
``setuptools`` required dependencies. The ``events`` install extra now
does nothing and will be removed in 2021.
See :issue:`1619`.
- Update bundled libuv from 1.36.0 to 1.38.0.
See :issue:`1621`.
- Update bundled c-ares from 1.16.0 to 1.16.1.

On macOS, stop trying to adjust c-ares headers to make them
universal.
See :issue:`1624`.


Bugfixes
--------

- Make gevent locks that are monkey-patched usually work across native
threads as well as across greenlets within a single thread. Locks that
are only used in a single thread do not take a performance hit. While
cross-thread locking is relatively expensive, and not a recommended
programming pattern, it can happen unwittingly, for example when
using the threadpool and ``logging``.

Before, cross-thread lock uses might succeed, or, if the lock was
contended, raise ``greenlet.error``. Now, in the contended case, if
the lock has been acquired by the main thread at least once, it should
correctly block in any thread, cooperating with the event loop of both
threads. In certain (hopefully rare) cases, it might be possible for
contended case to raise ``LoopExit`` when previously it would have
raised ``greenlet.error``; if these cases are a practical concern,
please open an issue.

Also, the underlying Semaphore always behaves in an atomic fashion (as
if the GIL was not released) when PURE_PYTHON is set. Previously, it
only correctly did so on PyPy.
See :issue:`1437`.
- Rename gevent's C accelerator extension modules using a prefix to
avoid clashing with other C extensions.
See :issue:`1480`.
- Using ``gevent.wait`` on an ``Event`` more than once, when that Event
is already set, could previously raise an AssertionError.

As part of this, exceptions raised in the main greenlet will now
include a more complete traceback from the failing greenlet.
See :issue:`1540`.
- Avoid closing the same Python libuv watcher IO object twice. Under
some circumstances (only seen on Windows), that could lead to program
crashes.
See :issue:`1587`.
- gevent can now be built using Cython 3.0a5 and newer. The PyPI
distribution uses this version.

The libev extension was incompatible with this. As part of this,
certain internal, undocumented names have been changed.

(Technically, gevent can be built with Cython 3.0a2 and above.
However, up through 3.0a4 compiling with Cython 3 results in
gevent's test for memory leaks failing. See `this Cython issue
<https://github.com/cython/cython/issues/3578>`_.)
See :issue:`1599`.
- Destroying a hub after joining it didn't necessarily clean up all
resources associated with the hub, especially if the hub had been
created in a secondary thread that was exiting. The hub and its parent
greenlet could be kept alive.

Now, destroying a hub drops the reference to the hub and ensures it
cannot be switched to again. (Though using a new blocking API call may
still create a new hub.)

Joining a hub also cleans up some (small) memory resources that might
have stuck around for longer before as well.
See :issue:`1601`.
- Fix some potential crashes under libuv when using
``gevent.signal_handler``. The crashes were seen running the test
suite and were non-deterministic.
See :issue:`1606`.


----

20.5.0

===================


Features
--------

- Update bundled c-ares to version 1.16.0. `Changes <https://c-ares.haxx.se/changelog.html>`_.
See :issue:`1588`.
- Update all the bundled ``config.guess`` and ``config.sub`` scripts.
See :issue:`1589`.
- Update bundled libuv from 1.34.0 to 1.36.0.
See :issue:`1597`.


Bugfixes
--------

- Use ``ares_getaddrinfo`` instead of a manual lookup.

This requires c-ares 1.16.0.

Note that this may change the results, in particular their order.

As part of this, certain parts of the c-ares extension were adapted to
use modern Cython idioms.

A few minor errors and discrepancies were fixed as well, such as
``gethostbyaddr('localhost')`` working on Python 3 and failing on
Python 2. The DNSpython resolver now raises the expected TypeError in
more cases instead of an AttributeError.
See :issue:`1012`.
- The c-ares and DNSPython resolvers now raise exceptions much more
consistently with the standard resolver. Types and errnos are
substantially more likely to match what the standard library produces.

Depending on the system and configuration, results may not match
exactly, at least with DNSPython. There are still some rare cases
where the system resolver can raise ``herror`` but DNSPython will
raise ``gaierror`` or vice versa. There doesn't seem to be a
deterministic way to account for this. On PyPy, ``getnameinfo`` can
produce results when CPython raises ``socket.error``, and gevent's
DNSPython resolver also raises ``socket.error``.

In addition, several other small discrepancies were addressed,
including handling of localhost and broadcast host names.

.. note:: This has been tested on Linux (CentOS and Ubuntu), macOS,
         and Windows. It hasn't been tested on other platforms, so
         results are unknown for them. The c-ares support, in
         particular, is using some additional socket functions and
         defines. Please let the maintainers know if this introduces
         issues.

See :issue:`1459`.


----

20.04.0

====================


Features
--------

- Let CI (Travis and Appveyor) build and upload release wheels for
Windows, macOS and manylinux. As part of this, (a subset of) gevent's
tests can run if the standard library's ``test.support`` module has
been stripped.
See :issue:`1555`.
- Update tested PyPy version from 7.2.0 on Windows to 7.3.1.
See :issue:`1569`.


Bugfixes
--------

- Fix a spurious warning about watchers and resource leaks on libuv on
Windows. Reported by Stéphane Rainville.
See :issue:`1564`.
- Make monkey-patching properly remove ``select.epoll`` and
``select.kqueue``. Reported by Kirill Smelkov.
See :issue:`1570`.
- Make it possible to monkey-patch :mod:`contextvars` before Python 3.7
if a non-standard backport that uses the same name as the standard
library does is installed. Previously this would raise an error.
Reported by Simon Davy.
See :issue:`1572`.
- Fix destroying the libuv default loop and then using the default loop
again.
See :issue:`1580`.
- libuv loops that have watched children can now exit. Previously, the
SIGCHLD watcher kept the loop alive even if there were no longer any
watched children.
See :issue:`1581`.


Deprecations and Removals
-------------------------

- PyPy no longer uses the Python allocation functions for libuv and
libev allocations.
See :issue:`1569`.


Misc
----

- See :issue:`1367`.
Links

Update gunicorn from 19.7.1 to 23.0.0.

Changelog

23.0.0

===================

- minor docs fixes (:pr:`3217`, :pr:`3089`, :pr:`3167`)
- worker_class parameter accepts a class (:pr:`3079`)
- fix deadlock if request terminated during chunked parsing (:pr:`2688`)
- permit receiving Transfer-Encodings: compress, deflate, gzip (:pr:`3261`)
- permit Transfer-Encoding headers specifying multiple encodings. note: no parameters, still (:pr:`3261`)
- sdist generation now explicitly excludes sphinx build folder (:pr:`3257`)
- decode bytes-typed status (as can be passed by gevent) as utf-8 instead of raising `TypeError` (:pr:`2336`)
- raise correct Exception when encounting invalid chunked requests (:pr:`3258`)
- the SCRIPT_NAME and PATH_INFO headers, when received from allowed forwarders, are no longer restricted for containing an underscore (:pr:`3192`)
- include IPv6 loopback address ``[::1]`` in default for :ref:`forwarded-allow-ips` and :ref:`proxy-allow-ips` (:pr:`3192`)

** NOTE **

- The SCRIPT_NAME change mitigates a regression that appeared first in the 22.0.0 release
- Review your :ref:`forwarded-allow-ips` setting if you are still not seeing the SCRIPT_NAME transmitted
- Review your :ref:`forwarder-headers` setting if you are missing headers after upgrading from a version prior to 22.0.0

** Breaking changes **

- refuse requests where the uri field is empty (:pr:`3255`)
- refuse requests with invalid CR/LR/NUL in heade field values (:pr:`3253`)
- remove temporary ``--tolerate-dangerous-framing`` switch from 22.0 (:pr:`3260`)
- If any of the breaking changes affect you, be aware that now refused requests can post a security problem, especially so in setups involving request pipe-lining and/or proxies.

22.0.0

===================

- use `utime` to notify workers liveness 
- migrate setup to pyproject.toml
- fix numerous security vulnerabilities in HTTP parser (closing some request smuggling vectors)
- parsing additional requests is no longer attempted past unsupported request framing
- on HTTP versions < 1.1 support for chunked transfer is refused (only used in exploits)
- requests conflicting configured or passed SCRIPT_NAME now produce a verbose error
- Trailer fields are no longer inspected for headers indicating secure scheme
- support Python 3.12

** Breaking changes **

- minimum version is Python 3.7
- the limitations on valid characters in the HTTP method have been bounded to Internet Standards
- requests specifying unsupported transfer coding (order) are refused by default (rare)
- HTTP methods are no longer casefolded by default (IANA method registry contains none affected)
- HTTP methods containing the number sign () are no longer accepted by default (rare)
- HTTP versions < 1.0 or >= 2.0 are no longer accepted by default (rare, only HTTP/1.1 is supported)
- HTTP versions consisting of multiple digits or containing a prefix/suffix are no longer accepted
- HTTP header field names Gunicorn cannot safely map to variables are silently dropped, as in other software
- HTTP headers with empty field name are refused by default (no legitimate use cases, used in exploits)
- requests with both Transfer-Encoding and Content-Length are refused by default (such a message might indicate an attempt to perform request smuggling)
- empty transfer codings are no longer permitted (reportedly seen with really old & broken proxies)


** SECURITY **

- fix CVE-2024-1135

21.2.0

===================

- fix thread worker: revert change considering connection as idle . 

*** NOTE ***

This is fixing the bad file description error.

21.1.0

===================

- fix thread worker: fix socket removal from the queue

21.0.1

===================

- fix documentation build

21.0.0

===================

- support python 3.11
- fix gevent and eventlet workers
- fix threads support (gththread): improve performance and unblock requests
- SSL: now use SSLContext object
- HTTP parser: miscellaneous fixes
- remove unnecessary setuid calls
- fix testing
- improve logging
- miscellaneous fixes to core engine

*** RELEASE NOTE ***

We made this release major to start our new release cycle. More info will be provided on our discussion forum.


================
Changelog - 2024
================

20.1.0

===================

- document WEB_CONCURRENCY is set by, at least, Heroku
- capture peername from accept: Avoid calls to getpeername by capturing the peer name returned by
accept
- log a warning when a worker was terminated due to a signal
- fix tornado usage with latest versions of Django 
- add support for python -m gunicorn
- fix systemd socket activation example
- allows to set wsgi application in config file using `wsgi_app`
- document `--timeout = 0`
- always close a connection when the number of requests exceeds the max requests
- Disable keepalive during graceful shutdown
- kill tasks in the gthread workers during upgrade
- fix latency in gevent worker when accepting new requests
- fix file watcher: handle errors when new worker reboot and ensure the list of files is kept
- document the default name and path of the configuration file
- document how variable impact configuration
- document the `$PORT` environment variable
- added milliseconds option to request_time in access_log
- added PIP requirements to be used for example
- remove version from the Server header
- fix sendfile: use `socket.sendfile` instead of `os.sendfile`
- reloader: use  absolute path to prevent empty to prevent0 `InotifyError` when a file 
is added to the working directory
- Add --print-config option to print the resolved settings at startup.
- remove the `--log-dict-config` CLI flag because it never had a working format
(the `logconfig_dict` setting in configuration files continues to work)


** Breaking changes **

- minimum version is Python 3.5
- remove version from the Server header 

** Documentation **



** Others **

- miscellaneous changes in the code base to be a better citizen with Python 3
- remove dead code
- fix documentation generation





================
Changelog - 2023
================

20.0.4

===================

- fix binding a socket using the file descriptor
- remove support for the `bdist_rpm` build

20.0.3

===================

- fixed load of a config file without a Python extension
- fixed `socketfromfd.fromfd` when defaults are not set

.. note:: we now warn when we load a config file without Python Extension

20.0.2

===================

- fix changelog

20.0.1

===================

- fixed the way the config module is loaded. `__file__` is now available
- fixed `wsgi.input_terminated`. It is always true.
- use the highest protocol version of openssl by default
- only support Python >= 3.5
- added `__repr__` method to `Config` instance
- fixed support of AIX platform and musl libc in  `socketfromfd.fromfd` function
- fixed support of applications loaded from a factory function
- fixed chunked encoding support to prevent any `request smuggling <https://portswigger.net/research/http-desync-attacks-request-smuggling-reborn>`_
- Capture os.sendfile before patching in gevent and eventlet workers.
fix `RecursionError`.
- removed locking in reloader when adding new files
- load the WSGI application before the loader to pick up all files

.. note:: this release add official support for applications loaded from a factory function
as documented in Flask and other places.

20.0

=================

- Fixed `fdopen` `RuntimeWarning` in Python 3.8
- Added  check and exception for str type on value in Response process_headers method.
- Ensure WSGI header value is string before conducting regex search on it.
- Added pypy3 to list of tested environments
- Grouped `StopIteration` and `KeyboardInterrupt` exceptions with same body together in Arbiter.run()
- Added `setproctitle` module to `extras_require` in setup.py
- Avoid unnecessary chown of temporary files
- Logging: Handle auth type case insensitively
- Removed `util.import_module`
- Removed fallback for `types.SimpleNamespace` in tests utils
- Use `SourceFileLoader` instead instead of `execfile_`
- Use `importlib` instead of `__import__` and eval`
- Fixed eventlet patching
- Added optional `datadog <https://www.datadoghq.com>`_ tags for statsd metrics
- Header values now are encoded using latin-1, not ascii.
- Rewritten `parse_address` util added test
- Removed redundant super() arguments
- Simplify `futures` import in gthread module
- Fixed worker_connections` setting to also affects the Gthread worker type
- Fixed setting max_requests
- Bump minimum Eventlet and Gevent versions to 0.24 and 1.4
- Use Python default SSL cipher list by default
- handle `wsgi.input_terminated` extension
- Simplify Paste Deployment documentation
- Fix root logging: root and logger are same level.
- Fixed typo in ssl_version documentation
- Documented  systemd deployment unit examples
- Added systemd sd_notify support
- Fixed typo in gthread.py
- Added `tornado <https://www.tornadoweb.org/>`_ 5 and  6 support
- Declare our setuptools dependency
- Added support to `--bind` to open file descriptors
- Document how to serve WSGI app modules from Gunicorn
- Provide guidance on X-Forwarded-For access log in documentation
- Add support for named constants in the `--ssl-version` flag
- Clarify log format usage of header & environment in documentation
- Fixed systemd documentation to properly setup gunicorn unix socket
- Prevent removal unix socket for reuse_port
- Fix `ResourceWarning` when reading a Python config module
- Remove unnecessary call to dict keys method
- Support str and bytes for UNIX socket addresses
- fixed `InotifyReloadeder`:  handle `module.__file__` is None
- `/dev/shm` as a convenient alternative to making your own tmpfs mount in fchmod FAQ
- fix examples to work on python3
- Fix typo in `--max-requests` documentation
- Clear tornado ioloop before os.fork
- Miscellaneous fixes and improvement for linting using Pylint

Breaking Change
+++++++++++++++

- Removed gaiohttp worker
- Drop support for Python 2.x
- Drop support for EOL Python 3.2 and 3.3
- Drop support for Paste Deploy server blocks


================
Changelog - 2020
================

.. note::

Please see :doc:`news` for the latest changes


================
Changelog - 2021
================

.. note::

Please see :doc:`news` for the latest changes

19.10.0

====================

- unblock select loop during reload of a sync worker
- security fix: http desync attack
- handle `wsgi.input_terminated`
- added support for str and bytes in unix  socket addresses
- fixed `max_requests` setting
- headers values are now encoded as LATN1, not ASCII
- fixed `InotifyReloadeder`:  handle `module.__file__` is None
- fixed compatibility with tornado 6
- fixed root logging
- Prevent removalof unix sockets from `reuse_port`
- Clear tornado ioloop before os.fork
- Miscellaneous fixes and improvement for linting using Pylint

19.9.0

===================

- fix: address a regression that prevented syslog support from working
(:issue:`1668`, :pr:`1773`)
- fix: correctly set `REMOTE_ADDR` on versions of Python 3 affected by
`Python Issue 30205 <https://bugs.python.org/issue30205>`_
(:issue:`1755`, :pr:`1796`)
- fix: show zero response length correctly in access log (:pr:`1787`)
- fix: prevent raising :exc:`AttributeError` when ``--reload`` is not passed
in case of a :exc:`SyntaxError` raised from the WSGI application.
(:issue:`1805`, :pr:`1806`)
- The internal module ``gunicorn.workers.async`` was renamed to ``gunicorn.workers.base_async``
since ``async`` is now a reserved word in Python 3.7.
(:pr:`1527`)

19.8.1

===================

- fix: secure scheme headers when bound to a unix socket
(:issue:`1766`, :pr:`1767`)

19.8.0

===================

- Eventlet 0.21.0 support (:issue:`1584`)
- Tornado 5 support (:issue:`1728`, :pr:`1752`)
- support watching additional files with ``--reload-extra-file``
(:pr:`1527`)
- support configuring logging with a dictionary with ``--logging-config-dict``
(:issue:`1087`, :pr:`1110`, :pr:`1602`)
- add support for the ``--config`` flag in the ``GUNICORN_CMD_ARGS`` environment
variable (:issue:`1576`, :pr:`1581`)
- disable ``SO_REUSEPORT`` by default and add the ``--reuse-port`` setting
(:issue:`1553`, :issue:`1603`, :pr:`1669`)
- fix: installing `inotify` on MacOS no longer breaks the reloader
(:issue:`1540`, :pr:`1541`)
- fix: do not throw ``TypeError`` when ``SO_REUSEPORT`` is not available
(:issue:`1501`, :pr:`1491`)
- fix: properly decode HTTP paths containing certain non-ASCII characters
(:issue:`1577`, :pr:`1578`)
- fix: remove whitespace when logging header values under gevent (:pr:`1607`)
- fix: close unlinked temporary files (:issue:`1327`, :pr:`1428`)
- fix: parse ``--umask=0`` correctly (:issue:`1622`, :pr:`1632`)
- fix: allow loading applications using relative file paths
(:issue:`1349`, :pr:`1481`)
- fix: force blocking mode on the gevent sockets (:issue:`880`, :pr:`1616`)
- fix: preserve leading `/` in request path (:issue:`1512`, :pr:`1511`)
- fix: forbid contradictory secure scheme headers
- fix: handle malformed basic authentication headers in access log
(:issue:`1683`, :pr:`1684`)
- fix: defer handling of ``USR1`` signal to a new greenlet under gevent
(:issue:`1645`, :pr:`1651`)
- fix: the threaded worker would sometimes close the wrong keep-alive
connection under Python 2 (:issue:`1698`, :pr:`1699`)
- fix: re-open log files on ``USR1`` signal using ``handler._open`` to
support subclasses of ``FileHandler`` (:issue:`1739`, :pr:`1742`)
- deprecation: the ``gaiohttp`` worker is deprecated, see the
:ref:`worker-class` documentation for more information
(:issue:`1338`, :pr:`1418`, :pr:`1569`)

================
Changelog - 2019
================

.. note::

Please see :doc:`news` for the latest changes
Links

Update django-anymail from 0.8 to 12.0.

Changelog

12.0

-----

*2024-09-09*

Breaking changes
~~~~~~~~~~~~~~~~

* Require **Django 4.0 or later** and Python 3.8 or later.

Features
~~~~~~~~

* **Resend:** Add support for ``send_at``.

Fixes
~~~~~

* **Unisender Go:** Fix several problems in Anymail's Unisender Go status tracking
webhook. Rework signature checking to fix false validation errors (particularly
on "clicked" and "opened" events). Properly handle "use single event" webhook
option. Correctly verify WEBHOOK_SECRET when set. Provide Unisender Go's
``delivery_status`` code and unsubscribe form ``comment`` in Anymail's
``event.description``. Treat soft bounces as "deferred" rather than "bounced".
(Thanks to `MikeVL`_ for fixing the signature validation problem.)

Other
~~~~~

* **Mandrill (docs):** Explain how ``cc`` and ``bcc`` handling depends on
Mandrill's "preserve recipients" option. (Thanks to `dgilmanAIDENTIFIED`_
for reporting the issue.)

* **Postal (docs):** Update links to Postal's new documentation site.
(Thanks to `jmduke`_.)

11.1

-----

*2024-08-07*

Features
~~~~~~~~

* **Brevo:** Support Brevo's new "Complaint," "Error" and "Loaded by proxy"
tracking events. (Thanks to `originell`_ for the update.)

Deprecations
~~~~~~~~~~~~

* This will be the last Anymail release to support Django 3.0, 3.1 and 3.2
(which reached end of extended support on 2021-04-06, 2021-12-07 and
2024-04-01, respectively).

* This will be the last Anymail release to support Python 3.7 (which reached
end-of-life on 2023-06-27, and is not supported by Django 4.0 or later).

11.0.1

-------

*2024-07-11*

(This release updates only documentation and package metadata; the code is
identical to v11.0.)

Fixes
~~~~~

* **Amazon SES (docs):** Correct IAM policies required for using
the Amazon SES v2 API. See
`Migrating to the SES v2 API <https://anymail.dev/en/stable/esps/amazon_ses/#amazon-ses-v2>`__.
(Thanks to `scur-iolus`_ for identifying the problem.)

11.0

-----

*2024-06-23*

Breaking changes
~~~~~~~~~~~~~~~~

* **Amazon SES:** Drop support for the Amazon SES v1 API.
If your ``EMAIL_BACKEND`` setting uses ``amazon_sesv1``,
or if you are upgrading from Anymail 9.x or earlier directly to 11.0 or later, see
`Migrating to the SES v2 API <https://anymail.dev/en/stable/esps/amazon_ses/#amazon-ses-v2>`__.
(Anymail 10.0 switched to the SES v2 API by default. If your ``EMAIL_BACKEND``
setting has ``amazon_sesv2``, change that to just ``amazon_ses``.)

* **SparkPost:** When sending with a ``template_id``, Anymail now raises an
error if the message uses features that SparkPost will silently ignore. See
`docs <https://anymail.dev/en/stable/esps/sparkpost/#sparkpost-template-limitations>`__.

Features
~~~~~~~~

* Add new ``merge_headers`` option for per-recipient headers with batch sends.
This can be helpful to send individual *List-Unsubscribe* headers (for example).
Supported for all current ESPs *except* MailerSend, Mandrill and Postal. See
`docs <https://anymail.dev/en/stable/sending/anymail_additions/#anymail.message.AnymailMessage.merge_headers>`__.
(Thanks to `carrerasrodrigo`_ for the idea, and for the base and
Amazon SES implementations.)

* **Amazon SES:** Allow extra headers, ``metadata``, ``merge_metadata``,
and ``tags`` when sending with a ``template_id``.
(Requires boto3 v1.34.98 or later.)

* **MailerSend:** Allow all extra headers. (Note that MailerSend limits use
of this feature to "Enterprise accounts only.")

Fixes
~~~~~

* **Amazon SES:** Fix a bug that could result in sending a broken address header
if it had a long display name containing both non-ASCII characters and commas.
(Thanks to `andresmrm`_ for isolating and reporting the issue.)

* **SendGrid:** In the tracking webhook, correctly report "bounced address"
(recipients dropped due to earlier bounces) as reject reason ``"bounced"``.
(Thanks to `vitaliyf`_.)

10.3

-----

*2024-03-12*

Features
~~~~~~~~

* **Brevo:** Add support for batch sending
(`docs <https://anymail.dev/en/stable/esps/brevo/#batch-sending-merge-and-esp-templates>`__).

* **Resend:** Add support for batch sending
(`docs <https://anymail.dev/en/stable/esps/resend/#batch-sending-merge-and-esp-templates>`__).

* **Unisender Go:** Newly supported ESP
(`docs <https://anymail.dev/en/stable/esps/unisender_go/>`__).
(Thanks to `Arondit`_ for the implementation.)


Fixes
~~~~~

* **Mailgun:** Avoid an error when Mailgun posts null delivery-status
to the event tracking webhook. (Thanks to `izimobil`_ for the fix.)


Deprecations
~~~~~~~~~~~~

* **Brevo (SendinBlue):** Rename "SendinBlue" to "Brevo" throughout
Anymail's code, reflecting their rebranding.
This affects the email backend path, settings names, and webhook URLs.
The old names will continue to work for now, but are deprecated. See
`Updating code from SendinBlue to Brevo <https://anymail.dev/en/stable/esps/brevo/#brevo-rename>`__
for details.

10.2

-----

*2023-10-25*

Features
~~~~~~~~

* **Resend**: Add support for this ESP
(`docs <https://anymail.dev/en/stable/esps/resend/>`__).

Fixes
~~~~~

* Correctly merge global ``SEND_DEFAULTS`` with message ``esp_extra``
for ESP APIs that use a nested structure (including Mandrill and SparkPost).
Clarify intent of global defaults merging code for other message properties.
(Thanks to `mounirmesselmeni`_ for reporting the issue.)

Other
~~~~~

* **Mailgun (docs):** Clarify account-level "Mailgun API keys" vs.
domain-level "sending API keys." (Thanks to `sdarwin`_ for
reporting the issue.)
* Test against prerelease versions of Django 5.0 and Python 3.12.

10.1

-----

*2023-07-31*

Features
~~~~~~~~

* **Inbound:** Improve `AnymailInboundMessage`'s handling of inline content:

* Rename `inline_attachments` to `content_id_map`, more accurately reflecting its function.
* Add new `inlines` property that provides a complete list of inline content,
 whether or not it includes a *Content-ID*. This is helpful for accessing
 inline images that appear directly in a *multipart/mixed* body, such as those
 created by the Apple Mail app.
* Rename `is_inline_attachment()` to just `is_inline()`.

The renamed items are still available, but deprecated, under their old names.
See `docs <http://anymail.dev/en/stable/inbound/#anymail.inbound.AnymailInboundMessage>`__.
(Thanks to `martinezleoml`_.)

* **Inbound:** `AnymailInboundMessage` now derives from Python's
`email.message.EmailMessage`, which provides improved compatibility with
email standards. (Thanks to `martinezleoml`_.)

* **Brevo (Sendinblue):** Sendinblue has rebranded to "Brevo." Change default
API endpoint to ``api.brevo.com``, and update docs to reflect new name. Anymail
still uses ``sendinblue`` in the backend name, for settings, etc., so there
should be no impact on your code. (Thanks to `sblondon`_.)

* **Brevo (Sendinblue):** Add support for inbound email. (See
`docs <https://anymail.dev/en/stable/esps/sendinblue/#sendinblue-inbound>`__.)

* **SendGrid:** Support multiple ``reply_to`` addresses.
(Thanks to `gdvalderrama`_ for pointing out the new API.)

Deprecations
~~~~~~~~~~~~

* **Inbound:** `AnymailInboundMessage.inline_attachments` and `.is_inline_attachment()`
have been renamed---see above.

10.0

-----

*2023-05-07*

Breaking changes
~~~~~~~~~~~~~~~~

* **Amazon SES:** The Amazon SES backend now sends using the SES v2 API.
Most projects should not require code changes, but you may need to update
your IAM permissions. See
`Migrating to the SES v2 API <https://anymail.dev/en/stable/esps/amazon_ses/#amazon-ses-v2>`__.

If you were using SES v2 under Anymail 9.1 or 9.2, change your
``EMAIL_BACKEND`` setting from ``amazon_sesv2`` to just ``amazon_ses``.

(If you are not ready to migrate to SES v2, an ``amazon_sesv1`` EmailBackend
is available. But Anymail will drop support for that later this year. See
`Using SES v1 (deprecated) <https://anymail.dev/en/stable/esps/amazon_ses/#amazon-ses-v1>`__.)

* **Amazon SES:** The "extra name" for installation must now be spelled with
a hyphen rather than an underscore: ``django-anymail[amazon-ses]``.
Be sure to update any dependencies specification (pip install, requirements.txt,
etc.) that had been using ``[amazon_ses]``. (This change is due to
package name normalization rules enforced by modern Python packaging tools.)

* **Mandrill:** Remove support for Mandrill-specific message attributes left over
from Djrill. These attributes have raised DeprecationWarnings since Anymail 0.3
(in 2016), but are now silently ignored. See
`Migrating from Djrill <https://anymail.dev/en/v10.0/esps/mandrill/#djrill-message-attributes>`__.

* Require Python 3.7 or later.

* Require urllib3 1.25 or later. (Drop a workaround for older urllib3 releases.
urllib3 is a requests dependency; version 1.25 was released 2019-04-29. Unless
you are pinning an earlier urllib3, this change should have no impact.)

Features
~~~~~~~~

* **Postmark inbound:**

* Handle Postmark's "Include raw email content in JSON payload"
 inbound option. We recommend enabling this in Postmark's dashboard
 to get the most accurate representation of received email.
* Obtain ``envelope_sender`` from *Return-Path* Postmark now provides.
 (Replaces potentially faulty *Received-SPF* header parsing.)
* Add *Bcc* header to inbound message if provided. Postmark adds bcc
 when the delivered-to address does not appear in the *To* header.

Other
~~~~~

* Modernize packaging. (Change from setup.py and setuptools
to pyproject.toml and hatchling.) Other than the ``amazon-ses``
naming normalization noted above, the new packaging should have
no impact. If you have trouble installing django-anymail v10 where
v9 worked, please report an issue including the exact install
command and pip version you are using.

9.2

-----

*2023-05-02*

Fixes
~~~~~

* Fix misleading error messages when sending with ``fail_silently=True``
and session creation fails (e.g., with Amazon SES backend and missing
credentials). (Thanks to `technolingo`_.)

* **Postmark inbound:** Fix spurious AnymailInvalidAddress in ``message.cc``
when inbound message has no Cc recipients. (Thanks to `Ecno92`_.)

* **Postmark inbound:** Add workaround for malformed test data sent by
Postmark's inbound webhook "Check" button. (See `304`_. Thanks to `Ecno92`_.)

Deprecations
~~~~~~~~~~~~

* This will be the last Anymail release to support Python 3.6
(which reached end-of-life on 2021-12-23).

Other
~~~~~

* Test against Django 4.2 release.

9.1

----

*2023-03-11*

Features
~~~~~~~~

* **Amazon SES:** Add support for sending through the Amazon SES v2 API
(not yet enabled by default; see Deprecations below;
`docs <https://anymail.dev/en/stable/esps/amazon_ses/#amazon-ses-v2>`__).

* **MailerSend:** Add support for this ESP
(`docs <https://anymail.dev/en/stable/esps/mailersend/>`__).

Deprecations
~~~~~~~~~~~~

* **Amazon SES:** Anymail will be switching to the Amazon SES v2 API.
Support for the original SES v1 API is now deprecated, and will be dropped in a
future Anymail release (likely in late 2023). Many projects will not
require code changes, but you may need to update your IAM permissions. See
`Migrating to the SES v2 API <https://anymail.dev/en/stable/esps/amazon_ses/#amazon-ses-v2>`__.

Other
~~~~~

* Test against Django 4.2 prerelease, Python 3.11 (with Django 4.2),
and PyPy 3.9.

* Use black, isort and doc8 to format code,
enforced via pre-commit. (Thanks to `tim-schilling`_.)

9.0

----

*2022-12-18*

Breaking changes
~~~~~~~~~~~~~~~~

* Require **Django 3.0 or later** and Python 3.6 or later. (For compatibility
with Django 2.x or Python 3.5, stay on the Anymail `v8.6 LTS`_ extended support
branch by setting your requirements to `django-anymail~=8.6`.)

Features
~~~~~~~~

* **Sendinblue:** Support delayed sending using Anymail's `send_at` option.
(Thanks to `dimitrisor`_ for noting Sendinblue's public beta release
of this capability.)
* Support customizing the requests.Session for requests-based backends,
and document how this can be used to mount an adapter that simplifies
automatic retry logic. (Thanks to `dgilmanAIDENTIFIED`_.)
* Confirm support for Django 4.1 and resolve deprecation warning regarding
``django.utils.timezone.utc``. (Thanks to `tim-schilling`_.)

Fixes
~~~~~

* **Postmark:** Handle Postmark's SubscriptionChange events as Anymail
unsubscribe, subscribe, or bounce tracking events, rather than "unknown".
(Thanks to `puru02`_ for the fix.)
* **Sendinblue:** Work around recent (unannounced) Sendinblue API change
that caused "Invalid headers" API error with non-string custom header
values. Anymail now converts int and float header values to strings.


Other
~~~~~

* Test on Python 3.11 with Django development (Django 4.2) branch.

8.6

--------

*2022-05-15*

This is an extended support release. Anymail v8.6 will receive security updates
and fixes for any breaking ESP API changes through at least May, 2023.

Fixes
~~~~~

* **Mailgun and SendGrid inbound:** Work around a Django limitation that
drops attachments with certain filenames. The missing attachments
are now simply omitted from the resulting inbound message. (In earlier
releases, they would cause a MultiValueDictKeyError in Anymail's
inbound webhook.)

Anymail documentation now recommends using Mailgun's and SendGrid's "raw MIME"
inbound options, which avoid the problem and preserve all attachments.

See `Mailgun inbound <https://anymail.dev/en/stable/esps/mailgun/#mailgun-inbound>`__
and `SendGrid inbound <https://anymail.dev/en/stable/esps/sendgrid/#sendgrid-inbound>`__
for details. (Thanks to `erikdrums`_ for reporting and helping investigate the problem.)

Other
~~~~~

* **Mailgun:** Document Mailgun's incorrect handling of display names containing
both non-ASCII characters and punctuation. (Thanks to `Flexonze`_ for spotting and
reporting the issue, and to Mailgun's `b0d0nne11`_ for investigating.)

* **Mandrill:** Document Mandrill's incorrect handling of non-ASCII attachment filenames.
(Thanks to `Thorbenl`_ for reporting the issue and following up with MailChimp.)

* Documentation (for all releases) is now hosted at anymail.dev (moved from anymail.info).

Deprecations
~~~~~~~~~~~~

*  This will be the last Anymail release to support Django 2.0--2.2 and Python 3.5.

If these deprecations affect you and you cannot upgrade, set your requirements to
`django-anymail~=8.6` (a "compatible release" specifier, equivalent to `>=8.6,==8.*`).

8.5

----

*2022-01-19*

Fixes
~~~~~

* Allow `attach_alternative("content", "text/plain")` in place of setting
an EmailMessage's `body`, and generally improve alternative part
handling for consistency with Django's SMTP EmailBackend.
(Thanks to `cjsoftuk`_ for reporting the issue.)

* Remove "sending a message from *sender* to *recipient*" from `AnymailError`
text, as this can unintentionally leak personal information into logs.
[Note that `AnymailError` *does* still include any error description
from your ESP, and this often contains email addresses and other content
from the sent message. If this is a concern, you can adjust Django's logging
config to limit collection from Anymail or implement custom PII filtering.]
(Thanks to `coupa-anya`_ for reporting the issue.)


Other
~~~~~

* **Postmark:** Document limitation on `track_opens` overriding Postmark's
server-level setting. (See
`docs <https://anymail.dev/en/stable/esps/postmark/#limitations-and-quirks>`__.)

* Expand `testing documentation <https://anymail.dev/en/stable/tips/testing/>`__
to cover tracking events and inbound handling, and to clarify test EmailBackend behavior.

* In Anymail's test EmailBackend, add `is_batch_send` boolean to `anymail_test_params`
to help tests check whether a sent message would fall under Anymail's batch-send logic.

8.4

----

*2021-06-15*

Features
~~~~~~~~

* **Postal:** Add support for this self-hosted ESP
(`docs <https://anymail.dev/en/stable/esps/postal>`__).
Thanks to `tiltec`_ for researching, implementing, testing and
documenting Postal support.

8.3

----

*2021-05-19*

Fixes
~~~~~

* **Amazon SES:** Support receiving and tracking mail in non-default (or multiple)
AWS regions. Anymail now always confirms an SNS subscription in the region where
the SNS topic exists, which may be different from the boto3 default. (Thanks to
`mark-mishyn`_ for reporting this.)

* **Postmark:** Fix two different errors when sending with a template but no merge
data. (Thanks to `kareemcoding`_ and `Tobeyforce`_ for reporting them.)

* **Postmark:** Fix silent failure when sending with long metadata keys and some
other errors Postmark detects at send time. Report invalid 'cc' and 'bcc' addresses
detected at send time the same as 'to' recipients. (Thanks to `chrisgrande`_ for
reporting the problem.)

8.2

-----

*2021-01-27*

Features
~~~~~~~~

* **Mailgun:** Add support for AMP for Email
(via ``message.attach_alternative(..., "text/x-amp-html")``).

Fixes
~~~~~

* **SparkPost:** Drop support for multiple `from_email` addresses. SparkPost has
started issuing a cryptic "No sending domain specified" error for this case; with
this fix, Anymail will now treat it as an unsupported feature.

Other
~~~~~

* **Mailgun:** Improve error messages for some common configuration issues.

* Test against Django 3.2 prerelease (including support for Python 3.9)

* Document how to send AMP for Email with Django, and note which ESPs support it.
(See `docs <https://anymail.dev/en/stable/sending/django_email/#amp-email>`__.)

* Move CI testing to GitHub Actions (and stop using Travis-CI).

* Internal: catch invalid recipient status earlier in ESP response parsing

8.1

----

*2020-10-09*

Features
~~~~~~~~

* **SparkPost:** Add option for event tracking webhooks to map SparkPost's "Initial Open"
event to Anymail's normalized "opened" type. (By default, only SparkPost's "Open" is
reported as Anymail "opened", and "Initial Open" maps to "unknown" to avoid duplicates.
See `docs <https://anymail.dev/en/stable/esps/sparkpost/#sparkpost-webhooks>`__.
Thanks to `slinkymanbyday`_.)

* **SparkPost:** In event tracking webhooks, map AMP open and click events to the
corresponding Anymail normalized event types. (Previously these were treated as
as "unknown" events.)

8.0

----

*2020-09-11*

Breaking changes
~~~~~~~~~~~~~~~~

* Require **Django 2.0 or later** and Python 3. (For compatibility 

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.

1 participant