From 4fb37095fb2e4890fdb1265e5079d2148bb7fb43 Mon Sep 17 00:00:00 2001 From: RhodeCode Admin Date: Mon, 6 Mar 2023 23:38:06 +0100 Subject: [PATCH] python3: 2to3 fixes in utils2 --- rhodecode/lib/utils2.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/rhodecode/lib/utils2.py b/rhodecode/lib/utils2.py index 20a5f1ba..e7342719 100644 --- a/rhodecode/lib/utils2.py +++ b/rhodecode/lib/utils2.py @@ -54,6 +54,7 @@ from rhodecode.translation import _, _pluralize from rhodecode.lib.str_utils import safe_str, safe_int, safe_bytes from rhodecode.lib.hash_utils import md5, md5_safe, sha1, sha1_safe from rhodecode.lib.type_utils import aslist, str2bool +from functools import reduce #TODO: there's no longer safe_unicode, we mock it now, but should remove it safe_unicode = safe_str @@ -644,7 +645,7 @@ def obfuscate_url_pw(engine): _url.password = 'XXXXX' except Exception: pass - return unicode(_url) + return str(_url) def get_server_url(environ): @@ -882,7 +883,7 @@ def parse_byte_string(size_str): _parts = match.groups() num, type_ = _parts - return long(num) * {'mb': 1024*1024, 'kb': 1024}[type_.lower()] + return int(num) * {'mb': 1024*1024, 'kb': 1024}[type_.lower()] class CachedProperty(object):