From 0d9b480ee709da5a702a4dce28541045457b8ecb Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 4 Feb 2021 10:54:29 +0000 Subject: [PATCH] [REM] core: useless translation mark I misremembered that `_` would go look for the translation stuff through the stack, but it only goes up to the caller of `_` itself. Since `clean_filename` has no `cr`, `cursor` or `self` that's never going to do anything, and it's thus completely useless. closes odoo/odoo#65534 X-original-commit: ab3122448079d998e88f77704df62d1b1871e918 Signed-off-by: Xavier Morel (xmo) --- odoo/tools/osutil.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/odoo/tools/osutil.py b/odoo/tools/osutil.py index 422b915e5fa..a7a716311e9 100644 --- a/odoo/tools/osutil.py +++ b/odoo/tools/osutil.py @@ -13,8 +13,6 @@ import zipfile from contextlib import contextmanager from os.path import join as opj -from .translate import _ - _logger = logging.getLogger(__name__) WINDOWS_RESERVED = re.compile(r''' @@ -53,8 +51,8 @@ def clean_filename(name, replacement=''): :rtype: str """ if WINDOWS_RESERVED.match(name): - return _("Untitled") - return re.sub(r'[^\w_.()\[\] -]+', replacement, name).lstrip('.-') or _("Untitled") + return "Untitled" + return re.sub(r'[^\w_.()\[\] -]+', replacement, name).lstrip('.-') or "Untitled" def listdir(dir, recursive=False): """Allow to recursively get the file listing following symlinks, returns