Opened 8 years ago

Closed 8 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 raw_input input
Cc: Parent Tickets:


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/", line 148, in main_cli
  File "/srv/www/media/mediagoblin/gmg_commands/", line 46, in adduser = commands_util.prompt_if_not_set(, "Email:")
  File "/srv/www/media/mediagoblin/gmg_commands/", 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:

In Python 3.x, input() replaces raw_input(), for input from the console.

So I edited mediagoblin/gmg_commands/ 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.

Change History (1)

comment:1 by berkerpeksag, 8 years ago

Resolution: fixed
Status: newclosed

Fixed in stable and master. Thanks for the report!

Note: See TracTickets for help on using tickets.