# HG changeset patch # User RhodeCode Admin # Date 2023-08-25 10:51:20 # Node ID 5ce7d4ae1aa2a5666e2c3bfa32f55bcd5f0e8195 # Parent e3745ca4b35bbfd8e34be17fdf8abbafbab98e7f prompts: fixed input() calls for python3 diff --git a/rhodecode/lib/db_manage.py b/rhodecode/lib/db_manage.py --- a/rhodecode/lib/db_manage.py +++ b/rhodecode/lib/db_manage.py @@ -276,7 +276,7 @@ class DbManage(object): email = defaults.get('email') if username is None: - username = eval(input('Specify admin username:')) + username = input('Specify admin username:') if password is None: password = self._get_admin_password() if not password: @@ -285,7 +285,7 @@ class DbManage(object): if not password: sys.exit() if email is None: - email = eval(input('Specify admin email:')) + email = input('Specify admin email:') api_key = self.cli_args.get('api_key') self.create_user(username, password, email, True, strict_creation_check=False, @@ -524,10 +524,10 @@ class DbManage(object): if _path is not None: path = _path elif not self.tests and not test_repo_path: - path = eval(input( + path = input( 'Enter a valid absolute path to store repositories. ' 'All repositories in that path will be added automatically:' - )) + ) else: path = test_repo_path path_ok = True diff --git a/rhodecode/lib/rc_beaker.py b/rhodecode/lib/rc_beaker.py --- a/rhodecode/lib/rc_beaker.py +++ b/rhodecode/lib/rc_beaker.py @@ -17,7 +17,6 @@ from zope.interface import implementer from binascii import hexlify - class CustomSession(Session): pass @@ -109,7 +108,7 @@ def BeakerSessionFactoryConfig(**options return storage def peek_flash(self, queue=''): - storage = self.get('_f_' + queue, []) + storage = self.get(f'_f_{queue}', []) return storage # CSRF API methods diff --git a/rhodecode/lib/utils.py b/rhodecode/lib/utils.py --- a/rhodecode/lib/utils.py +++ b/rhodecode/lib/utils.py @@ -321,7 +321,7 @@ def is_valid_repo_group(repo_group_name, def ask_ok(prompt, retries=4, complaint='[y]es or [n]o please!'): while True: - ok = eval(input(prompt)) + ok = input(prompt) if ok.lower() in ('y', 'ye', 'yes'): return True if ok.lower() in ('n', 'no', 'nop', 'nope'):