From d09c479dc122572f4503f70ebad2c1e055eea5e4 Mon Sep 17 00:00:00 2001 From: "mathieu.pequin" Date: Thu, 5 May 2022 22:13:38 +0200 Subject: [PATCH] Fix BytesHeaderParser parse bytes again --- ikaaro/__init__.py | 2 +- ikaaro/server.py | 6 +++--- setup.conf | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ikaaro/__init__.py b/ikaaro/__init__.py index 10240964..0c883451 100644 --- a/ikaaro/__init__.py +++ b/ikaaro/__init__.py @@ -55,7 +55,7 @@ # The version -__version__ = "0.80.2" +__version__ = "0.80.5" __version_info__ = tuple( int(num) if num.isdigit() else num for num in __version__.replace("-", ".", 1).split(".") diff --git a/ikaaro/server.py b/ikaaro/server.py index b7228ed2..a130658f 100755 --- a/ikaaro/server.py +++ b/ikaaro/server.py @@ -20,7 +20,7 @@ # Import from the Standard Library #from cProfile import runctx -from email.parser import HeaderParser +from email.parser import BytesHeaderParser from json import loads from io import BytesIO from datetime import timedelta @@ -796,8 +796,8 @@ def get_names(): # 3. Send message try: - message = spool.open(name, mode="r", text=True).read() - headers = HeaderParser().parsestr(message) + message = spool.open(name).read() + headers = BytesHeaderParser().parsebytes(message) subject = headers['subject'] from_addr = headers['from'] to_addr = headers['to'] diff --git a/setup.conf b/setup.conf index cc2ef10c..f2050ea5 100644 --- a/setup.conf +++ b/setup.conf @@ -7,7 +7,7 @@ url = "http://www.hforge.org/ikaaro" author_name = "J. David Ibáñez" author_email = "jdavid.ibp@gmail.com" license = "GNU General Public License (GPL)" -version=0.80.2 +version=0.80.5 # Longer description description = "A Content Management System built on Python & itools"