Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • cubicweb cubicweb
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 195
    • Issues 195
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • cubicweb
  • cubicwebcubicweb
  • Issues
  • #297

Closed
Open
Created Apr 15, 2021 by Aurelien Lubert@alubert☕Maintainer

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.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking