# HG changeset patch # User RhodeCode Admin # Date 2023-03-06 22:38:06 # Node ID e08168552d58988cda159d5923c79e98a7f8a639 # Parent daf8135e73956645928dc1b4a76bfef69de26ecb python3: 2to3 fixes in utils2 diff --git a/rhodecode/lib/utils2.py b/rhodecode/lib/utils2.py --- a/rhodecode/lib/utils2.py +++ b/rhodecode/lib/utils2.py @@ -54,6 +54,7 @@ from rhodecode.translation import _, _pl 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):