From 4452f24a195efb25c40a886894c9c8385af762cc Mon Sep 17 00:00:00 2001
From: Emmeline Vouriot <emmeline.vouriot@nexedi.com>
Date: Sat, 29 Jul 2023 18:29:02 +0200
Subject: [PATCH] fix function names WIP

---
 .../portal_components/tool.erp5.ContributionTool.py   |  2 +-
 product/ERP5Type/Utils.py                             | 11 +++++------
 2 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.ContributionTool.py b/product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.ContributionTool.py
index 860204a99b6..e693f5f7ff5 100644
--- a/product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.ContributionTool.py
+++ b/product/ERP5/bootstrap/erp5_core/ToolComponentTemplateItem/portal_components/tool.erp5.ContributionTool.py
@@ -647,7 +647,7 @@ class ContributionTool(BaseTool):
     # if a content-disposition header is present,
     # try first to read the suggested filename from it.
     header_info = url_file.info()
-    content_disposition = header_info.getheader('content-disposition', '')
+    content_disposition = header_info.get('content-disposition', '')
     filename = parse_header(content_disposition)[1].get('filename')
     if not filename:
       # Now read the filename from url.
diff --git a/product/ERP5Type/Utils.py b/product/ERP5Type/Utils.py
index 401c5aa9280..529a303a0a1 100644
--- a/product/ERP5Type/Utils.py
+++ b/product/ERP5Type/Utils.py
@@ -29,7 +29,6 @@
 
 # Required modules - some modules are imported later to prevent circular deadlocks
 from __future__ import absolute_import
-from six import int2byte as chr
 from six import string_types as basestring
 from six.moves import xrange
 import six
@@ -1855,11 +1854,11 @@ def guessEncodingFromText(data, content_type='text/html'):
 
 _reencodeUrlEscapes_map = {chr(x): chr(x) if chr(x) in
     # safe
-    str2bytes("!'()*-." "0123456789" "_~"
-              "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
-              "abcdefghijklmnopqrstuvwxyz"
-              # reserved (maybe unsafe)
-              "#$&+,/:;=?@[]")
+    "!'()*-." "0123456789" "_~"
+    "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+    "abcdefghijklmnopqrstuvwxyz"
+    # reserved (maybe unsafe)
+    "#$&+,/:;=?@[]"
   else "%%%02X" % x
   for x in xrange(256)}
 
-- 
2.30.9