@@ -572,12 +572,10 @@ class File(Document): | |||||
@staticmethod | @staticmethod | ||||
def zip_files(files): | def zip_files(files): | ||||
from six import string_types | |||||
zip_file = io.BytesIO() | zip_file = io.BytesIO() | ||||
zf = zipfile.ZipFile(zip_file, "w", zipfile.ZIP_DEFLATED) | zf = zipfile.ZipFile(zip_file, "w", zipfile.ZIP_DEFLATED) | ||||
for _file in files: | for _file in files: | ||||
if isinstance(_file, string_types): | |||||
if isinstance(_file, str): | |||||
_file = frappe.get_doc("File", _file) | _file = frappe.get_doc("File", _file) | ||||
if not isinstance(_file, File): | if not isinstance(_file, File): | ||||
continue | continue | ||||
@@ -11,7 +11,6 @@ import quopri | |||||
from email.parser import Parser | from email.parser import Parser | ||||
from email.policy import SMTPUTF8 | from email.policy import SMTPUTF8 | ||||
from html2text import html2text | from html2text import html2text | ||||
from six.moves import html_parser as HTMLParser | |||||
import frappe | import frappe | ||||
from frappe import _, safe_encode, task | from frappe import _, safe_encode, task | ||||
@@ -445,7 +444,7 @@ class QueueBuilder: | |||||
try: | try: | ||||
text_content = html2text(self._message) | text_content = html2text(self._message) | ||||
except HTMLParser.HTMLParseError: | |||||
except Exception: | |||||
text_content = "See html attachment" | text_content = "See html attachment" | ||||
return text_content + unsubscribe_text_message | return text_content + unsubscribe_text_message | ||||
@@ -8,7 +8,6 @@ from functools import wraps | |||||
from typing import Dict, Optional | from typing import Dict, Optional | ||||
import yaml | import yaml | ||||
from six import iteritems | |||||
from werkzeug.wrappers import Response | from werkzeug.wrappers import Response | ||||
import frappe | import frappe | ||||
@@ -464,7 +463,7 @@ def build_response(path, data, http_status_code, headers: Optional[Dict] = None) | |||||
add_preload_headers(response) | add_preload_headers(response) | ||||
if headers: | if headers: | ||||
for key, val in iteritems(headers): | |||||
for key, val in headers.items(): | |||||
response.headers[key] = val.encode("ascii", errors="xmlcharrefreplace") | response.headers[key] = val.encode("ascii", errors="xmlcharrefreplace") | ||||
return response | return response | ||||
@@ -59,7 +59,6 @@ rq~=1.8.0 | |||||
rsa>=4.1 # not directly required, pinned by Snyk to avoid a vulnerability | rsa>=4.1 # not directly required, pinned by Snyk to avoid a vulnerability | ||||
schedule~=1.1.0 | schedule~=1.1.0 | ||||
semantic-version~=2.8.5 | semantic-version~=2.8.5 | ||||
six~=1.15.0 | |||||
sqlparse~=0.4.1 | sqlparse~=0.4.1 | ||||
stripe~=2.56.0 | stripe~=2.56.0 | ||||
terminaltables~=3.1.0 | terminaltables~=3.1.0 | ||||