CubicWeb still use raw_input to retrieve user input
During one of our migration (with Python 3.7 and CubicWeb 3.26.19), we've got the following traceback:
File "/lib/python3.7/site-packages/cubicweb/migration.py", line 142, in <lambda>
meth=meth)
File "/lib/python3.7/site-packages/cubicweb/migration.py", line 205, in interact
return meth(*args, **kwargs)
File "/lib/python3.7/site-packages/cubicweb/server/migractions.py", line 1120, in cmd_add_relation_definition
self.group_mapping()))
File "/lib/python3.7/site-packages/logilab/common/decorators.py", line 69, in wrapped
return self.__call__(*args, **kwargs)
File "/lib/python3.7/site-packages/logilab/common/decorators.py", line 63, in __call__
value = __me.callable(self, *args)
File "/lib/python3.7/site-packages/cubicweb/server/migractions.py", line 312, in group_mapping
return ss.group_mapping(self.cnx)
File "/lib/python3.7/site-packages/cubicweb/server/schemaserial.py", line 61, in group_mapping
value = raw_input('eid for group %s: ' % group).strip()
NameError: name 'raw_input' is not defined
By looking inside the source code of the latest CubicWeb version, we can find some references to raw_input
:
doc/tools/mode_plan.py:31: if raw_input('accept [y/N]?').lower() =='y':
cubicweb/server/schemaserial.py:57: value = raw_input('eid for group %s: ' % group).strip()
cubicweb/misc/migration/3.22.0_Any.py:6: timezone = raw_input('enter your timezone')
cubicweb/misc/scripts/chpasswd.py:29: login = raw_input("login? ")
cubicweb/misc/scripts/ldap_change_base_dn.py:15:raw_input("Ensure you've stopped the instance, type enter when done.")
cubicweb/devtools/stresstester.py:165: user = raw_input('login: ')
This method was removed with Python 3 and we must use input
instead to retrieve user's input.