Skip to content

Commit

Permalink
Version 3.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
mborsetti committed Mar 16, 2024
1 parent 1232e1d commit a948fb7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 22 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.rst
Expand Up @@ -32,6 +32,14 @@ can check out the `wish list <https://github.com/mborsetti/webchanges/blob/main/
Security, in case of vulnerabilities. [triggers a minor patch]
Internals, for changes that don't affect users. [triggers a minor patch]
Version 3.20.1
===================
2024-03-16

Fixed
-----
* Regression introduced in supporting sending to multiple "to" addresses.


Version 3.20
===================
Expand Down
12 changes: 1 addition & 11 deletions RELEASE.rst
@@ -1,13 +1,3 @@
Added
-----
* ``re.findall`` filter to extract, delete or replace non-overlapping text using Python ``re.findall``.

Changed
-------
* ``--test-reporter`` now allows testing of reporters that are not enabled; if a reporter is not enabled, a warning
will be issued. This simplifies testing.
* ``email`` reporter (both SMTP and sendmail) supports sending to multiple "to" addresses.

Fixed
-----
* Reports from jobs with ``monospace: true`` were not being rendered correctly in Gmail.
* Regression introduced in supporting sending to multiple "to" addresses.
2 changes: 1 addition & 1 deletion webchanges/__init__.py
Expand Up @@ -21,7 +21,7 @@
# * MINOR version when you add functionality in a backwards compatible manner, and
# * MICRO or PATCH version when you make backwards compatible bug fixes. We no longer use '0'
# If unsure on increments, use pkg_resources.parse_version to parse
__version__ = '3.20'
__version__ = '3.20.1'
__description__ = (
'Check web (or command output) for changes since last run and notify.\n'
'\n'
Expand Down
12 changes: 2 additions & 10 deletions webchanges/mailer.py
Expand Up @@ -10,8 +10,6 @@
import subprocess # noqa: S404 Consider possible security implications associated with the subprocess module.
from dataclasses import dataclass
from email import policy
from email.errors import InvalidHeaderDefect
from email.headerregistry import Address
from email.message import EmailMessage
from email.utils import formatdate
from pathlib import Path
Expand Down Expand Up @@ -50,14 +48,8 @@ def msg(
:param html_body: The body in html format (optional)
"""
msg = EmailMessage(policy=policy.SMTPUTF8)
try:
msg['From'] = Address(from_email) # type: ignore[assignment] # mypy bug
except InvalidHeaderDefect as e:
raise ValueError(f"Reporter email's 'from' email address is incorrect: {e.args[0]}")
try:
msg['To'] = (Address(addr.strip()) for addr in to_email.split(',')) # type: ignore[assignment] # mypy bug
except InvalidHeaderDefect as e:
raise ValueError(f"Reporter email's 'to' email address is incorrect: {e.args[0]}")
msg['from'] = from_email
msg['to'] = to_email
msg['Subject'] = subject
msg['Date'] = formatdate(localtime=True)
msg.set_content(text_body, subtype='plain')
Expand Down

0 comments on commit a948fb7

Please sign in to comment.