git: c7de22835ee0 - 2022Q4 - devel/py-marrow.mailer: Fix runtime with Python 3.9+

From: Danilo G. Baio <dbaio_at_FreeBSD.org>
Date: Fri, 02 Dec 2022 22:30:46 UTC
The branch 2022Q4 has been updated by dbaio:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c7de22835ee048e750877aee286843bf787b5a94

commit c7de22835ee048e750877aee286843bf787b5a94
Author:     Danilo G. Baio <dbaio@FreeBSD.org>
AuthorDate: 2022-12-02 17:46:51 +0000
Commit:     Danilo G. Baio <dbaio@FreeBSD.org>
CommitDate: 2022-12-02 22:30:05 +0000

    devel/py-marrow.mailer: Fix runtime with Python 3.9+
    
    MFH:            2022Q4
    (cherry picked from commit b765c5966e82d572d7d933159f7651d5aae77cb6)
---
 devel/py-marrow.mailer/Makefile                             |  1 +
 devel/py-marrow.mailer/files/patch-marrow_mailer_message.py | 13 +++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/devel/py-marrow.mailer/Makefile b/devel/py-marrow.mailer/Makefile
index 2534efe751ac..7d9659644ec8 100644
--- a/devel/py-marrow.mailer/Makefile
+++ b/devel/py-marrow.mailer/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	marrow.mailer
 PORTVERSION=	4.0.3
+PORTREVISION=	1
 CATEGORIES=	devel python
 MASTER_SITES=	CHEESESHOP
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
diff --git a/devel/py-marrow.mailer/files/patch-marrow_mailer_message.py b/devel/py-marrow.mailer/files/patch-marrow_mailer_message.py
new file mode 100644
index 000000000000..64d50b234ad6
--- /dev/null
+++ b/devel/py-marrow.mailer/files/patch-marrow_mailer_message.py
@@ -0,0 +1,13 @@
+# base64.encodestring()
+# Deprecated alias of encodebytes(), removed in Python 3.9
+--- marrow/mailer/message.py.orig	2019-09-16 00:05:09 UTC
++++ marrow/mailer/message.py
+@@ -305,7 +305,7 @@ class Message(object):
+ 		else:
+ 			raise TypeError("Unable to read attachment contents")
+ 		
+-		part.set_payload(base64.encodestring(value))
++		part.set_payload(base64.encodebytes(value))
+ 
+ 		if not filename:
+ 			filename = name