Opened 9 years ago
Closed 9 years ago
#5441 closed defect (fixed)
raw_input is depreceated in python3
Reported by: | Espionage724 | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | programming | Keywords: | gmg python3 util.py raw_input input |
Cc: | Parent Tickets: |
Description
Was trying out python3 and was trying to add a new user via gmg. I was getting this error:
Traceback (most recent call last): File "/srv/www/media/bin/gmg", line 9, in <module> load_entry_point('mediagoblin', 'console_scripts', 'gmg')() File "/srv/www/media/mediagoblin/gmg_commands/__init__.py", line 148, in main_cli args.func(args) File "/srv/www/media/mediagoblin/gmg_commands/users.py", line 46, in adduser args.email = commands_util.prompt_if_not_set(args.email, "Email:") File "/srv/www/media/mediagoblin/gmg_commands/util.py", line 36, in prompt_if_not_set variable=raw_input(text + u' ') NameError: name 'raw_input' is not defined
Did a little searching and noticed: https://www.codecademy.com/forum_questions/535b85237c82ca9f46000f87#answer-535ba57f52f86373e30012ce
In Python 3.x, input() replaces raw_input(), for input from the console.
So I edited mediagoblin/gmg_commands/util.py and changed the only raw_input occurrence to input, re-ran the gmg command, and it created the user successfully (or said it did anyway; haven't tested it yet :p).
Outside of this one situation, I'm not sure if raw_input affects anything else.
Fixed in stable and master. Thanks for the report!