diff --git a/product/ERP5/bootstrap/erp5_core/ExtensionTemplateItem/portal_components/extension.erp5.DocumentExtraction.py b/product/ERP5/bootstrap/erp5_core/ExtensionTemplateItem/portal_components/extension.erp5.DocumentExtraction.py index 61af6ac2b817bdb89d500a33e65880ab1b6277e4..efa1c1065031adcd3e1f9a2d0559c0d87dea9abf 100644 --- a/product/ERP5/bootstrap/erp5_core/ExtensionTemplateItem/portal_components/extension.erp5.DocumentExtraction.py +++ b/product/ERP5/bootstrap/erp5_core/ExtensionTemplateItem/portal_components/extension.erp5.DocumentExtraction.py @@ -26,9 +26,13 @@ ############################################################################## import string, re +import six redundant_chars='"\'.:;,-+<>()*~' # chars we need to strip from a word before we see if it matches, and from the searchwords to eliminate boolean mode chars -tr=string.maketrans(redundant_chars,' '*len(redundant_chars)) +if six.PY2: + tr=string.maketrans(redundant_chars,' '*len(redundant_chars)) +else: + tr = str.maketrans('', '', redundant_chars) class Done(Exception): pass diff --git a/product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.CachedConvertableMixin.py b/product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.CachedConvertableMixin.py index 69fedd8b13150a1e292c19c1c70f6c340f55432c..4397e131abaecdc9e252e0b723c69caeb960b6f2 100644 --- a/product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.CachedConvertableMixin.py +++ b/product/ERP5/bootstrap/erp5_core/MixinTemplateItem/portal_components/mixin.erp5.CachedConvertableMixin.py @@ -103,8 +103,12 @@ class CachedConvertableMixin: http://pypi.python.org/pypi/uuid/ to generate a uuid stored as private property. """ - format_cache_id = str(makeSortedTuple(kw)).\ - translate(string.maketrans('', ''), '[]()<>\'", ') + if six.PY2: + format_cache_id = str(makeSortedTuple(kw)).\ + translate(string.maketrans('', ''), '[]()<>\'", ') + else: + format_cache_id = str(makeSortedTuple(kw)).\ + translate(str.maketrans('', '', '[]()<>\'", ')) return '%s:%s:%s' % (aq_base(self).getUid(), self.getRevision(), format_cache_id)