python3: 2to3 fixes in utils2

This commit is contained in:
RhodeCode Admin 2023-03-06 23:38:06 +01:00
parent 92fe8c512d
commit 4fb37095fb

View file

@ -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):